interchain-token-sdk
Version:
SDK for deploying and managing interchain tokens across multiple chains using Axelar network
922 lines (921 loc) • 22.2 kB
JavaScript
export const INTERCHAIN_PROXY_CONTRACT_ADDRESS = '0x83a93500d23Fbc3e82B410aD07A6a9F7A0670D66';
export const INTERCHAIN_PROXY_CONTRACT_ABI = [
{
inputs: [
{
internalType: 'address',
name: 'interchainTokenService_',
type: 'address',
},
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{
inputs: [],
name: 'InvalidChainName',
type: 'error',
},
{
inputs: [],
name: 'InvalidCodeHash',
type: 'error',
},
{
inputs: [],
name: 'InvalidImplementation',
type: 'error',
},
{
inputs: [
{
internalType: 'address',
name: 'minter',
type: 'address',
},
],
name: 'InvalidMinter',
type: 'error',
},
{
inputs: [],
name: 'InvalidOwner',
type: 'error',
},
{
inputs: [],
name: 'InvalidOwnerAddress',
type: 'error',
},
{
inputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
{
internalType: 'bytes32',
name: 'expectedTokenId',
type: 'bytes32',
},
],
name: 'InvalidTokenId',
type: 'error',
},
{
inputs: [],
name: 'MulticallFailed',
type: 'error',
},
{
inputs: [
{
internalType: 'address',
name: 'minter',
type: 'address',
},
],
name: 'NotMinter',
type: 'error',
},
{
inputs: [],
name: 'NotOwner',
type: 'error',
},
{
inputs: [],
name: 'NotProxy',
type: 'error',
},
{
inputs: [],
name: 'NotSupported',
type: 'error',
},
{
inputs: [
{
internalType: 'address',
name: 'tokenAddress',
type: 'address',
},
],
name: 'NotToken',
type: 'error',
},
{
inputs: [],
name: 'RemoteDeploymentNotApproved',
type: 'error',
},
{
inputs: [],
name: 'SetupFailed',
type: 'error',
},
{
inputs: [],
name: 'ZeroAddress',
type: 'error',
},
{
inputs: [],
name: 'ZeroSupplyToken',
type: 'error',
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
{
indexed: false,
internalType: 'address',
name: 'tokenAddress',
type: 'address',
},
{
indexed: true,
internalType: 'address',
name: 'minter',
type: 'address',
},
{
indexed: false,
internalType: 'string',
name: 'name',
type: 'string',
},
{
indexed: false,
internalType: 'string',
name: 'symbol',
type: 'string',
},
{
indexed: false,
internalType: 'uint8',
name: 'decimals',
type: 'uint8',
},
],
name: 'InterchainTokenDeployed',
type: 'event',
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'address',
name: 'newOwner',
type: 'address',
},
],
name: 'OwnershipTransferStarted',
type: 'event',
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'address',
name: 'newOwner',
type: 'address',
},
],
name: 'OwnershipTransferred',
type: 'event',
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'address',
name: 'minter',
type: 'address',
},
{
indexed: true,
internalType: 'address',
name: 'deployer',
type: 'address',
},
{
indexed: true,
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
{
indexed: false,
internalType: 'string',
name: 'destinationChain',
type: 'string',
},
],
name: 'RevokedDeployRemoteInterchainTokenApproval',
type: 'event',
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'address',
name: 'newImplementation',
type: 'address',
},
],
name: 'Upgraded',
type: 'event',
},
{
inputs: [],
name: 'acceptOwnership',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'deployer',
type: 'address',
},
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
{
internalType: 'string',
name: 'destinationChain',
type: 'string',
},
{
internalType: 'bytes',
name: 'destinationMinter',
type: 'bytes',
},
],
name: 'approveDeployRemoteInterchainToken',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'tokenAddress',
type: 'address',
},
],
name: 'canonicalInterchainTokenDeploySalt',
outputs: [
{
internalType: 'bytes32',
name: 'deploySalt',
type: 'bytes32',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'tokenAddress',
type: 'address',
},
],
name: 'canonicalInterchainTokenId',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'chainNameHash',
outputs: [
{
internalType: 'bytes32',
name: '',
type: 'bytes32',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'contractId',
outputs: [
{
internalType: 'bytes32',
name: '',
type: 'bytes32',
},
],
stateMutability: 'pure',
type: 'function',
},
{
inputs: [
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
{
internalType: 'string',
name: 'name',
type: 'string',
},
{
internalType: 'string',
name: 'symbol',
type: 'string',
},
{
internalType: 'uint8',
name: 'decimals',
type: 'uint8',
},
{
internalType: 'uint256',
name: 'initialSupply',
type: 'uint256',
},
{
internalType: 'address',
name: 'minter',
type: 'address',
},
],
name: 'deployInterchainToken',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'string',
name: 'originalChain',
type: 'string',
},
{
internalType: 'address',
name: 'originalTokenAddress',
type: 'address',
},
{
internalType: 'string',
name: 'destinationChain',
type: 'string',
},
{
internalType: 'uint256',
name: 'gasValue',
type: 'uint256',
},
],
name: 'deployRemoteCanonicalInterchainToken',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'originalTokenAddress',
type: 'address',
},
{
internalType: 'string',
name: 'destinationChain',
type: 'string',
},
{
internalType: 'uint256',
name: 'gasValue',
type: 'uint256',
},
],
name: 'deployRemoteCanonicalInterchainToken',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
{
internalType: 'string',
name: 'destinationChain',
type: 'string',
},
{
internalType: 'uint256',
name: 'gasValue',
type: 'uint256',
},
],
name: 'deployRemoteInterchainToken',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'string',
name: 'originalChainName',
type: 'string',
},
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
{
internalType: 'address',
name: 'minter',
type: 'address',
},
{
internalType: 'string',
name: 'destinationChain',
type: 'string',
},
{
internalType: 'uint256',
name: 'gasValue',
type: 'uint256',
},
],
name: 'deployRemoteInterchainToken',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
{
internalType: 'address',
name: 'minter',
type: 'address',
},
{
internalType: 'string',
name: 'destinationChain',
type: 'string',
},
{
internalType: 'bytes',
name: 'destinationMinter',
type: 'bytes',
},
{
internalType: 'uint256',
name: 'gasValue',
type: 'uint256',
},
],
name: 'deployRemoteInterchainTokenWithMinter',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [],
name: 'implementation',
outputs: [
{
internalType: 'address',
name: 'implementation_',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'deployer',
type: 'address',
},
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
],
name: 'interchainTokenDeploySalt',
outputs: [
{
internalType: 'bytes32',
name: 'deploySalt',
type: 'bytes32',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'deployer',
type: 'address',
},
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
],
name: 'interchainTokenId',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'interchainTokenService',
outputs: [
{
internalType: 'contract IInterchainTokenService',
name: '',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
{
internalType: 'string',
name: 'destinationChain',
type: 'string',
},
{
internalType: 'bytes',
name: 'destinationTokenAddress',
type: 'bytes',
},
{
internalType: 'enum ITokenManagerType.TokenManagerType',
name: 'tokenManagerType',
type: 'uint8',
},
{
internalType: 'bytes',
name: 'linkParams',
type: 'bytes',
},
{
internalType: 'uint256',
name: 'gasValue',
type: 'uint256',
},
],
name: 'linkToken',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'deployer',
type: 'address',
},
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
],
name: 'linkedTokenDeploySalt',
outputs: [
{
internalType: 'bytes32',
name: 'deploySalt',
type: 'bytes32',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'deployer',
type: 'address',
},
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
],
name: 'linkedTokenId',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'bytes[]',
name: 'data',
type: 'bytes[]',
},
],
name: 'multicall',
outputs: [
{
internalType: 'bytes[]',
name: 'results',
type: 'bytes[]',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [],
name: 'owner',
outputs: [
{
internalType: 'address',
name: 'owner_',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [],
name: 'pendingOwner',
outputs: [
{
internalType: 'address',
name: 'owner_',
type: 'address',
},
],
stateMutability: 'view',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'newOwner',
type: 'address',
},
],
name: 'proposeOwnership',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'tokenAddress',
type: 'address',
},
],
name: 'registerCanonicalInterchainToken',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
{
internalType: 'address',
name: 'tokenAddress',
type: 'address',
},
{
internalType: 'enum ITokenManagerType.TokenManagerType',
name: 'tokenManagerType',
type: 'uint8',
},
{
internalType: 'address',
name: 'operator',
type: 'address',
},
],
name: 'registerCustomToken',
outputs: [
{
internalType: 'bytes32',
name: 'tokenId',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'deployer',
type: 'address',
},
{
internalType: 'bytes32',
name: 'salt',
type: 'bytes32',
},
],
name: 'revokeDeployRemoteInterchainToken',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'bytes',
name: 'data',
type: 'bytes',
},
],
name: 'setup',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'newOwner',
type: 'address',
},
],
name: 'transferOwnership',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'newImplementation',
type: 'address',
},
{
internalType: 'bytes32',
name: 'newImplementationCodeHash',
type: 'bytes32',
},
{
internalType: 'bytes',
name: 'params',
type: 'bytes',
},
],
name: 'upgrade',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
];
export const ERC20_ABI = [
{
constant: true,
inputs: [],
name: 'name',
outputs: [{ name: '', type: 'string' }],
type: 'function',
},
{
constant: true,
inputs: [],
name: 'symbol',
outputs: [{ name: '', type: 'string' }],
type: 'function',
},
{
constant: true,
inputs: [],
name: 'decimals',
outputs: [{ name: '', type: 'uint8' }],
type: 'function',
},
];