- Consolidated duplicate UndoManagers to single instance - Fixed connection promise to only resolve on 'connected' status - Fixed WebSocketProvider import (WebsocketProvider) - Added proper doc.destroy() cleanup - Renamed isPresenceInitialized property to avoid conflict Co-Authored-By: Paperclip <noreply@paperclip.ing>
1990 lines
33 KiB
TypeScript
1990 lines
33 KiB
TypeScript
/* [Multicall3](https://github.com/mds1/multicall) */
|
|
export const multicall3Abi = [
|
|
{
|
|
inputs: [
|
|
{
|
|
components: [
|
|
{
|
|
name: 'target',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'allowFailure',
|
|
type: 'bool',
|
|
},
|
|
{
|
|
name: 'callData',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
name: 'calls',
|
|
type: 'tuple[]',
|
|
},
|
|
],
|
|
name: 'aggregate3',
|
|
outputs: [
|
|
{
|
|
components: [
|
|
{
|
|
name: 'success',
|
|
type: 'bool',
|
|
},
|
|
{
|
|
name: 'returnData',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
name: 'returnData',
|
|
type: 'tuple[]',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'addr',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'getEthBalance',
|
|
outputs: [
|
|
{
|
|
name: 'balance',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: 'getCurrentBlockTimestamp',
|
|
outputs: [
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'timestamp',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
] as const
|
|
|
|
export const batchGatewayAbi = [
|
|
{
|
|
name: 'query',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
type: 'tuple[]',
|
|
name: 'queries',
|
|
components: [
|
|
{
|
|
type: 'address',
|
|
name: 'sender',
|
|
},
|
|
{
|
|
type: 'string[]',
|
|
name: 'urls',
|
|
},
|
|
{
|
|
type: 'bytes',
|
|
name: 'data',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool[]',
|
|
name: 'failures',
|
|
},
|
|
{
|
|
type: 'bytes[]',
|
|
name: 'responses',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'HttpError',
|
|
type: 'error',
|
|
inputs: [
|
|
{
|
|
type: 'uint16',
|
|
name: 'status',
|
|
},
|
|
{
|
|
type: 'string',
|
|
name: 'message',
|
|
},
|
|
],
|
|
},
|
|
] as const
|
|
|
|
const universalResolverErrors = [
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'dns',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
name: 'DNSDecodingFailed',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'ens',
|
|
type: 'string',
|
|
},
|
|
],
|
|
name: 'DNSEncodingFailed',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: 'EmptyAddress',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'status',
|
|
type: 'uint16',
|
|
},
|
|
{
|
|
name: 'message',
|
|
type: 'string',
|
|
},
|
|
],
|
|
name: 'HttpError',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: 'InvalidBatchGatewayResponse',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'errorData',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
name: 'ResolverError',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'name',
|
|
type: 'bytes',
|
|
},
|
|
{
|
|
name: 'resolver',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'ResolverNotContract',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'name',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
name: 'ResolverNotFound',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'primary',
|
|
type: 'string',
|
|
},
|
|
{
|
|
name: 'primaryAddress',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
name: 'ReverseAddressMismatch',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'bytes4',
|
|
name: 'selector',
|
|
type: 'bytes4',
|
|
},
|
|
],
|
|
name: 'UnsupportedResolverProfile',
|
|
type: 'error',
|
|
},
|
|
] as const
|
|
|
|
export const universalResolverResolveAbi = [
|
|
...universalResolverErrors,
|
|
{
|
|
name: 'resolveWithGateways',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ name: 'name', type: 'bytes' },
|
|
{ name: 'data', type: 'bytes' },
|
|
{ name: 'gateways', type: 'string[]' },
|
|
],
|
|
outputs: [
|
|
{ name: '', type: 'bytes' },
|
|
{ name: 'address', type: 'address' },
|
|
],
|
|
},
|
|
] as const
|
|
|
|
export const universalResolverReverseAbi = [
|
|
...universalResolverErrors,
|
|
{
|
|
name: 'reverseWithGateways',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ type: 'bytes', name: 'reverseName' },
|
|
{ type: 'uint256', name: 'coinType' },
|
|
{ type: 'string[]', name: 'gateways' },
|
|
],
|
|
outputs: [
|
|
{ type: 'string', name: 'resolvedName' },
|
|
{ type: 'address', name: 'resolver' },
|
|
{ type: 'address', name: 'reverseResolver' },
|
|
],
|
|
},
|
|
] as const
|
|
|
|
export const textResolverAbi = [
|
|
{
|
|
name: 'text',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ name: 'name', type: 'bytes32' },
|
|
{ name: 'key', type: 'string' },
|
|
],
|
|
outputs: [{ name: '', type: 'string' }],
|
|
},
|
|
] as const
|
|
|
|
export const addressResolverAbi = [
|
|
{
|
|
name: 'addr',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [{ name: 'name', type: 'bytes32' }],
|
|
outputs: [{ name: '', type: 'address' }],
|
|
},
|
|
{
|
|
name: 'addr',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ name: 'name', type: 'bytes32' },
|
|
{ name: 'coinType', type: 'uint256' },
|
|
],
|
|
outputs: [{ name: '', type: 'bytes' }],
|
|
},
|
|
] as const
|
|
|
|
// ERC-1271
|
|
// isValidSignature(bytes32 hash, bytes signature) → bytes4 magicValue
|
|
/** @internal */
|
|
export const erc1271Abi = [
|
|
{
|
|
name: 'isValidSignature',
|
|
type: 'function',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{ name: 'hash', type: 'bytes32' },
|
|
{ name: 'signature', type: 'bytes' },
|
|
],
|
|
outputs: [{ name: '', type: 'bytes4' }],
|
|
},
|
|
] as const
|
|
|
|
// ERC-6492 - universal deployless signature validator contract
|
|
// constructor(address _signer, bytes32 _hash, bytes _signature) → bytes4 returnValue
|
|
// returnValue is either 0x1 (valid) or 0x0 (invalid)
|
|
export const erc6492SignatureValidatorAbi = [
|
|
{
|
|
inputs: [
|
|
{
|
|
name: '_signer',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: '_hash',
|
|
type: 'bytes32',
|
|
},
|
|
{
|
|
name: '_signature',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'constructor',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: '_signer',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: '_hash',
|
|
type: 'bytes32',
|
|
},
|
|
{
|
|
name: '_signature',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
name: 'isValidSig',
|
|
},
|
|
] as const
|
|
|
|
/** [ERC-20 Token Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-20) */
|
|
export const erc20Abi = [
|
|
{
|
|
type: 'event',
|
|
name: 'Approval',
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'value',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'event',
|
|
name: 'Transfer',
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'value',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'allowance',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'approve',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'balanceOf',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'account',
|
|
type: 'address',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'decimals',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'uint8',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'name',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'string',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'symbol',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'string',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'totalSupply',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'transfer',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{
|
|
name: 'recipient',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'transferFrom',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{
|
|
name: 'sender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'recipient',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
},
|
|
] as const
|
|
|
|
/**
|
|
* [bytes32-flavored ERC-20](https://docs.makerdao.com/smart-contract-modules/mkr-module#4.-gotchas-potential-source-of-user-error)
|
|
* for tokens (ie. Maker) that use bytes32 instead of string.
|
|
*/
|
|
export const erc20Abi_bytes32 = [
|
|
{
|
|
type: 'event',
|
|
name: 'Approval',
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'value',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'event',
|
|
name: 'Transfer',
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'value',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'allowance',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'approve',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'balanceOf',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'account',
|
|
type: 'address',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'decimals',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'uint8',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'name',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'bytes32',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'symbol',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'bytes32',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'totalSupply',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'transfer',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{
|
|
name: 'recipient',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'transferFrom',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{
|
|
name: 'sender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'recipient',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
},
|
|
] as const
|
|
|
|
/** [ERC-1155 Multi Token Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-1155) */
|
|
export const erc1155Abi = [
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'sender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'balance',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'needed',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'ERC1155InsufficientBalance',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'approver',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'ERC1155InvalidApprover',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'idsLength',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'valuesLength',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'ERC1155InvalidArrayLength',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'ERC1155InvalidOperator',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'receiver',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'ERC1155InvalidReceiver',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'sender',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'ERC1155InvalidSender',
|
|
type: 'error',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'address',
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'ERC1155MissingApprovalForAll',
|
|
type: 'error',
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
internalType: 'address',
|
|
name: 'account',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
internalType: 'address',
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: 'bool',
|
|
name: 'approved',
|
|
type: 'bool',
|
|
},
|
|
],
|
|
name: 'ApprovalForAll',
|
|
type: 'event',
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
internalType: 'address',
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
internalType: 'address',
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
internalType: 'address',
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: 'uint256[]',
|
|
name: 'ids',
|
|
type: 'uint256[]',
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: 'uint256[]',
|
|
name: 'values',
|
|
type: 'uint256[]',
|
|
},
|
|
],
|
|
name: 'TransferBatch',
|
|
type: 'event',
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
internalType: 'address',
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
internalType: 'address',
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
internalType: 'address',
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: 'uint256',
|
|
name: 'id',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
indexed: false,
|
|
internalType: 'uint256',
|
|
name: 'value',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'TransferSingle',
|
|
type: 'event',
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: false,
|
|
internalType: 'string',
|
|
name: 'value',
|
|
type: 'string',
|
|
},
|
|
{
|
|
indexed: true,
|
|
internalType: 'uint256',
|
|
name: 'id',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'URI',
|
|
type: 'event',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'account',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'id',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'balanceOf',
|
|
outputs: [
|
|
{
|
|
internalType: 'uint256',
|
|
name: '',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address[]',
|
|
name: 'accounts',
|
|
type: 'address[]',
|
|
},
|
|
{
|
|
internalType: 'uint256[]',
|
|
name: 'ids',
|
|
type: 'uint256[]',
|
|
},
|
|
],
|
|
name: 'balanceOfBatch',
|
|
outputs: [
|
|
{
|
|
internalType: 'uint256[]',
|
|
name: '',
|
|
type: 'uint256[]',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'account',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'address',
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'isApprovedForAll',
|
|
outputs: [
|
|
{
|
|
internalType: 'bool',
|
|
name: '',
|
|
type: 'bool',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'address',
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'uint256[]',
|
|
name: 'ids',
|
|
type: 'uint256[]',
|
|
},
|
|
{
|
|
internalType: 'uint256[]',
|
|
name: 'values',
|
|
type: 'uint256[]',
|
|
},
|
|
{
|
|
internalType: 'bytes',
|
|
name: 'data',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
name: 'safeBatchTransferFrom',
|
|
outputs: [],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'address',
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'id',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
internalType: 'uint256',
|
|
name: 'value',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
internalType: 'bytes',
|
|
name: 'data',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
name: 'safeTransferFrom',
|
|
outputs: [],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'address',
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
{
|
|
internalType: 'bool',
|
|
name: 'approved',
|
|
type: 'bool',
|
|
},
|
|
],
|
|
name: 'setApprovalForAll',
|
|
outputs: [],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'bytes4',
|
|
name: 'interfaceId',
|
|
type: 'bytes4',
|
|
},
|
|
],
|
|
name: 'supportsInterface',
|
|
outputs: [
|
|
{
|
|
internalType: 'bool',
|
|
name: '',
|
|
type: 'bool',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
internalType: 'uint256',
|
|
name: '',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'uri',
|
|
outputs: [
|
|
{
|
|
internalType: 'string',
|
|
name: '',
|
|
type: 'string',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
] as const
|
|
|
|
/** [ERC-721 Non-Fungible Token Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-721) */
|
|
export const erc721Abi = [
|
|
{
|
|
type: 'event',
|
|
name: 'Approval',
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'event',
|
|
name: 'ApprovalForAll',
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'approved',
|
|
type: 'bool',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'event',
|
|
name: 'Transfer',
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'approve',
|
|
stateMutability: 'payable',
|
|
inputs: [
|
|
{
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'balanceOf',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'account',
|
|
type: 'address',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'getApproved',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'address',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'isApprovedForAll',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'name',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'string',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'ownerOf',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'safeTransferFrom',
|
|
stateMutability: 'payable',
|
|
inputs: [
|
|
{
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'safeTransferFrom',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'id',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
name: 'data',
|
|
type: 'bytes',
|
|
},
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'setApprovalForAll',
|
|
stateMutability: 'nonpayable',
|
|
inputs: [
|
|
{
|
|
name: 'operator',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'approved',
|
|
type: 'bool',
|
|
},
|
|
],
|
|
outputs: [],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'symbol',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'string',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'tokenByIndex',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'index',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'tokenByIndex',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'index',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'tokenURI',
|
|
stateMutability: 'view',
|
|
inputs: [
|
|
{
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [
|
|
{
|
|
type: 'string',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'totalSupply',
|
|
stateMutability: 'view',
|
|
inputs: [],
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
type: 'function',
|
|
name: 'transferFrom',
|
|
stateMutability: 'payable',
|
|
inputs: [
|
|
{
|
|
name: 'sender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'recipient',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'tokenId',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
outputs: [],
|
|
},
|
|
] as const
|
|
|
|
/** [ERC-4626 Tokenized Vaults Standard](https://ethereum.org/en/developers/docs/standards/tokens/erc-4626) */
|
|
export const erc4626Abi = [
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'value',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'Approval',
|
|
type: 'event',
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'sender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'receiver',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'Deposit',
|
|
type: 'event',
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'value',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'Transfer',
|
|
type: 'event',
|
|
},
|
|
{
|
|
anonymous: false,
|
|
inputs: [
|
|
{
|
|
indexed: true,
|
|
name: 'sender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'receiver',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: true,
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
indexed: false,
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'Withdraw',
|
|
type: 'event',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'allowance',
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'spender',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'approve',
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: 'asset',
|
|
outputs: [
|
|
{
|
|
name: 'assetTokenAddress',
|
|
type: 'address',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'account',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'balanceOf',
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'convertToAssets',
|
|
outputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'convertToShares',
|
|
outputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
name: 'receiver',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'deposit',
|
|
outputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'caller',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'maxDeposit',
|
|
outputs: [
|
|
{
|
|
name: 'maxAssets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'caller',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'maxMint',
|
|
outputs: [
|
|
{
|
|
name: 'maxShares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'maxRedeem',
|
|
outputs: [
|
|
{
|
|
name: 'maxShares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'maxWithdraw',
|
|
outputs: [
|
|
{
|
|
name: 'maxAssets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
name: 'receiver',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'mint',
|
|
outputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'previewDeposit',
|
|
outputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'previewMint',
|
|
outputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'previewRedeem',
|
|
outputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'previewWithdraw',
|
|
outputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
name: 'receiver',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'redeem',
|
|
outputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: 'totalAssets',
|
|
outputs: [
|
|
{
|
|
name: 'totalManagedAssets',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [],
|
|
name: 'totalSupply',
|
|
outputs: [
|
|
{
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'view',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'transfer',
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'from',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'to',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'amount',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
name: 'transferFrom',
|
|
outputs: [
|
|
{
|
|
type: 'bool',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
{
|
|
inputs: [
|
|
{
|
|
name: 'assets',
|
|
type: 'uint256',
|
|
},
|
|
{
|
|
name: 'receiver',
|
|
type: 'address',
|
|
},
|
|
{
|
|
name: 'owner',
|
|
type: 'address',
|
|
},
|
|
],
|
|
name: 'withdraw',
|
|
outputs: [
|
|
{
|
|
name: 'shares',
|
|
type: 'uint256',
|
|
},
|
|
],
|
|
stateMutability: 'nonpayable',
|
|
type: 'function',
|
|
},
|
|
] as const
|