diff --git a/ccip/offchain/README.md b/ccip/offchain/README.md index 699d023a..0aa556ed 100644 --- a/ccip/offchain/README.md +++ b/ccip/offchain/README.md @@ -1,2 +1 @@ -This repository is dedicated to providing examples on how to interact with the CCIP Router contract in an offchain context. -You can use your Externally Owned Account (EOA) to directly initiate transactions and invoke the router's functions. +For CCIP offchain tools and usage, see: https://docs.chain.link/ccip/tools/ diff --git a/ccip/offchain/abi/IERC20Metadata.json b/ccip/offchain/abi/IERC20Metadata.json deleted file mode 100644 index 177ac839..00000000 --- a/ccip/offchain/abi/IERC20Metadata.json +++ /dev/null @@ -1,224 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/ccip/offchain/abi/OffRamp.json b/ccip/offchain/abi/OffRamp.json deleted file mode 100644 index cd0096b5..00000000 --- a/ccip/offchain/abi/OffRamp.json +++ /dev/null @@ -1,1641 +0,0 @@ -[ - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "commitStore", - "type": "address" - }, - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "onRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "prevOffRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "rmnProxy", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenAdminRegistry", - "type": "address" - } - ], - "internalType": "struct EVM2EVMOffRamp.StaticConfig", - "name": "staticConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "rateLimiterConfig", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "capacity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requested", - "type": "uint256" - } - ], - "name": "AggregateValueMaxCapacityExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minWaitInSeconds", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - } - ], - "name": "AggregateValueRateLimitReached", - "type": "error" - }, - { - "inputs": [], - "name": "BucketOverfilled", - "type": "error" - }, - { - "inputs": [], - "name": "CanOnlySelfCall", - "type": "error" - }, - { - "inputs": [], - "name": "CommitStoreAlreadyInUse", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "expected", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "actual", - "type": "bytes32" - } - ], - "name": "ConfigDigestMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "CursedByRMN", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "DestinationGasAmountCountMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReport", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "err", - "type": "bytes" - } - ], - "name": "ExecutionError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "ForkedChain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum OCR2BaseNoChecks.InvalidConfigErrorType", - "name": "errorType", - "type": "uint8" - } - ], - "name": "InvalidConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "got", - "type": "uint256" - } - ], - "name": "InvalidDataLength", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "encodedAddress", - "type": "bytes" - } - ], - "name": "InvalidEVMAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "oldLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "newLimit", - "type": "uint256" - } - ], - "name": "InvalidManualExecutionGasLimit", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidMessageId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - }, - { - "internalType": "enum Internal.MessageExecutionState", - "name": "newState", - "type": "uint8" - } - ], - "name": "InvalidNewState", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - } - ], - "name": "InvalidSourceChain", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "tokenIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "oldLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokenGasOverride", - "type": "uint256" - } - ], - "name": "InvalidTokenGasOverride", - "type": "error" - }, - { - "inputs": [], - "name": "ManualExecutionGasLimitMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "ManualExecutionNotYetEnabled", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actualSize", - "type": "uint256" - } - ], - "name": "MessageTooLarge", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "notPool", - "type": "address" - } - ], - "name": "NotACompatiblePool", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyCallableByAdminOrOwner", - "type": "error" - }, - { - "inputs": [], - "name": "OracleCannotBeZeroAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "PriceNotFoundForToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "err", - "type": "bytes" - } - ], - "name": "ReceiverError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amountReleased", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balancePre", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balancePost", - "type": "uint256" - } - ], - "name": "ReleaseOrMintBalanceMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "RootNotCommitted", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "TokenDataMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "err", - "type": "bytes" - } - ], - "name": "TokenHandlingError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "capacity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requested", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } - ], - "name": "TokenMaxCapacityExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minWaitInSeconds", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } - ], - "name": "TokenRateLimitReached", - "type": "error" - }, - { - "inputs": [], - "name": "UnauthorizedTransmitter", - "type": "error" - }, - { - "inputs": [], - "name": "UnexpectedTokenData", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "UnsupportedNumberOfTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expected", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actual", - "type": "uint256" - } - ], - "name": "WrongMessageLength", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddressNotAllowed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "AlreadyAttempted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct RateLimiter.Config", - "name": "config", - "type": "tuple" - } - ], - "name": "ConfigChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "previousConfigBlockNumber", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "configDigest", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "configCount", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "signers", - "type": "address[]" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "transmitters", - "type": "address[]" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "f", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "onchainConfig", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "offchainConfigVersion", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "offchainConfig", - "type": "bytes" - } - ], - "name": "ConfigSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "commitStore", - "type": "address" - }, - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "onRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "prevOffRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "rmnProxy", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenAdminRegistry", - "type": "address" - } - ], - "indexed": false, - "internalType": "struct EVM2EVMOffRamp.StaticConfig", - "name": "staticConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint32", - "name": "permissionLessExecutionThresholdSeconds", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxDataBytes", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "maxNumberOfTokensPerMsg", - "type": "uint16" - }, - { - "internalType": "address", - "name": "router", - "type": "address" - }, - { - "internalType": "address", - "name": "priceRegistry", - "type": "address" - } - ], - "indexed": false, - "internalType": "struct EVM2EVMOffRamp.DynamicConfig", - "name": "dynamicConfig", - "type": "tuple" - } - ], - "name": "ConfigSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "enum Internal.MessageExecutionState", - "name": "state", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "name": "ExecutionStateChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "SkippedAlreadyExecutedMessage", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SkippedIncorrectNonce", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SkippedSenderWithPreviousRampMessageInflight", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "destToken", - "type": "address" - } - ], - "name": "TokenAggregateRateLimitAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "destToken", - "type": "address" - } - ], - "name": "TokenAggregateRateLimitRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "TokensConsumed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "configDigest", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "epoch", - "type": "uint32" - } - ], - "name": "Transmitted", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "sender", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "destTokenAmounts", - "type": "tuple[]" - } - ], - "internalType": "struct Client.Any2EVMMessage", - "name": "", - "type": "tuple" - } - ], - "name": "ccipReceive", - "outputs": [], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "currentRateLimiterState", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "tokens", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "lastUpdated", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.TokenBucket", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "gasLimit", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "strict", - "type": "bool" - }, - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeTokenAmount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "tokenAmounts", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "sourceTokenData", - "type": "bytes[]" - }, - { - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - } - ], - "internalType": "struct Internal.EVM2EVMMessage", - "name": "message", - "type": "tuple" - }, - { - "internalType": "bytes[]", - "name": "offchainTokenData", - "type": "bytes[]" - }, - { - "internalType": "uint32[]", - "name": "tokenGasOverrides", - "type": "uint32[]" - } - ], - "name": "executeSingleMessage", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAllRateLimitTokens", - "outputs": [ - { - "internalType": "address[]", - "name": "sourceTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "destTokens", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDynamicConfig", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "permissionLessExecutionThresholdSeconds", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxDataBytes", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "maxNumberOfTokensPerMsg", - "type": "uint16" - }, - { - "internalType": "address", - "name": "router", - "type": "address" - }, - { - "internalType": "address", - "name": "priceRegistry", - "type": "address" - } - ], - "internalType": "struct EVM2EVMOffRamp.DynamicConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - } - ], - "name": "getExecutionState", - "outputs": [ - { - "internalType": "enum Internal.MessageExecutionState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "getSenderNonce", - "outputs": [ - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getStaticConfig", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "commitStore", - "type": "address" - }, - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "onRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "prevOffRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "rmnProxy", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenAdminRegistry", - "type": "address" - } - ], - "internalType": "struct EVM2EVMOffRamp.StaticConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getTokenLimitAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getTransmitters", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestConfigDetails", - "outputs": [ - { - "internalType": "uint32", - "name": "configCount", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "blockNumber", - "type": "uint32" - }, - { - "internalType": "bytes32", - "name": "configDigest", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "latestConfigDigestAndEpoch", - "outputs": [ - { - "internalType": "bool", - "name": "scanLogs", - "type": "bool" - }, - { - "internalType": "bytes32", - "name": "configDigest", - "type": "bytes32" - }, - { - "internalType": "uint32", - "name": "epoch", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "gasLimit", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "strict", - "type": "bool" - }, - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeTokenAmount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "tokenAmounts", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "sourceTokenData", - "type": "bytes[]" - }, - { - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - } - ], - "internalType": "struct Internal.EVM2EVMMessage[]", - "name": "messages", - "type": "tuple[]" - }, - { - "internalType": "bytes[][]", - "name": "offchainTokenData", - "type": "bytes[][]" - }, - { - "internalType": "bytes32[]", - "name": "proofs", - "type": "bytes32[]" - }, - { - "internalType": "uint256", - "name": "proofFlagBits", - "type": "uint256" - } - ], - "internalType": "struct Internal.ExecutionReport", - "name": "report", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "receiverExecutionGasLimit", - "type": "uint256" - }, - { - "internalType": "uint32[]", - "name": "tokenGasOverrides", - "type": "uint32[]" - } - ], - "internalType": "struct EVM2EVMOffRamp.GasLimitOverride[]", - "name": "gasLimitOverrides", - "type": "tuple[]" - } - ], - "name": "manuallyExecute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "setAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "signers", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "transmitters", - "type": "address[]" - }, - { - "internalType": "uint8", - "name": "f", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "onchainConfig", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "offchainConfigVersion", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "offchainConfig", - "type": "bytes" - } - ], - "name": "setOCR2Config", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "config", - "type": "tuple" - } - ], - "name": "setRateLimiterConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32[3]", - "name": "reportContext", - "type": "bytes32[3]" - }, - { - "internalType": "bytes", - "name": "report", - "type": "bytes" - }, - { - "internalType": "bytes32[]", - "name": "rs", - "type": "bytes32[]" - }, - { - "internalType": "bytes32[]", - "name": "ss", - "type": "bytes32[]" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "transmit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "typeAndVersion", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - } - ], - "internalType": "struct EVM2EVMOffRamp.RateLimitToken[]", - "name": "removes", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "sourceToken", - "type": "address" - }, - { - "internalType": "address", - "name": "destToken", - "type": "address" - } - ], - "internalType": "struct EVM2EVMOffRamp.RateLimitToken[]", - "name": "adds", - "type": "tuple[]" - } - ], - "name": "updateRateLimitTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/ccip/offchain/abi/OnRamp.json b/ccip/offchain/abi/OnRamp.json deleted file mode 100644 index 4e0e510c..00000000 --- a/ccip/offchain/abi/OnRamp.json +++ /dev/null @@ -1,1861 +0,0 @@ -[ - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "linkToken", - "type": "address" - }, - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "defaultTxGasLimit", - "type": "uint64" - }, - { - "internalType": "uint96", - "name": "maxNopFeesJuels", - "type": "uint96" - }, - { - "internalType": "address", - "name": "prevOnRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "rmnProxy", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenAdminRegistry", - "type": "address" - } - ], - "internalType": "struct EVM2EVMOnRamp.StaticConfig", - "name": "staticConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "router", - "type": "address" - }, - { - "internalType": "uint16", - "name": "maxNumberOfTokensPerMsg", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destGasOverhead", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "destGasPerPayloadByte", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destDataAvailabilityOverheadGas", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "destGasPerDataAvailabilityByte", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "destDataAvailabilityMultiplierBps", - "type": "uint16" - }, - { - "internalType": "address", - "name": "priceRegistry", - "type": "address" - }, - { - "internalType": "uint32", - "name": "maxDataBytes", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxPerMsgGasLimit", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "defaultTokenFeeUSDCents", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "defaultTokenDestGasOverhead", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "enforceOutOfOrder", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.DynamicConfig", - "name": "dynamicConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "rateLimiterConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint32", - "name": "networkFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "gasMultiplierWeiPerEth", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "premiumMultiplierWeiPerEth", - "type": "uint64" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.FeeTokenConfigArgs[]", - "name": "feeTokenConfigs", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint32", - "name": "minFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "deciBps", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destGasOverhead", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "destBytesOverhead", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "aggregateRateLimitEnabled", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.TokenTransferFeeConfigArgs[]", - "name": "tokenTransferFeeConfigArgs", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "address", - "name": "nop", - "type": "address" - }, - { - "internalType": "uint16", - "name": "weight", - "type": "uint16" - } - ], - "internalType": "struct EVM2EVMOnRamp.NopAndWeight[]", - "name": "nopsAndWeights", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "capacity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requested", - "type": "uint256" - } - ], - "name": "AggregateValueMaxCapacityExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minWaitInSeconds", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - } - ], - "name": "AggregateValueRateLimitReached", - "type": "error" - }, - { - "inputs": [], - "name": "BucketOverfilled", - "type": "error" - }, - { - "inputs": [], - "name": "CannotSendZeroTokens", - "type": "error" - }, - { - "inputs": [], - "name": "CursedByRMN", - "type": "error" - }, - { - "inputs": [], - "name": "ExtraArgOutOfOrderExecutionMustBeTrue", - "type": "error" - }, - { - "inputs": [], - "name": "GetSupportedTokensFunctionalityRemovedCheckAdminRegistry", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientBalance", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - } - ], - "name": "InvalidChainSelector", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidConfig", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint32", - "name": "destBytesOverhead", - "type": "uint32" - } - ], - "name": "InvalidDestBytesOverhead", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "encodedAddress", - "type": "bytes" - } - ], - "name": "InvalidEVMAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidExtraArgsTag", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "nop", - "type": "address" - } - ], - "name": "InvalidNopAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidWithdrawParams", - "type": "error" - }, - { - "inputs": [], - "name": "LinkBalanceNotSettled", - "type": "error" - }, - { - "inputs": [], - "name": "MaxFeeBalanceReached", - "type": "error" - }, - { - "inputs": [], - "name": "MessageGasLimitTooHigh", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxSize", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "actualSize", - "type": "uint256" - } - ], - "name": "MessageTooLarge", - "type": "error" - }, - { - "inputs": [], - "name": "MustBeCalledByRouter", - "type": "error" - }, - { - "inputs": [], - "name": "NoFeesToPay", - "type": "error" - }, - { - "inputs": [], - "name": "NoNopsToPay", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "NotAFeeToken", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyCallableByAdminOrOwner", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyCallableByOwnerOrAdmin", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyCallableByOwnerOrAdminOrNop", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "PriceNotFoundForToken", - "type": "error" - }, - { - "inputs": [], - "name": "RouterMustSetOriginalSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "SourceTokenDataTooLarge", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "capacity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "requested", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } - ], - "name": "TokenMaxCapacityExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minWaitInSeconds", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "available", - "type": "uint256" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } - ], - "name": "TokenRateLimitReached", - "type": "error" - }, - { - "inputs": [], - "name": "TooManyNops", - "type": "error" - }, - { - "inputs": [], - "name": "UnsupportedNumberOfTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "UnsupportedToken", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint64", - "name": "sequenceNumber", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "gasLimit", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "strict", - "type": "bool" - }, - { - "internalType": "uint64", - "name": "nonce", - "type": "uint64" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "feeTokenAmount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "tokenAmounts", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "sourceTokenData", - "type": "bytes[]" - }, - { - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - } - ], - "indexed": false, - "internalType": "struct Internal.EVM2EVMMessage", - "name": "message", - "type": "tuple" - } - ], - "name": "CCIPSendRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct RateLimiter.Config", - "name": "config", - "type": "tuple" - } - ], - "name": "ConfigChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "linkToken", - "type": "address" - }, - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "defaultTxGasLimit", - "type": "uint64" - }, - { - "internalType": "uint96", - "name": "maxNopFeesJuels", - "type": "uint96" - }, - { - "internalType": "address", - "name": "prevOnRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "rmnProxy", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenAdminRegistry", - "type": "address" - } - ], - "indexed": false, - "internalType": "struct EVM2EVMOnRamp.StaticConfig", - "name": "staticConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "address", - "name": "router", - "type": "address" - }, - { - "internalType": "uint16", - "name": "maxNumberOfTokensPerMsg", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destGasOverhead", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "destGasPerPayloadByte", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destDataAvailabilityOverheadGas", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "destGasPerDataAvailabilityByte", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "destDataAvailabilityMultiplierBps", - "type": "uint16" - }, - { - "internalType": "address", - "name": "priceRegistry", - "type": "address" - }, - { - "internalType": "uint32", - "name": "maxDataBytes", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxPerMsgGasLimit", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "defaultTokenFeeUSDCents", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "defaultTokenDestGasOverhead", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "enforceOutOfOrder", - "type": "bool" - } - ], - "indexed": false, - "internalType": "struct EVM2EVMOnRamp.DynamicConfig", - "name": "dynamicConfig", - "type": "tuple" - } - ], - "name": "ConfigSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint32", - "name": "networkFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "gasMultiplierWeiPerEth", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "premiumMultiplierWeiPerEth", - "type": "uint64" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "indexed": false, - "internalType": "struct EVM2EVMOnRamp.FeeTokenConfigArgs[]", - "name": "feeConfig", - "type": "tuple[]" - } - ], - "name": "FeeConfigSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "nop", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "NopPaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "nopWeightsTotal", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "address", - "name": "nop", - "type": "address" - }, - { - "internalType": "uint16", - "name": "weight", - "type": "uint16" - } - ], - "indexed": false, - "internalType": "struct EVM2EVMOnRamp.NopAndWeight[]", - "name": "nopsAndWeights", - "type": "tuple[]" - } - ], - "name": "NopsSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - } - ], - "name": "TokenTransferFeeConfigDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint32", - "name": "minFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "deciBps", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destGasOverhead", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "destBytesOverhead", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "aggregateRateLimitEnabled", - "type": "bool" - } - ], - "indexed": false, - "internalType": "struct EVM2EVMOnRamp.TokenTransferFeeConfigArgs[]", - "name": "transferFeeConfig", - "type": "tuple[]" - } - ], - "name": "TokenTransferFeeConfigSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "TokensConsumed", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "currentRateLimiterState", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "tokens", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "lastUpdated", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.TokenBucket", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "receiver", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "tokenAmounts", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "bytes", - "name": "extraArgs", - "type": "bytes" - } - ], - "internalType": "struct Client.EVM2AnyMessage", - "name": "message", - "type": "tuple" - }, - { - "internalType": "uint256", - "name": "feeTokenAmount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "originalSender", - "type": "address" - } - ], - "name": "forwardFromRouter", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getDynamicConfig", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "router", - "type": "address" - }, - { - "internalType": "uint16", - "name": "maxNumberOfTokensPerMsg", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destGasOverhead", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "destGasPerPayloadByte", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destDataAvailabilityOverheadGas", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "destGasPerDataAvailabilityByte", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "destDataAvailabilityMultiplierBps", - "type": "uint16" - }, - { - "internalType": "address", - "name": "priceRegistry", - "type": "address" - }, - { - "internalType": "uint32", - "name": "maxDataBytes", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxPerMsgGasLimit", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "defaultTokenFeeUSDCents", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "defaultTokenDestGasOverhead", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "enforceOutOfOrder", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.DynamicConfig", - "name": "dynamicConfig", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getExpectedNextSequenceNumber", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "receiver", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "tokenAmounts", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "bytes", - "name": "extraArgs", - "type": "bytes" - } - ], - "internalType": "struct Client.EVM2AnyMessage", - "name": "message", - "type": "tuple" - } - ], - "name": "getFee", - "outputs": [ - { - "internalType": "uint256", - "name": "feeTokenAmount", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getFeeTokenConfig", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "networkFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "gasMultiplierWeiPerEth", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "premiumMultiplierWeiPerEth", - "type": "uint64" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.FeeTokenConfig", - "name": "feeTokenConfig", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getNopFeesJuels", - "outputs": [ - { - "internalType": "uint96", - "name": "", - "type": "uint96" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getNops", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "nop", - "type": "address" - }, - { - "internalType": "uint16", - "name": "weight", - "type": "uint16" - } - ], - "internalType": "struct EVM2EVMOnRamp.NopAndWeight[]", - "name": "nopsAndWeights", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "weightsTotal", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "contract IERC20", - "name": "sourceToken", - "type": "address" - } - ], - "name": "getPoolBySourceToken", - "outputs": [ - { - "internalType": "contract IPoolV1", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "getSenderNonce", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getStaticConfig", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "linkToken", - "type": "address" - }, - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "defaultTxGasLimit", - "type": "uint64" - }, - { - "internalType": "uint96", - "name": "maxNopFeesJuels", - "type": "uint96" - }, - { - "internalType": "address", - "name": "prevOnRamp", - "type": "address" - }, - { - "internalType": "address", - "name": "rmnProxy", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenAdminRegistry", - "type": "address" - } - ], - "internalType": "struct EVM2EVMOnRamp.StaticConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "name": "getSupportedTokens", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getTokenLimitAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getTokenTransferFeeConfig", - "outputs": [ - { - "components": [ - { - "internalType": "uint32", - "name": "minFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "deciBps", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destGasOverhead", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "destBytesOverhead", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "aggregateRateLimitEnabled", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.TokenTransferFeeConfig", - "name": "tokenTransferFeeConfig", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "linkAvailableForPayment", - "outputs": [ - { - "internalType": "int256", - "name": "", - "type": "int256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "payNops", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "setAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "router", - "type": "address" - }, - { - "internalType": "uint16", - "name": "maxNumberOfTokensPerMsg", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destGasOverhead", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "destGasPerPayloadByte", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destDataAvailabilityOverheadGas", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "destGasPerDataAvailabilityByte", - "type": "uint16" - }, - { - "internalType": "uint16", - "name": "destDataAvailabilityMultiplierBps", - "type": "uint16" - }, - { - "internalType": "address", - "name": "priceRegistry", - "type": "address" - }, - { - "internalType": "uint32", - "name": "maxDataBytes", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxPerMsgGasLimit", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "defaultTokenFeeUSDCents", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "defaultTokenDestGasOverhead", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "enforceOutOfOrder", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.DynamicConfig", - "name": "dynamicConfig", - "type": "tuple" - } - ], - "name": "setDynamicConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint32", - "name": "networkFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "gasMultiplierWeiPerEth", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "premiumMultiplierWeiPerEth", - "type": "uint64" - }, - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.FeeTokenConfigArgs[]", - "name": "feeTokenConfigArgs", - "type": "tuple[]" - } - ], - "name": "setFeeTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "nop", - "type": "address" - }, - { - "internalType": "uint16", - "name": "weight", - "type": "uint16" - } - ], - "internalType": "struct EVM2EVMOnRamp.NopAndWeight[]", - "name": "nopsAndWeights", - "type": "tuple[]" - } - ], - "name": "setNops", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "config", - "type": "tuple" - } - ], - "name": "setRateLimiterConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint32", - "name": "minFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "maxFeeUSDCents", - "type": "uint32" - }, - { - "internalType": "uint16", - "name": "deciBps", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "destGasOverhead", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "destBytesOverhead", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "aggregateRateLimitEnabled", - "type": "bool" - } - ], - "internalType": "struct EVM2EVMOnRamp.TokenTransferFeeConfigArgs[]", - "name": "tokenTransferFeeConfigArgs", - "type": "tuple[]" - }, - { - "internalType": "address[]", - "name": "tokensToUseDefaultFeeConfigs", - "type": "address[]" - } - ], - "name": "setTokenTransferFeeConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "typeAndVersion", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "withdrawNonLinkFees", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/ccip/offchain/abi/Router.json b/ccip/offchain/abi/Router.json deleted file mode 100644 index fc16bfe0..00000000 --- a/ccip/offchain/abi/Router.json +++ /dev/null @@ -1,702 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "wrappedNative", - "type": "address" - }, - { - "internalType": "address", - "name": "armProxy", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "BadARMSignal", - "type": "error" - }, - { - "inputs": [], - "name": "FailedToSendValue", - "type": "error" - }, - { - "inputs": [], - "name": "InsufficientFeeTokenAmount", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidMsgValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "InvalidRecipientAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "offRamp", - "type": "address" - } - ], - "name": "OffRampMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "OnlyOffRamp", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - } - ], - "name": "UnsupportedDestinationChain", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "offRamp", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "calldataHash", - "type": "bytes32" - } - ], - "name": "MessageExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "offRamp", - "type": "address" - } - ], - "name": "OffRampAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "offRamp", - "type": "address" - } - ], - "name": "OffRampRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "onRamp", - "type": "address" - } - ], - "name": "OnRampSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "MAX_RET_BYTES", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "onRamp", - "type": "address" - } - ], - "internalType": "struct Router.OnRamp[]", - "name": "onRampUpdates", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "offRamp", - "type": "address" - } - ], - "internalType": "struct Router.OffRamp[]", - "name": "offRampRemoves", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "offRamp", - "type": "address" - } - ], - "internalType": "struct Router.OffRamp[]", - "name": "offRampAdds", - "type": "tuple[]" - } - ], - "name": "applyRampUpdates", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "destinationChainSelector", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "receiver", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "tokenAmounts", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "bytes", - "name": "extraArgs", - "type": "bytes" - } - ], - "internalType": "struct Client.EVM2AnyMessage", - "name": "message", - "type": "tuple" - } - ], - "name": "ccipSend", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "getArmProxy", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "destinationChainSelector", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bytes", - "name": "receiver", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "tokenAmounts", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "feeToken", - "type": "address" - }, - { - "internalType": "bytes", - "name": "extraArgs", - "type": "bytes" - } - ], - "internalType": "struct Client.EVM2AnyMessage", - "name": "message", - "type": "tuple" - } - ], - "name": "getFee", - "outputs": [ - { - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOffRamps", - "outputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "offRamp", - "type": "address" - } - ], - "internalType": "struct Router.OffRamp[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "destChainSelector", - "type": "uint64" - } - ], - "name": "getOnRamp", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - } - ], - "name": "getSupportedTokens", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getWrappedNative", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - } - ], - "name": "isChainSupported", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "offRamp", - "type": "address" - } - ], - "name": "isOffRamp", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "recoverTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "messageId", - "type": "bytes32" - }, - { - "internalType": "uint64", - "name": "sourceChainSelector", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "sender", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "internalType": "struct Client.EVMTokenAmount[]", - "name": "destTokenAmounts", - "type": "tuple[]" - } - ], - "internalType": "struct Client.Any2EVMMessage", - "name": "message", - "type": "tuple" - }, - { - "internalType": "uint16", - "name": "gasForCallExactCheck", - "type": "uint16" - }, - { - "internalType": "uint256", - "name": "gasLimit", - "type": "uint256" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "routeMessage", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "retData", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "gasUsed", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "wrappedNative", - "type": "address" - } - ], - "name": "setWrappedNative", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "typeAndVersion", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/ccip/offchain/abi/TokenAdminRegistry.json b/ccip/offchain/abi/TokenAdminRegistry.json deleted file mode 100644 index 0c57c600..00000000 --- a/ccip/offchain/abi/TokenAdminRegistry.json +++ /dev/null @@ -1,485 +0,0 @@ -[ - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "AlreadyRegistered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InvalidTokenPoolToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "OnlyAdministrator", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "OnlyPendingAdministrator", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "OnlyRegistryModuleOrOwner", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "currentAdmin", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdministratorTransferRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdministratorTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "previousPool", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newPool", - "type": "address" - } - ], - "name": "PoolSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "RegistryModuleAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "RegistryModuleRemoved", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "localToken", - "type": "address" - } - ], - "name": "acceptAdminRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "addRegistryModule", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "startIndex", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxCount", - "type": "uint64" - } - ], - "name": "getAllConfiguredTokens", - "outputs": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getPool", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - } - ], - "name": "getPools", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getTokenConfig", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "administrator", - "type": "address" - }, - { - "internalType": "address", - "name": "pendingAdministrator", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenPool", - "type": "address" - } - ], - "internalType": "struct TokenAdminRegistry.TokenConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "localToken", - "type": "address" - }, - { - "internalType": "address", - "name": "administrator", - "type": "address" - } - ], - "name": "isAdministrator", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "isRegistryModule", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "localToken", - "type": "address" - }, - { - "internalType": "address", - "name": "administrator", - "type": "address" - } - ], - "name": "proposeAdministrator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "removeRegistryModule", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "localToken", - "type": "address" - }, - { - "internalType": "address", - "name": "pool", - "type": "address" - } - ], - "name": "setPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "localToken", - "type": "address" - }, - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "transferAdminRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "typeAndVersion", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } -] diff --git a/ccip/offchain/abi/TokenPool.json b/ccip/offchain/abi/TokenPool.json deleted file mode 100644 index bc848a5f..00000000 --- a/ccip/offchain/abi/TokenPool.json +++ /dev/null @@ -1,1164 +0,0 @@ -[ - { - "inputs": [], - "name": "AllowListNotEnabled", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "CallerIsNotARampOnRouter", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - } - ], - "name": "ChainAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - } - ], - "name": "ChainNotAllowed", - "type": "error" - }, - { - "inputs": [], - "name": "CursedByRMN", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "config", - "type": "tuple" - } - ], - "name": "DisabledNonZeroRateLimit", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "rateLimiterConfig", - "type": "tuple" - } - ], - "name": "InvalidRateLimitRate", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "sourcePoolAddress", - "type": "bytes" - } - ], - "name": "InvalidSourcePoolAddress", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "InvalidToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - } - ], - "name": "NonExistentChain", - "type": "error" - }, - { - "inputs": [], - "name": "RateLimitMustBeDisabled", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SenderNotAllowed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [], - "name": "ZeroAddressNotAllowed", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "AllowListAdd", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "AllowListRemove", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Burned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "remoteToken", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct RateLimiter.Config", - "name": "outboundRateLimiterConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct RateLimiter.Config", - "name": "inboundRateLimiterConfig", - "type": "tuple" - } - ], - "name": "ChainAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct RateLimiter.Config", - "name": "outboundRateLimiterConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct RateLimiter.Config", - "name": "inboundRateLimiterConfig", - "type": "tuple" - } - ], - "name": "ChainConfigured", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - } - ], - "name": "ChainRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "indexed": false, - "internalType": "struct RateLimiter.Config", - "name": "config", - "type": "tuple" - } - ], - "name": "ConfigChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Locked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Minted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferRequested", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "Released", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "previousPoolAddress", - "type": "bytes" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "remotePoolAddress", - "type": "bytes" - } - ], - "name": "RemotePoolSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldRouter", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newRouter", - "type": "address" - } - ], - "name": "RouterUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "removes", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "adds", - "type": "address[]" - } - ], - "name": "applyAllowListUpdates", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - }, - { - "internalType": "bool", - "name": "allowed", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "remotePoolAddress", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "remoteTokenAddress", - "type": "bytes" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "outboundRateLimiterConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "inboundRateLimiterConfig", - "type": "tuple" - } - ], - "internalType": "struct TokenPool.ChainUpdate[]", - "name": "chains", - "type": "tuple[]" - } - ], - "name": "applyChainUpdates", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAllowList", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAllowListEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - } - ], - "name": "getCurrentInboundRateLimiterState", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "tokens", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "lastUpdated", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.TokenBucket", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - } - ], - "name": "getCurrentOutboundRateLimiterState", - "outputs": [ - { - "components": [ - { - "internalType": "uint128", - "name": "tokens", - "type": "uint128" - }, - { - "internalType": "uint32", - "name": "lastUpdated", - "type": "uint32" - }, - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.TokenBucket", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRateLimitAdmin", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - } - ], - "name": "getRemotePool", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - } - ], - "name": "getRemoteToken", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRmnProxy", - "outputs": [ - { - "internalType": "address", - "name": "rmnProxy", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getRouter", - "outputs": [ - { - "internalType": "address", - "name": "router", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getSupportedChains", - "outputs": [ - { - "internalType": "uint64[]", - "name": "", - "type": "uint64[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getToken", - "outputs": [ - { - "internalType": "contract IERC20", - "name": "token", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - } - ], - "name": "isSupportedChain", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "isSupportedToken", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes", - "name": "receiver", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "originalSender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "localToken", - "type": "address" - } - ], - "internalType": "struct Pool.LockOrBurnInV1", - "name": "lockOrBurnIn", - "type": "tuple" - } - ], - "name": "lockOrBurn", - "outputs": [ - { - "components": [ - { - "internalType": "bytes", - "name": "destTokenAddress", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "destPoolData", - "type": "bytes" - } - ], - "internalType": "struct Pool.LockOrBurnOutV1", - "name": "lockOrBurnOut", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "bytes", - "name": "originalSender", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "address", - "name": "localToken", - "type": "address" - }, - { - "internalType": "bytes", - "name": "sourcePoolAddress", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "sourcePoolData", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "offchainTokenData", - "type": "bytes" - } - ], - "internalType": "struct Pool.ReleaseOrMintInV1", - "name": "releaseOrMintIn", - "type": "tuple" - } - ], - "name": "releaseOrMint", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "destinationAmount", - "type": "uint256" - } - ], - "internalType": "struct Pool.ReleaseOrMintOutV1", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "outboundConfig", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "isEnabled", - "type": "bool" - }, - { - "internalType": "uint128", - "name": "capacity", - "type": "uint128" - }, - { - "internalType": "uint128", - "name": "rate", - "type": "uint128" - } - ], - "internalType": "struct RateLimiter.Config", - "name": "inboundConfig", - "type": "tuple" - } - ], - "name": "setChainRateLimiterConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "rateLimitAdmin", - "type": "address" - } - ], - "name": "setRateLimitAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "remoteChainSelector", - "type": "uint64" - }, - { - "internalType": "bytes", - "name": "remotePoolAddress", - "type": "bytes" - } - ], - "name": "setRemotePool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newRouter", - "type": "address" - } - ], - "name": "setRouter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/ccip/offchain/config/mainnet.json b/ccip/offchain/config/mainnet.json deleted file mode 100644 index 695e1b59..00000000 --- a/ccip/offchain/config/mainnet.json +++ /dev/null @@ -1,322 +0,0 @@ -{ - "ethereumMainnet": { - "chainSelector": "5009297550715157269", - "router": { - "address": "0x80226fc0Ee2b096224EeAc085Bb9a8cba1146f7D", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x411dE17f12D1A34ecC7F45f49844626267c75e81", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x13022e3e6C77524308BD56AEd716E88311b2E533", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xb22764f98dD05c789929716D677382Df22C05Cb6", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "optimismMainnet": { - "chainSelector": "3734403246176062136", - "router": { - "address": "0x3206695CaE29952f4b0c22a169725a865bc8Ce0f", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x55b3FCa23EdDd28b1f5B4a3C7975f63EFd2d06CE", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x3E2f636Ff8e12728638C4c4b34d282a7fDF0e5B8", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x657c42abE4CD8aa731Aec322f871B5b90cf6274F", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "arbitrumMainnet": { - "chainSelector": "4949039107694359620", - "router": { - "address": "0x141fa059441E0ca23ce184B6A78bafD2A517DdE8", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xC311a21e6fEf769344EB1515588B9d535662a145", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x818792C958Ac33C01c58D5026cEc91A86e9071d7", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x39AE1032cF4B334a1Ed41cdD0833bdD7c7E7751E", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "polygonMainnet": { - "chainSelector": "4051577828743386545", - "router": { - "address": "0x849c5ED5a80F5B408Dd4969b78c2C8fdf0565Bfe", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xf1ceAa46D8d13Cac9fC38aaEF3d3d14754C5A9c2", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x30CcdEa6a6B521B2B6Fa1Cdc2fd38FB2c1cC82b3", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x00F027eA6D0fb03256A15E9182B2B9227A4931d8", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WMATIC"] - }, - "avalancheMainnet": { - "chainSelector": "6433500567565415381", - "router": { - "address": "0xF4c7E640EdA248ef95972845a62bdC74237805dB", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xcBD48A8eB077381c3c4Eb36b402d7283aB2b11Bc", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x9c093872cd5931D975C4d4B4a3a8c61a5767E5c1", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xc8df5D618c6a59Cc6A311E96a39450381001464F", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WAVAX"] - }, - "bscMainnet": { - "chainSelector": "11344663589394136015", - "router": { - "address": "0x34B03Cb9086d7D758AC55af71584F81A598759FE", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x9e09697842194f77d315E0907F1Bda77922e8f84", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xfa4C3f58D2659AFe4F964C023e6AfD183C374435", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x736Fd8660c443547a85e4Eaf70A49C1b7Bb008fc", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WBNB"] - }, - "baseMainnet": { - "chainSelector": "15971525489660198786", - "router": { - "address": "0x881e3A65B4d4a04dD529061dd0071cf975F58bCD", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xC842c69d54F83170C42C4d556B4F6B2ca53Dd3E8", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x1A5f2d0c090dDB7ee437051DA5e6f03b6bAE1A77", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x6f6C373d09C07425BaAE72317863d7F6bb731e37", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "wemixMainnet": { - "chainSelector": "5142893604156789321", - "router": { - "address": "0x7798b795Fde864f4Cd1b124a38Ba9619B7F8A442", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x2375959c6571AC7a83c164C6FCcbd09E7782773d", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xe89241cbE74349EA74a0c23823A516B3c74A289B", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xE993e046AC50659800a91Bab0bd2daBF59CbD171", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WWEMIX"] - }, - "kromaMainnet": { - "chainSelector": "3719320017875267166", - "router": { - "address": "0xE93E8B0d1b1CEB44350C8758ed1E2799CCee31aB", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x6E4d2dBBF8a1A943412aD451422FE11A25C781DE", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xe87a456F364D1641F8123D4122Fc542282BFc0FA", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x447066676A5413682a881c63aed0F03f8ACf7E45", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "celoMainnet": { - "chainSelector": "1346049177634351622", - "router": { - "address": "0xfB48f15480926A4ADf9116Dca468bDd2EE6C5F62", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x56e0507d4E69D98bE7Eb4ada01d2315596F9f281", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x858B064d15bD54fcdfaf087A4AE4BaabF724d9E9", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xf19e0555fAA9051e277eeD5A0DcdB13CDaca39a9", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WCELO"] - }, - "xdaiMainnet": { - "chainSelector": "465200170687744372", - "router": { - "address": "0x4aAD6071085df840abD9Baf1697d5D5992bDadce", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xf5e5e1676942520995c1e39aFaC58A75Fe1cd2bB", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xdf529b48fCDfd095c81497E435585Ed465D600A2", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x73BC11423CBF14914998C23B0aFC9BE0cb5B2229", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WXDAI"] - }, - "modeMainnet": { - "chainSelector": "7264351850409363825", - "router": { - "address": "0x24C40f13E77De2aFf37c280BA06c333531589bf1", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xA0876B45271615c737781185C2B5ada60ed2D2B9", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xF54d38E4844c5f6E5Aab0AF7557ef5cb1cA4253e", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xB4b40c010A547dff6A22d94bC2C1c1e745b62aB2", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "blastMainnet": { - "chainSelector": "4411394078118774322", - "router": { - "address": "0x12e0B8E349C6fb7E6E40713E8125C3cF1127ea8C", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x50dbd1e73ED032f42B5892E5F3689972FefAc880", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xa277610fF9A04364d2b80f26C9DFb32Be5e45D94", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x846Fccd01D4115FD1E81267495773aeB33bF1dC7", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "andromedaMainnet": { - "chainSelector": "8805746078405598895", - "router": { - "address": "0x7b9FB8717D306e2e08ce2e1Efa81F026bf9AD13c", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xd99cc1d64027E07Cd2AaE871E16bb32b8F401998", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xE4B147224Db9B6E3776E4B3CEda31b3cE232e2FA", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x3af897541eB03927c7431bF68884A6C2C23b683f", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WMETIS"] - }, - "zksyncMainnet": { - "chainSelector": "1562403441176082196", - "router": { - "address": "0x748Fd769d81F5D94752bf8B0875E9301d0ba71bB", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x2aBB46A2D32220b8801CE96CAbC32dd2dA7b7B20", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xab0731056C23b85eDd62F12E716fC75fc1fB1219", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x100a47C9DB342884E3314B91cec076BbAC8e619c", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "roninMainnet": { - "chainSelector": "6916147374840168594", - "router": { - "address": "0x46527571D5D1B68eE7Eb60B18A32e6C60DcEAf99", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xceA253a8c2BB995054524d071498281E89aACD59", - "version": "1.5.0" - }, - "registryModule": { - "address": "0x5055DA89A16b71fEF91D1af323b139ceDe2d8320", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x90e83d532A4aD13940139c8ACE0B93b0DdbD323a", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WRON"] - } -} diff --git a/ccip/offchain/config/messageState.json b/ccip/offchain/config/messageState.json deleted file mode 100644 index b3176c79..00000000 --- a/ccip/offchain/config/messageState.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "0": "UNTOUCHED", - "1": "IN_PROGRESS", - "2": "SUCCESS", - "3": "FAILURE" -} diff --git a/ccip/offchain/config/testnet.json b/ccip/offchain/config/testnet.json deleted file mode 100644 index 8fc3f6be..00000000 --- a/ccip/offchain/config/testnet.json +++ /dev/null @@ -1,322 +0,0 @@ -{ - "avalancheFuji": { - "chainSelector": "14767482510784806043", - "router": { - "address": "0xF694E193200268f9a4868e4Aa017A0118C9a8177", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xAc8CFc3762a979628334a0E4C1026244498E821b", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x97300785aF1edE1343DB6d90706A35CF14aA3d81", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xA92053a4a3922084d992fD2835bdBa4caC6877e6", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WAVAX"] - }, - "bscTestnet": { - "chainSelector": "13264668187771770619", - "router": { - "address": "0xE1053aE1857476f36A3C62580FF9b016E8EE8F6f", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x763685240370758c5ac6C5F7c22AB36684c0570E", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xF8f2A4466039Ac8adf9944fD67DBb3bb13888f2B", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WBNB"] - }, - "ethereumSepolia": { - "chainSelector": "16015286601757825753", - "router": { - "address": "0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xba3f6251de62dED61Ff98590cB2fDf6871FbB991", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x62e731218d0D47305aba2BE3751E7EE9E5520790", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x95F29FEE11c5C55d26cCcf1DB6772DE953B37B82", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "arbitrumTestnet": { - "chainSelector": "3478487238524512106", - "router": { - "address": "0x2a9C5afB0d0e4BAb2BCdaE109EC4b0c4Be15a165", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x9527E2d01A3064ef6b50c1Da1C0cC523803BCFF2", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xE625f0b8b0Ac86946035a7729Aba124c8A64cf69", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x8126bE56454B628a88C17849B9ED99dd5a11Bd2f", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "baseSepolia": { - "chainSelector": "10344971235874465080", - "router": { - "address": "0xD3b06cEbF099CE7DA4AcCf578aaebFDBd6e88a93", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x99360767a4705f68CcCb9533195B761648d6d807", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x8A55C61227f26a3e2f217842eCF20b52007bAaBe", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x736D0bBb318c1B27Ff686cd19804094E66250e17", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "kromaSepolia": { - "chainSelector": "5990477251245693094", - "router": { - "address": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xA930c1E0fF1E1005E8Ef569Aa81e6EEbf466b1c3", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x683995A22b3654556E9EeA29C0b9df973be6D549", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xaE669d8217c00b02Fb7a7d9902c897745F4f4c83", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "optimismSepolia": { - "chainSelector": "5224473277236331295", - "router": { - "address": "0x114A20A10b43D4115e5aeef7345a1A71d2a60C57", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xb40A3109075965cc09E93719e33E748abf680dAe", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x49c4ba01dc6F5090f9df43Ab8F79449Db91A0CBB", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x1d702b1FA12F347f0921C722f9D9166F00DEB67A", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "wemixTestnet": { - "chainSelector": "9284632837123596123", - "router": { - "address": "0xA8C0c11bf64AF62CDCA6f93D3769B88BdD7cb93D", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xA930c1E0fF1E1005E8Ef569Aa81e6EEbf466b1c3", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x7050BD352A5Aacf774CF883f9345a0C10BdF3cD2", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xecf484BFcC51F24fcB31056c262A021bAf688D9B", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WWEMIX"] - }, - "xdaiChiado": { - "chainSelector": "8871595565390010547", - "router": { - "address": "0x19b1bac554111517831ACadc0FD119D23Bb14391", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x1be106fd3b104275B1e56BcAca554B8cbc5a2577", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x02a254c97Ca097Fb09792bfe331E3FBE61f6aF6A", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x75ada0256Bea7956824B190419b52ba6660f9CF9", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WXDAI"] - }, - "polygonAmoy": { - "chainSelector": "16281711391670634445", - "router": { - "address": "0x9C32fCB86BF0f4a1A8921a9Fe46de3198bb884B2", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x7c1e545A40750Ee8761282382D51E017BAC68CBB", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x84ad5890A63957C960e0F19b0448A038a574936B", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x1e73f6842d7afDD78957ac143d1f315404Dd9e5B", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WMATIC"] - }, - "celoAlfajores": { - "chainSelector": "3552045678561919002", - "router": { - "address": "0xb00E95b773528E2Ea724DB06B75113F239D15Dca", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x7A394C616A7347dc91C40159929e1c9a435cb83A", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xa8c380Ecd336401Ee896Df33b93F1c76b749C902", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x5585040bED214fdC60c9cE8c3E8a9c52CE19f4Ea", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WCELO"] - }, - "modeSepolia": { - "chainSelector": "829525985033418733", - "router": { - "address": "0xc49ec0eB4beb48B8Da4cceC51AA9A5bD0D0A4c43", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xcbFD5e55619B4EE3E6e7fe3CEb0E78fDf7d82dfc", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x4f4fe77A9dBEDe8c4EbFe51932C2E08A37c890ED", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xc89d4ff0cb206677a7555e52500879bfab73cC68", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "blastSepolia": { - "chainSelector": "2027362563942762617", - "router": { - "address": "0xfb2f2A207dC428da81fbAFfDDe121761f8Be1194", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x1cb6afB6F411f0469c3C0d5D46f6e8f7fd3eADe0", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x912F59E92467C54BBab49ED3a5d431504aFBa30c", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x98f1703B9C02f9Ab8bA4cc209Ee8D7B188Bb43a8", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "andromedaSepolia": { - "chainSelector": "3777822886988675105", - "router": { - "address": "0xaCdaBa07ECad81dc634458b98673931DD9d3Bc14", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xfd66EBE7335E91ae6f4CCCccdDDF262Ab5e35c71", - "version": "1.0.0" - }, - "registryModule": { - "address": "0xA8942fF01DE753BDa1D39acA8774f0872Eee5080", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x31668C3E8f96415286e9e03592ad97E50e565f52", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WMETIS"] - }, - "zksyncSepolia": { - "chainSelector": "6898391096552792247", - "router": { - "address": "0xA1fdA8aa9A8C4b945C45aD30647b01f07D7A0B16", - "version": "1.2.0" - }, - "armProxy": { - "address": "0x3DA20FD3D8a8f8c1f1A5fD03648147143608C467", - "version": "1.0.0" - }, - "registryModule": { - "address": "0x3139687Ee9938422F57933C3CDB3E21EE43c4d0F", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0xc7777f12258014866c677Bdb679D0b007405b7DF", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WETH"] - }, - "roninSaigon": { - "chainSelector": "13116810400804392105", - "router": { - "address": "0x0aCAe4e51D3DA12Dd3F45A66e8b660f740e6b820", - "version": "1.2.0" - }, - "armProxy": { - "address": "0xf206c6D3f3810eBbD75e7B4684291b5e51023D2f", - "version": "1.5.0" - }, - "registryModule": { - "address": "0xE31827cd24d7D419fC17E7Ff889BaF62A17991A0", - "version": "1.5.0" - }, - "tokenAdminRegistry": { - "address": "0x057879f376041D527a98327DE2Ec00F201c9cA25", - "version": "1.5.0" - }, - "feeTokens": ["LINK", "WRON"] - } -} diff --git a/ccip/offchain/javascript/.gitignore b/ccip/offchain/javascript/.gitignore deleted file mode 100644 index 979db9f2..00000000 --- a/ccip/offchain/javascript/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -.env.enc -lanes-and-tokens.js diff --git a/ccip/offchain/javascript/README.md b/ccip/offchain/javascript/README.md deleted file mode 100644 index f22d5693..00000000 --- a/ccip/offchain/javascript/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# CCIP Off-Chain JavaScript - -This repository contains a list of scripts that can be used to interact with the CCIP Off-Chain Router contract. The scripts are written in JavaScript and can be executed using Node.js: - -- [transfer-tokens.js](src/transfer-tokens.js): Transfer tokens from one blockchain to another. -- [supported-tokens.js](src/supported-tokens.js): Retrieve the list of supported tokens that can be transferred from one blockchain to another. **Note**: This script is deprecated. A more future proof way will be provided in the future. -- [get-status.js](src/get-status.js): Retrieve the status of a CCIP transaction. - -## Supported Chains - -The supported blockchains can be found in the [config](../config/) directory: - -- [mainnet.json](../config/mainnet.json) -- [testnet.json](../config/testnet.json) - -## Prerequisites - -- Install the dependencies: - - ```shell - npm install - ``` - -- We use [@chainlink/env-enc](https://www.npmjs.com/package/@chainlink/env-enc) package to encrypt environment variables at rest. Set the password to encrypt and decrypt the environment varilable file `.env.enc`: - - ```shell - npx env-enc set-pw - ``` - -- Set and save the variables that you need: - - ```shell - npx env-enc set - ``` - -You will have to set-up the following variables: - -- `PRIVATE_KEY`: private key of the account that will be used to sign the transactions. -- RPC URLs for the blockchains that you will interact with. In the [config](../config/) directory, the supported chains (for testnet and mainnet) are listed in camel case. Therefore, the RPC URLs environment variable names are derived from the chain name by converting it to upper case, replacing any camel case humps with underscores, and appending `_RPC_URL`. For example, the RPC URL for: - - - `ethereumSepolia` is `ETHEREUM_SEPOLIA_RPC_URL`. - - `avalancheFuji` is `AVALANCHE_FUJI_RPC_URL`. - -## Examples - -### Get the list of supported tokens - -> **Deprecation Notice:** -> This function is **deprecated** and will be deactivated in future versions. We recommend avoiding its use at this time. An alternative method will be provided in an upcoming release. - -In this example, you will interact with the router contract to retrieve the list of supported tokens that can be transferred from your blockchain to a target blockchain. - -```shell -node src/supported-tokens.js sourceBlockchain targetBlockchain -``` - -Example: - -```shell -node src/supported-tokens.js ethereumSepolia avalancheFuji -``` - -### Transfer a token - -In these examples, you will interact with the router contract to transfer a specified amount of tokens from your account to another account on a different blockchain. The source blockchain, target blockchain, target account address, token address, and amount are all provided as command-line arguments. Please note, a validation check is in place to ensure the token address provided is supported. - -#### Pay fees in LINK token - -```shell -node src/transfer-tokens.js sourceBlockchain targetBlockchain targetAccountAddress tokenAddress amount linkTokenAddress -``` - -Example (transfer CCIP-BnM and pay fees in LINK): - -```shell -node src/transfer-tokens.js ethereumSepolia avalancheFuji 0x9d087fC03ae39b088326b67fA3C788236645b717 0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05 100 0x779877A7B0D9E8603169DdbD7836e478b4624789 -``` - -#### Pay fees in native gas - -```shell -node src/transfer-tokens.js sourceBlockchain targetBlockchain targetAccountAddress tokenAddress amount -``` - -Example (transfer CCIP-BnM and pay fees in sepolia ETH): - -```shell -node src/transfer-tokens.js ethereumSepolia avalancheFuji 0x9d087fC03ae39b088326b67fA3C788236645b717 0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05 100 -``` - -#### Pay fees in wrapped native gas - -```shell -node src/transfer-tokens.js sourceBlockchain targetBlockchain targetAccountAddress tokenAddress amount wrappedNativeAddress -``` - -Example (send CCIP-BnM and pay fees in WETH): - -```shell -node src/transfer-tokens.js ethereumSepolia avalancheFuji 0x9d087fC03ae39b088326b67fA3C788236645b717 0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05 100 0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534 -``` diff --git a/ccip/offchain/javascript/package-lock.json b/ccip/offchain/javascript/package-lock.json deleted file mode 100644 index cf9c0f13..00000000 --- a/ccip/offchain/javascript/package-lock.json +++ /dev/null @@ -1,284 +0,0 @@ -{ - "name": "ccip-offchain-examples-js", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "ccip-offchain-examples-js", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "@chainlink/env-enc": "^1.0.5", - "ethers": "^6.11.1", - "lodash": "^4.17.21" - } - }, - "node_modules/@adraffy/ens-normalize": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", - "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" - }, - "node_modules/@chainlink/env-enc": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@chainlink/env-enc/-/env-enc-1.0.5.tgz", - "integrity": "sha512-hT7W+tEq/kzkf/yn9sIBsMDcpvbuoPk0JPVGfgygfPJxfS3YUyeen6CdEwJ9o+A7GTWxz/ZnPolpUveX3BUCBQ==", - "dependencies": { - "yargs": "^17.7.1" - }, - "bin": { - "env-enc": "dist/cli.js" - } - }, - "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@types/node": { - "version": "18.15.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" - }, - "node_modules/aes-js": { - "version": "4.0.0-beta.5", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/ethers": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.11.1.tgz", - "integrity": "sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@adraffy/ens-normalize": "1.10.1", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@types/node": "18.15.13", - "aes-js": "4.0.0-beta.5", - "tslib": "2.4.0", - "ws": "8.5.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - } - } -} diff --git a/ccip/offchain/javascript/package.json b/ccip/offchain/javascript/package.json deleted file mode 100644 index c4870946..00000000 --- a/ccip/offchain/javascript/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "ccip-offchain-examples-js", - "version": "1.0.0", - "description": "provide typescript examples of interacting with Chainlink CCIP from your EOA", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC", - "dependencies": { - "@chainlink/env-enc": "^1.0.5", - "ethers": "^6.11.1", - "lodash": "^4.17.21" - } -} diff --git a/ccip/offchain/javascript/src/config/ccip.js b/ccip/offchain/javascript/src/config/ccip.js deleted file mode 100644 index bd39297a..00000000 --- a/ccip/offchain/javascript/src/config/ccip.js +++ /dev/null @@ -1,74 +0,0 @@ -// Import the JSON configuration files -const mainnetConfig = require("../../../config/mainnet.json"); -const testnetConfig = require("../../../config/testnet.json"); -// Merge the configurations using the spread operator -const mergedNetworks = { - ...mainnetConfig, - ...testnetConfig, -}; - -// Get the list of supported networks -const supportedNetworks = Object.keys(mergedNetworks); - -// Function to get router configuration -const getRouterConfig = (network) => { - const config = mergedNetworks[network]; - if (!config) { - throw new Error("No config found for network: " + network); - } - - return { - router: config.router, - chainSelector: BigInt(config.chainSelector), - }; -}; - -// Function to get registry module configuration -const getRegistryModuleConfig = (network) => { - const config = mergedNetworks[network]; - if (!config) { - throw new Error("No config found for network: " + network); - } - - return config.registryModule; -}; - -// Function to get token admin registry configuration -const getTokenAdminRegistryConfig = (network) => { - const config = mergedNetworks[network]; - if (!config) { - throw new Error("No config found for network: " + network); - } - - return config.tokenAdminRegistry; -}; - -// Function to get ARM proxy configuration -const getArmProxyConfig = (network) => { - const config = mergedNetworks[network]; - if (!config) { - throw new Error("No config found for network: " + network); - } - - return config.armProxy; -}; - -// Function to get fee tokens for a network -const getFeeTokens = (network) => { - const config = mergedNetworks[network]; - if (!config || !config.feeTokens) { - throw new Error("No fee tokens found for network: " + network); - } - - return config.feeTokens; -}; - -// Export the functions -module.exports = { - supportedNetworks, - getRouterConfig, - getRegistryModuleConfig, - getTokenAdminRegistryConfig, - getArmProxyConfig, - getFeeTokens, -}; diff --git a/ccip/offchain/javascript/src/config/env.js b/ccip/offchain/javascript/src/config/env.js deleted file mode 100644 index 82c5474d..00000000 --- a/ccip/offchain/javascript/src/config/env.js +++ /dev/null @@ -1,36 +0,0 @@ -const { supportedNetworks } = require("./ccip"); - -const getRpcUrlName = (network) => - network.replace(/([A-Z])/g, "_$1").toUpperCase() + "_RPC_URL"; - -const getProviderRpcUrl = (network) => { - require("@chainlink/env-enc").config(); - if (!supportedNetworks.includes(network)) - throw new Error( - `[ERROR] Network '${network}' is not supported. Supported networks: ${supportedNetworks.join(", ")}` - ); - - const environmentVariableName = getRpcUrlName(network); - const rpcUrl = process.env[environmentVariableName]; - - if (!rpcUrl) - throw new Error( - `[ERROR] RPC URL not found for network '${network}'. Please set ${environmentVariableName} in your environment variables` - ); - return rpcUrl; -}; - -const getPrivateKey = () => { - require("@chainlink/env-enc").config(); - const privateKey = process.env.PRIVATE_KEY; - if (!privateKey) - throw new Error( - `[ERROR] PRIVATE_KEY not found in environment variables. Please set PRIVATE_KEY using chainlink env-enc` - ); - return privateKey; -}; - -module.exports = { - getPrivateKey, - getProviderRpcUrl, -}; diff --git a/ccip/offchain/javascript/src/config/index.js b/ccip/offchain/javascript/src/config/index.js deleted file mode 100644 index 09c9e04f..00000000 --- a/ccip/offchain/javascript/src/config/index.js +++ /dev/null @@ -1,25 +0,0 @@ -const env = require("./env"); -const ccip = require("./ccip"); -const offramp = require("./offramp"); - -// override console.log to disable ethersjs warning when there are duplicates in ABI - -const oldLog = console.log; - -const log = (...args) => { - const msg = args.length > 0 ? args[0] : ""; - - if (/Duplicate definition of/.test(msg)) { - return; - } - - oldLog(...args); // This will pass all the arguments to the original console.log function -}; - -console.log = log; - -module.exports = { - ...ccip, - ...env, - ...offramp, -}; diff --git a/ccip/offchain/javascript/src/config/offramp.js b/ccip/offchain/javascript/src/config/offramp.js deleted file mode 100644 index ec42edd7..00000000 --- a/ccip/offchain/javascript/src/config/offramp.js +++ /dev/null @@ -1,12 +0,0 @@ -const messageExecutionState = require("../../../config/messageState.json"); - -const getMessageStatus = (status) => { - if (status in messageExecutionState) { - return messageExecutionState[status]; - } - return "unknown"; -}; - -module.exports = { - getMessageStatus, -}; diff --git a/ccip/offchain/javascript/src/get-status.js b/ccip/offchain/javascript/src/get-status.js deleted file mode 100644 index 1c3cac15..00000000 --- a/ccip/offchain/javascript/src/get-status.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Script to query the status of a cross-chain message by its ID. - * Demonstrates interacting with blockchain networks using ethers.js, including contract interaction and event filtering. - * - * Usage: - * - Run this script from the command line using Node.js. - * - Requires three arguments: source chain identifier, destination chain identifier, and message ID. - * - * Example Command: - * node src/get-status.js ethereumSepolia avalancheFuji 0xbd2f... - * - */ - -// Import necessary modules and functions from external files. -const { - getProviderRpcUrl, // Function to get the RPC URL for a given blockchain. - getRouterConfig, // Function to get configuration for the router smart contract. - getMessageStatus, // Function to translate numeric message status codes into human-readable strings. -} = require("./config"); -const { ethers, JsonRpcProvider } = require("ethers"); // Import ethers for blockchain interactions. -const routerAbi = require("../../abi/Router.json"); // Load Router contract ABI. -const offRampAbi = require("../../abi/OffRamp.json"); // Load OffRamp contract ABI. - -/** - * Parses command-line arguments and validates the input. - * Expects three arguments after the script name: source chain, destination chain, and message ID. - * - * @throws {Error} If the incorrect number of arguments are provided. - * @returns {{chain: string, targetChain: string, messageId: string}} Object containing the parsed arguments. - */ -const handleArguments = () => { - if (process.argv.length !== 5) { - // Check for the correct number of arguments. - throw new Error("Wrong number of arguments"); - } - - // Extract the arguments: source chain, target chain, and the message ID. - const chain = process.argv[2]; - const targetChain = process.argv[3]; - const messageId = process.argv[4]; - - return { chain, targetChain, messageId }; -}; - -/** - * Main function to query the status of a cross-chain message by its ID. - * It connects to the blockchain networks, instantiates the smart contracts, and checks the message status. - */ -const getStatus = async () => { - const { chain, targetChain, messageId } = handleArguments(); // Extract arguments. - - // Retrieve RPC URLs for source and destination chains. - const destinationRpcUrl = getProviderRpcUrl(targetChain); - const sourceRpcUrl = getProviderRpcUrl(chain); - - // Initialize providers to connect to the blockchain networks. - const destinationProvider = new JsonRpcProvider(destinationRpcUrl); - const sourceProvider = new JsonRpcProvider(sourceRpcUrl); - - // Get configuration for routers on both chains. - const sourceRouterAddress = getRouterConfig(chain).router.address; - const sourceChainSelector = getRouterConfig(chain).chainSelector; - const destinationRouterAddress = getRouterConfig(targetChain).router.address; - const destinationChainSelector = getRouterConfig(targetChain).chainSelector; - - // Instantiate router contracts with ethers for both source and destination chains. - const sourceRouterContract = new ethers.Contract( - sourceRouterAddress, - routerAbi, - sourceProvider - ); - - // Check if the destination chain is supported by the source chain's router. - const isChainSupported = await sourceRouterContract.isChainSupported( - destinationChainSelector - ); - if (!isChainSupported) { - throw new Error(`Lane ${chain}->${targetChain} is not supported`); - } - - const destinationRouterContract = new ethers.Contract( - destinationRouterAddress, - routerAbi, - destinationProvider - ); - - // Fetch OffRamp contracts associated with the destination router contract. - const offRamps = await destinationRouterContract.getOffRamps(); - - // Filter for the OffRamps that match the source chain. - const matchingOffRamps = offRamps.filter( - (offRamp) => - offRamp.sourceChainSelector.toString() === sourceChainSelector.toString() - ); - - // Initialize a flag to determine if the message was found - let messageFound = false; - - // Check each matching OffRamp for the message ID. - for (const matchingOffRamp of matchingOffRamps) { - const offRampContract = new ethers.Contract( - matchingOffRamp.offRamp, - offRampAbi, - destinationProvider - ); - // Query for events indicating a change in execution state for the given message ID. - const events = await offRampContract.queryFilter( - offRampContract.filters.ExecutionStateChanged(undefined, messageId) - ); - - if (events.length > 0) { - // If events are found, log the status and exit the loop. - const { state } = events[0].args; - const status = getMessageStatus(state); - console.log( - `Status of message ${messageId} on offRamp ${matchingOffRamp.offRamp} is ${status}\n` - ); - messageFound = true; // Set the flag to indicate that the message was found - break; // Exit the loop as we've found the message - } - } - - // If no events are found, it's likely the message hasn't been processed or doesn't exist on the destination chain. - if (!messageFound) { - console.log( - `Either the message ${messageId} does not exist OR it has not been processed yet on destination chain\n` - ); - } -}; - -// Execute the getStatus function and catch any errors. -getStatus().catch((e) => { - console.error(e); // Log any errors encountered during execution. - process.exit(1); // Exit the script with a status code indicating an error. -}); diff --git a/ccip/offchain/javascript/src/supported-tokens.js b/ccip/offchain/javascript/src/supported-tokens.js deleted file mode 100644 index bad336f5..00000000 --- a/ccip/offchain/javascript/src/supported-tokens.js +++ /dev/null @@ -1,180 +0,0 @@ -// Import necessary modules and data -const { - getProviderRpcUrl, - getRouterConfig, - getTokenAdminRegistryConfig, -} = require("./config"); -const { ethers } = require("ethers"); - -// Import ABI files -const routerAbi = require("../../abi/Router.json"); -const erc20Abi = require("../../abi/IERC20Metadata.json"); -const tokenAdminRegistryAbi = require("../../abi/TokenAdminRegistry.json"); -const tokenPoolAbi = require("../../abi/TokenPool.json"); - -// Function to handle command-line arguments -const handleArguments = () => { - if (process.argv.length !== 4) { - throw new Error( - "Expects 2 arguments. Expected format: node src/supported-tokens.js " - ); - } - - const sourceChain = process.argv[2]; - const destinationChain = process.argv[3]; - - return { sourceChain, destinationChain }; -}; - -const getSupportedTokens = async () => { - console.log(`[INFO] Starting token discovery for cross-chain transfers`); - const { sourceChain, destinationChain } = handleArguments(); - - const rpcUrl = getProviderRpcUrl(sourceChain); - const provider = new ethers.JsonRpcProvider(rpcUrl); - - const routerAddress = getRouterConfig(sourceChain).router.address; - const destinationChainSelector = getRouterConfig(destinationChain).chainSelector; - - const sourceRouterContract = new ethers.Contract( - routerAddress, - routerAbi, - provider - ); - - const isChainSupported = await sourceRouterContract.isChainSupported( - destinationChainSelector - ); - - if (!isChainSupported) { - console.error( - `[ERROR] Lane ${sourceChain} -> ${destinationChain} is not supported` - ); - throw new Error( - `Lane ${sourceChain} -> ${destinationChain} is not supported\n` - ); - } - console.log(`[INFO] Lane ${sourceChain} -> ${destinationChain} is supported`); - - const tokenAdminRegistryConfig = getTokenAdminRegistryConfig(sourceChain); - const tokenAdminRegistryAddress = tokenAdminRegistryConfig.address; - const tokenAdminRegistryContract = new ethers.Contract( - tokenAdminRegistryAddress, - tokenAdminRegistryAbi, - provider - ); - - let startIndex = 0; - const maxCount = 100; - let tokensBatch = []; - const tokenToPoolMap = {}; // Mapping of token to pool - const uniqueTokens = new Set(); // Use Set to handle potential duplicates - - console.log( - `[INFO] Fetching all registered tokens from ${sourceChain} using TokenAdminRegistry at ${tokenAdminRegistryAddress}` - ); - - let totalProcessed = 0; - do { - console.log( - `[INFO] Fetching batch: offset=${startIndex}, limit=${maxCount}` - ); - tokensBatch = await tokenAdminRegistryContract.getAllConfiguredTokens( - startIndex, - maxCount - ); - totalProcessed += tokensBatch.length; - console.log( - `[INFO] Found ${tokensBatch.length} tokens (total processed: ${totalProcessed})` - ); - - tokensBatch.forEach((token) => uniqueTokens.add(token)); - startIndex = startIndex + tokensBatch.length; - - console.log( - `[INFO] Fetching pools for ${tokensBatch.length} tokens and checking support for ${destinationChain}` - ); - const pools = await tokenAdminRegistryContract.getPools([...tokensBatch]); - - // Process pools in chunks of 5 for parallel processing - for (let i = 0; i < tokensBatch.length; i += 5) { - const chunkEnd = Math.min(i + 5, tokensBatch.length); - const chunk = tokensBatch.slice(i, chunkEnd); - const poolsChunk = pools.slice(i, chunkEnd); - - const supportCheckPromises = poolsChunk.map((poolAddress, index) => { - const tokenPoolContract = new ethers.Contract( - poolAddress, - tokenPoolAbi, - provider - ); - return tokenPoolContract - .isSupportedChain(destinationChainSelector) - .then((isSupported) => ({ - token: chunk[index], - pool: poolAddress, - isSupported, - error: null, - })) - .catch((error) => ({ - token: chunk[index], - pool: poolAddress, - isSupported: false, - error, - })); - }); - - const results = await Promise.all(supportCheckPromises); - - results.forEach(({ token, pool, isSupported, error }) => { - if (error) { - console.warn( - `Failed to check chain support for pool ${pool}, skipping...` - ); - } else if (isSupported) { - tokenToPoolMap[token] = pool; - } - }); - } - } while (tokensBatch.length === maxCount); - - const eligibleTokens = Object.keys(tokenToPoolMap).length; - console.log( - `[SUMMARY] Found ${uniqueTokens.size} unique tokens, ${eligibleTokens} support ${destinationChain}` - ); - - const supportedTokens = Array.from(uniqueTokens); - - for (const supportedToken of supportedTokens) { - if (!tokenToPoolMap[supportedToken]) { - continue; - } - - const erc20 = new ethers.Contract(supportedToken, erc20Abi, provider); - - const [name, symbol, decimals] = await Promise.all([ - erc20.name(), - erc20.symbol(), - erc20.decimals(), - ]); - - const poolAddress = tokenToPoolMap[supportedToken]; - - console.log( - `[INFO] Token: ${name} (${symbol}) at ${supportedToken}, decimals=${decimals}, pool=${poolAddress}` - ); - } -}; - -getSupportedTokens().catch((e) => { - console.error(`[ERROR] Token discovery failed:`); - if (e instanceof Error) { - console.error(`[ERROR] Message: ${e.message}`); - if (e.stack) { - console.error(`[ERROR] Stack: ${e.stack}`); - } - } else { - console.error(`[ERROR] Unknown error type:`, e); - } - process.exit(1); -}); diff --git a/ccip/offchain/javascript/src/transfer-tokens.js b/ccip/offchain/javascript/src/transfer-tokens.js deleted file mode 100644 index 099b339a..00000000 --- a/ccip/offchain/javascript/src/transfer-tokens.js +++ /dev/null @@ -1,398 +0,0 @@ -// Import necessary modules and data -const { - getProviderRpcUrl, - getRouterConfig, - getPrivateKey, - getMessageStatus, - getTokenAdminRegistryConfig, -} = require("./config"); -const { ethers } = require("ethers"); -const routerAbi = require("../../abi/Router.json"); -const offRampAbi = require("../../abi/OffRamp.json"); -const erc20Abi = require("../../abi/IERC20Metadata.json"); -const tokenAdminRegistryAbi = require("../../abi/TokenAdminRegistry.json"); - -// Command: node src/transfer-tokens.js sourceChain destinationChain destinationAccount tokenAddress amount feeTokenAddress(optional) -// Examples (sepolia): - -// Pay fees with native token: -// node src/transfer-tokens.js ethereumSepolia avalancheFuji 100 - -// Pay fees with LINK token: -// node src/transfer-tokens.js ethereumSepolia avalancheFuji 100 - -// Pay fees with a wrapped native token: -// node src/transfer-tokens.js ethereumSepolia avalancheFuji 100 - -const handleArguments = () => { - if (process.argv.length !== 7 && process.argv.length !== 8) { - // feeTokenAddress is optional - throw new Error( - "Wrong number of arguments. Expected format: node src/transfer-tokens.js [feeTokenAddress]" - ); - } - - const sourceChain = process.argv[2]; - const destinationChain = process.argv[3]; - const destinationAccount = ethers.getAddress(process.argv[4]); - const tokenAddress = ethers.getAddress(process.argv[5]); - const amount = BigInt(process.argv[6]); - const feeTokenAddress = process.argv[7] && ethers.getAddress(process.argv[7]); - - return { - sourceChain, - destinationChain, - destinationAccount, - tokenAddress, - amount, - feeTokenAddress, - }; -}; - -const transferTokens = async () => { - const { - sourceChain, - destinationChain, - destinationAccount, - tokenAddress, - amount, - feeTokenAddress, - } = handleArguments(); - - /* - ================================================== - Section: INITIALIZATION - This section initializes providers and - retrieves necessary configurations. - ================================================== - */ - - // Get the RPC URL for the chain from the config - const rpcUrl = getProviderRpcUrl(sourceChain); - // Fetch the signer's private key - const privateKey = getPrivateKey(); - // Initialize a provider using the obtained RPC URL - const provider = new ethers.JsonRpcProvider(rpcUrl); - const wallet = new ethers.Wallet(privateKey); - const signer = wallet.connect(provider); - - // Get the router's address and chain selectors - const { router, chainSelector: sourceChainSelector } = - getRouterConfig(sourceChain); - const sourceRouterAddress = router.address; - const { chainSelector: destinationChainSelector } = - getRouterConfig(destinationChain); - - // Create a contract instance for the router using its ABI and address - const sourceRouter = new ethers.Contract( - sourceRouterAddress, - routerAbi, - signer - ); - - // Default number of confirmation blocks to wait for - const DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS = 2; - - /* - ================================================== - Section: Check if lane is supported - ================================================== - */ - - // Check if the destination chain is supported - const isChainSupported = await sourceRouter.isChainSupported( - destinationChainSelector - ); - - if (!isChainSupported) { - throw new Error( - `Lane ${sourceChain} -> ${destinationChain} is not supported` - ); - } - - /* - ================================================== - Section: Check token validity - Check if the token you would like to transfer - is supported. - ================================================== - */ - - // Check if TokenAdminRegistry is present for the source chain - const tokenAdminRegistryConfig = getTokenAdminRegistryConfig(sourceChain); - - if (!tokenAdminRegistryConfig) { - // TokenAdminRegistry not present, proceed as before - // Fetch the list of supported tokens - const supportedTokens = await sourceRouter.getSupportedTokens( - destinationChainSelector - ); - - if (!supportedTokens.includes(tokenAddress)) { - throw new Error( - `Token address ${tokenAddress} not in the list of supported tokens ${supportedTokens}` - ); - } - } else { - // TokenAdminRegistry is present, use getPool to check if token is supported - const tokenAdminRegistryAddress = tokenAdminRegistryConfig.address; - const tokenAdminRegistry = new ethers.Contract( - tokenAdminRegistryAddress, - tokenAdminRegistryAbi, - provider - ); - - const poolAddress = await tokenAdminRegistry.getPool(tokenAddress); - - if (poolAddress === ethers.AddressZero) { - throw new Error( - `Token address ${tokenAddress} is not supported (no pool found)` - ); - } - } - - /* - ================================================== - Section: BUILD CCIP MESSAGE - Build the CCIP message that you will send to the - Router contract. - ================================================== - */ - - // Build message - const tokenAmounts = [ - { - token: tokenAddress, - amount: amount, - }, - ]; - - // Encoding the data - - const functionSelector = ethers.id("CCIP EVMExtraArgsV2").slice(0, 10); - // "extraArgs" is a structure that can be represented as ['uint256', 'bool'] - // ExtraArgs are { gasLimit: 0, allowOutOfOrderExecution: true } - // We set gasLimit specifically to 0 because we are not sending any data - - const defaultAbiCoder = ethers.AbiCoder.defaultAbiCoder(); - const extraArgs = defaultAbiCoder.encode(["uint256", "bool"], [0, true]); - - const encodedExtraArgs = functionSelector + extraArgs.slice(2); - - const message = { - receiver: defaultAbiCoder.encode(["address"], [destinationAccount]), - data: "0x", // No data - tokenAmounts: tokenAmounts, - feeToken: feeTokenAddress ? feeTokenAddress : ethers.constants.AddressZero, // If fee token address is provided, fees must be paid in fee token - extraArgs: encodedExtraArgs, - }; - - /* - ================================================== - Section: CALCULATE THE FEES - Call the Router to estimate the fees for sending tokens. - ================================================== - */ - - const fees = await sourceRouter.getFee(destinationChainSelector, message); - if (!feeTokenAddress) { - console.log(`Estimated fees (native): ${fees}\n`); - } else { - const erc20 = new ethers.Contract(feeTokenAddress, erc20Abi, provider); - const symbol = await erc20.symbol(); - const decimals = await erc20.decimals(); - const feesFormatted = ethers.formatUnits(fees, decimals); - - console.log(`Estimated fees (${symbol}): ${feesFormatted}\n`); - } - - /* - ================================================== - Section: SEND TOKENS - This code block handles token approvals and - sending tokens across chains. - ================================================== - */ - - // Create a contract instance for the token using its ABI and address - const erc20 = new ethers.Contract(tokenAddress, erc20Abi, signer); - let sendTx, approvalTx; - - if (!feeTokenAddress) { - // Pay with native token - // First approve the router to spend tokens - console.log( - `Approving router ${sourceRouterAddress} to spend ${amount} of token ${tokenAddress}\n` - ); - approvalTx = await erc20.approve(sourceRouterAddress, amount); - await approvalTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - console.log(`Approval done. Transaction: ${approvalTx.hash}\n`); - - console.log( - `Calling the router to send ${amount} of token ${tokenAddress} to account ${destinationAccount} on destination chain ${destinationChain} using CCIP\n` - ); - sendTx = await sourceRouter.ccipSend(destinationChainSelector, message, { - value: fees, - }); // Fees are sent as value since we are paying the fees in native currency - } else { - if (tokenAddress === feeTokenAddress) { - // Fee token is the same as the token to transfer - // Amount of tokens to approve is transfer amount + fees - console.log( - `Approving router ${sourceRouterAddress} to spend ${amount} and fees ${fees} of token ${tokenAddress}\n` - ); - approvalTx = await erc20.approve(sourceRouterAddress, amount + fees); - await approvalTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - console.log(`Approval done. Transaction: ${approvalTx.hash}\n`); - } else { - // Fee token is different from the token to transfer - // Need two approvals - console.log( - `Approving router ${sourceRouterAddress} to spend ${amount} of token ${tokenAddress}\n` - ); - approvalTx = await erc20.approve(sourceRouterAddress, amount); // Approval for the tokens to transfer - await approvalTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - console.log(`Approval done. Transaction: ${approvalTx.hash}\n`); - - const erc20Fees = new ethers.Contract(feeTokenAddress, erc20Abi, signer); - console.log( - `Approving router ${sourceRouterAddress} to spend fees ${fees} of fee token ${feeTokenAddress}\n` - ); - approvalTx = await erc20Fees.approve(sourceRouterAddress, fees); // Approval for the fee token - await approvalTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - console.log(`Approval done. Transaction: ${approvalTx.hash}\n`); - } - - console.log( - `Calling the router to send ${amount} of token ${tokenAddress} to account ${destinationAccount} on destination chain ${destinationChain} using CCIP\n` - ); - sendTx = await sourceRouter.ccipSend(destinationChainSelector, message); // Fees are part of the message - } - - const receipt = await sendTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - - /* - ================================================== - Section: Fetch message ID - Simulate a call to the router to fetch the message ID. - ================================================== - */ - - // Prepare a transaction request to simulate - const call = { - from: sendTx.from, - to: sendTx.to, - data: sendTx.data, - gasLimit: sendTx.gasLimit, - gasPrice: sendTx.gasPrice, - value: sendTx.value, - blockTag: receipt.blockNumber - 1, // Simulate a contract call with the transaction data at the block before the transaction - }; - - const messageId = await provider.call(call); - - console.log( - `\n✅ ${amount} of Tokens(${tokenAddress}) sent to account ${destinationAccount} on destination chain ${destinationChain} using CCIP. Transaction hash ${sendTx.hash} - Message ID is ${messageId}\n` - ); - - /* - ================================================== - Section: Check status of the destination chain - Poll the off-ramps contracts of the destination chain - to wait for the message to be executed then return - the status. - ================================================== - */ - - // Fetch status on destination chain - const destinationRpcUrl = getProviderRpcUrl(destinationChain); - - // Initialize providers for interacting with the blockchains - const destinationProvider = new ethers.JsonRpcProvider(destinationRpcUrl); - const { router: destinationRouter } = getRouterConfig(destinationChain); - const destinationRouterAddress = destinationRouter.address; - - // Instantiate the router contract on the destination chain - const destinationRouterContract = new ethers.Contract( - destinationRouterAddress, - routerAbi, - destinationProvider - ); - - // Get the current block number on the destination chain. This will be used to reduce the number of blocks to poll - const currentBlockNumber = await destinationProvider.getBlockNumber(); - - // Polling for message execution status - - const POLLING_INTERVAL = 60000; // Poll every 60 seconds - const TIMEOUT = 40 * 60 * 1000; // 40 minutes in milliseconds - - let pollingId; - let timeoutId; - - const pollStatus = async () => { - // Fetch the OffRamp contract addresses on the destination chain - const offRamps = await destinationRouterContract.getOffRamps(); - - // Iterate through OffRamps to find the one linked to the source chain and check message status - for (const offRamp of offRamps) { - if ( - offRamp.sourceChainSelector.toString() === - sourceChainSelector.toString() - ) { - const offRampContract = new ethers.Contract( - offRamp.offRamp, - offRampAbi, - destinationProvider - ); - - const executionStateChangeEvent = - offRampContract.filters.ExecutionStateChanged(undefined, messageId); - - const events = await offRampContract.queryFilter( - executionStateChangeEvent, - currentBlockNumber - ); - - // Check if an event with the specific messageId exists and log its status - for (let event of events) { - if (event.args && event.args.messageId === messageId) { - const state = event.args.state; - const status = getMessageStatus(state); - console.log( - `\n✅ Status of message ${messageId} is ${status} - Check the explorer https://ccip.chain.link/msg/${messageId}` - ); - - // Clear the polling and the timeout - clearInterval(pollingId); - clearTimeout(timeoutId); - return; - } - } - } - } - // If no event found, the message has not yet been processed on the destination chain - console.log( - `Message ${messageId} has not been processed yet on the destination chain. Trying again in 60 seconds - Check the explorer https://ccip.chain.link/msg/${messageId}` - ); - }; - - // Start polling - console.log( - `Waiting for message ${messageId} to be executed on the destination chain - Check the explorer https://ccip.chain.link/msg/${messageId}\n` - ); - pollingId = setInterval(pollStatus, POLLING_INTERVAL); - - // Set timeout to stop polling after 40 minutes - timeoutId = setTimeout(() => { - console.log( - `Timeout reached. Stopping polling - check again later or check the explorer https://ccip.chain.link/msg/${messageId}\n` - ); - clearInterval(pollingId); - }, TIMEOUT); -}; - -transferTokens().catch((e) => { - console.error(e); - process.exit(1); -}); diff --git a/ccip/offchain/typescript/.gitignore b/ccip/offchain/typescript/.gitignore deleted file mode 100644 index 3ebd731b..00000000 --- a/ccip/offchain/typescript/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules -.env.enc -typechain-types -dist diff --git a/ccip/offchain/typescript/README.md b/ccip/offchain/typescript/README.md deleted file mode 100644 index 2acfd7fd..00000000 --- a/ccip/offchain/typescript/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# CCIP Off-Chain TypeScript - -This repository contains a list of scripts that can be used to interact with the CCIP Off-Chain Router contract. The scripts are written in TypeScript and can be executed using Node.js: - -- [transfer-tokens.js](src/transfer-tokens.ts): Transfer tokens from one blockchain to another. -- [supported-tokens.js](src/supported-tokens.ts): Retrieve the list of supported tokens that can be transferred from one blockchain to another. **Note**: This script is deprecated. A more future proof way will be provided in the future. -- [get-status.js](src/get-status.ts): Retrieve the status of a CCIP transaction. - -## Supported Chains - -The supported blockchains can be found in the [config](../config/) directory: - -- [mainnet.json](../config/mainnet.json) -- [testnet.json](../config/testnet.json) - -## Prerequisites - -- Install the dependencies: - - ```shell - npm install - ``` - -- We use [@chainlink/env-enc](https://www.npmjs.com/package/@chainlink/env-enc) package to encrypt environment variables at rest. Set the password to encrypt and decrypt the environment varilable file `.env.enc`: - - ```shell - npx env-enc set-pw - ``` - -- Set and save the variables that you need: - - ```shell - npx env-enc set - ``` - -You will have to set-up the following variables: - -- `PRIVATE_KEY`: private key of the account that will be used to sign the transactions. -- RPC URLs for the blockchains that you will interact with. In the [config](../config/) directory, the supported chains (for testnet and mainnet) are listed in camel case. Therefore, the RPC URLs environment variable names are derived from the chain name by converting it to upper case, replacing any camel case humps with underscores, and appending `_RPC_URL`. For example, the RPC URL for: - - - `ethereumSepolia` is `ETHEREUM_SEPOLIA_RPC_URL`. - - `avalancheFuji` is `AVALANCHE_FUJI_RPC_URL`. - -## Examples - -### Get the list of supported tokens - -> **Deprecation Notice:** -> This function is **deprecated** and will be deactivated in future versions. We recommend avoiding its use at this time. An alternative method will be provided in an upcoming release. - -In this example, you will interact with the router contract to retrieve the list of supported tokens that can be transferred from your blockchain to a target blockchain. - -```shell -npx ts-node src/supported-tokens.ts sourceBlockchain targetBlockchain -``` - -Example: - -```shell -npx ts-node src/supported-tokens.ts ethereumSepolia avalancheFuji -``` - -### Transfer a token - -In these examples, you will interact with the router contract to transfer a specified amount of tokens from your account to another account on a different blockchain. The source blockchain, target blockchain, target account address, token address, and amount are all provided as command-line arguments. Please note, a validation check is in place to ensure the token address provided is supported. - -#### Pay fees in LINK token - -```shell -npx ts-node src/transfer-tokens.ts sourceBlockchain targetBlockchain targetAccountAddress tokenAddress amount linkTokenAddress -``` - -Example (transfer CCIP-BnM and pay fees in LINK): - -```shell -npx ts-node src/transfer-tokens.ts ethereumSepolia avalancheFuji 0x9d087fC03ae39b088326b67fA3C788236645b717 0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05 100 0x779877A7B0D9E8603169DdbD7836e478b4624789 -``` - -#### Pay fees in native gas - -```shell -npx ts-node src/transfer-tokens.ts sourceBlockchain targetBlockchain targetAccountAddress tokenAddress amount -``` - -Example (transfer CCIP-BnM and pay fees in sepolia ETH): - -```shell -npx ts-node src/transfer-tokens.ts ethereumSepolia avalancheFuji 0x9d087fC03ae39b088326b67fA3C788236645b717 0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05 100 -``` - -#### Pay fees in wrapped native gas - -```shell -npx ts-node src/transfer-tokens.ts sourceBlockchain targetBlockchain targetAccountAddress tokenAddress amount wrappedNativeAddress -``` - -Example (send CCIP-BnM and pay fees in WETH): - -```shell -npx ts-node src/transfer-tokens.ts ethereumSepolia avalancheFuji 0x9d087fC03ae39b088326b67fA3C788236645b717 0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05 100 0x097D90c9d3E0B50Ca60e1ae45F6A81010f9FB534 -``` diff --git a/ccip/offchain/typescript/package-lock.json b/ccip/offchain/typescript/package-lock.json deleted file mode 100644 index 94b2c82a..00000000 --- a/ccip/offchain/typescript/package-lock.json +++ /dev/null @@ -1,1076 +0,0 @@ -{ - "name": "typescript", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "typescript", - "version": "1.0.0", - "hasInstallScript": true, - "license": "ISC", - "dependencies": { - "@chainlink/env-enc": "^1.0.5", - "ethers": "^6.11.1", - "lodash": "^4.17.21" - }, - "devDependencies": { - "@typechain/ethers-v6": "^0.5.1", - "@types/lodash": "^4.14.202", - "@types/node": "^20.11.25", - "ts-node": "^10.9.2", - "typescript": "^5.4.2" - } - }, - "node_modules/@adraffy/ens-normalize": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", - "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" - }, - "node_modules/@chainlink/env-enc": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@chainlink/env-enc/-/env-enc-1.0.5.tgz", - "integrity": "sha512-hT7W+tEq/kzkf/yn9sIBsMDcpvbuoPk0JPVGfgygfPJxfS3YUyeen6CdEwJ9o+A7GTWxz/ZnPolpUveX3BUCBQ==", - "dependencies": { - "yargs": "^17.7.1" - }, - "bin": { - "env-enc": "dist/cli.js" - } - }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" - } - }, - "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", - "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true - }, - "node_modules/@typechain/ethers-v6": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@typechain/ethers-v6/-/ethers-v6-0.5.1.tgz", - "integrity": "sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA==", - "dev": true, - "dependencies": { - "lodash": "^4.17.15", - "ts-essentials": "^7.0.1" - }, - "peerDependencies": { - "ethers": "6.x", - "typechain": "^8.3.2", - "typescript": ">=4.7.0" - } - }, - "node_modules/@types/lodash": { - "version": "4.14.202", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", - "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", - "dev": true - }, - "node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/@types/prettier": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", - "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", - "dev": true, - "peer": true - }, - "node_modules/acorn": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", - "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", - "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/aes-js": { - "version": "4.0.0-beta.5", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true, - "peer": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/command-line-args": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", - "dev": true, - "peer": true, - "dependencies": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-usage": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", - "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", - "dev": true, - "peer": true, - "dependencies": { - "array-back": "^4.0.2", - "chalk": "^2.4.2", - "table-layout": "^1.0.2", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/command-line-usage/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "peer": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/command-line-usage/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "peer": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "peer": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/command-line-usage/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, - "peer": true - }, - "node_modules/command-line-usage/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, - "peer": true - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "peer": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/ethers": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.11.1.tgz", - "integrity": "sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@adraffy/ens-normalize": "1.10.1", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@types/node": "18.15.13", - "aes-js": "4.0.0-beta.5", - "tslib": "2.4.0", - "ws": "8.5.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/ethers/node_modules/@types/node": { - "version": "18.15.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" - }, - "node_modules/find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "dev": true, - "peer": true, - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", - "dev": true, - "peer": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "peer": true - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "dev": true, - "peer": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "peer": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "peer": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "peer": true - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", - "dev": true, - "peer": true - }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "peer": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", - "dev": true, - "peer": true - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "peer": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "peer": true - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "peer": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "dev": true, - "peer": true, - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/reduce-flatten": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", - "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string-format": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz", - "integrity": "sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==", - "dev": true, - "peer": true - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "peer": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/table-layout": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", - "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", - "dev": true, - "peer": true, - "dependencies": { - "array-back": "^4.0.1", - "deep-extend": "~0.6.0", - "typical": "^5.2.0", - "wordwrapjs": "^4.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/table-layout/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/table-layout/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ts-command-line-args": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", - "integrity": "sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==", - "dev": true, - "peer": true, - "dependencies": { - "chalk": "^4.1.0", - "command-line-args": "^5.1.1", - "command-line-usage": "^6.1.0", - "string-format": "^2.0.0" - }, - "bin": { - "write-markdown": "dist/write-markdown.js" - } - }, - "node_modules/ts-essentials": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", - "integrity": "sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==", - "dev": true, - "peerDependencies": { - "typescript": ">=3.7.0" - } - }, - "node_modules/ts-node": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", - "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" - }, - "node_modules/typechain": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", - "integrity": "sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==", - "dev": true, - "peer": true, - "dependencies": { - "@types/prettier": "^2.1.1", - "debug": "^4.3.1", - "fs-extra": "^7.0.0", - "glob": "7.1.7", - "js-sha3": "^0.8.0", - "lodash": "^4.17.15", - "mkdirp": "^1.0.4", - "prettier": "^2.3.1", - "ts-command-line-args": "^2.2.0", - "ts-essentials": "^7.0.1" - }, - "bin": { - "typechain": "dist/cli/cli.js" - }, - "peerDependencies": { - "typescript": ">=4.3.0" - } - }, - "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/typical": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true - }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "node_modules/wordwrapjs": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", - "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", - "dev": true, - "peer": true, - "dependencies": { - "reduce-flatten": "^2.0.0", - "typical": "^5.2.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/wordwrapjs/node_modules/typical": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", - "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true, - "peer": true - }, - "node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - } - } -} diff --git a/ccip/offchain/typescript/package.json b/ccip/offchain/typescript/package.json deleted file mode 100644 index cd65582d..00000000 --- a/ccip/offchain/typescript/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "typescript", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "generate-types": "typechain --target ethers-v6 --out-dir src/typechain-types '../abi/*.json'", - "postinstall": "echo 'generate typechain types' && npm run generate-types" - }, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "@typechain/ethers-v6": "^0.5.1", - "@types/lodash": "^4.14.202", - "@types/node": "^20.11.25", - "ts-node": "^10.9.2", - "typescript": "^5.4.2" - }, - "dependencies": { - "@chainlink/env-enc": "^1.0.5", - "ethers": "^6.11.1", - "lodash": "^4.17.21" - } -} diff --git a/ccip/offchain/typescript/src/config/ccip.ts b/ccip/offchain/typescript/src/config/ccip.ts deleted file mode 100644 index 62d729c9..00000000 --- a/ccip/offchain/typescript/src/config/ccip.ts +++ /dev/null @@ -1,104 +0,0 @@ -// Import the JSON configuration files -import mainnetConfig from "../../../config/mainnet.json"; -import testnetConfig from "../../../config/testnet.json"; - -type MainnetNetworks = keyof typeof mainnetConfig; -type TestnetNetworks = keyof typeof testnetConfig; - -type NETWORK = MainnetNetworks | TestnetNetworks; - -// Define the interface for the network configuration -interface NetworkConfig { - chainSelector: string; - router: { - address: string; - version: string; - }; - armProxy: { - address: string; - version: string; - }; - registryModule: { - address: string; - version: string; - }; - tokenAdminRegistry: { - address: string; - version: string; - }; - feeTokens: string[]; -} - -// Merge the configurations using the spread operator -const mergedNetworks: Record = { - ...mainnetConfig, - ...testnetConfig, -}; - -// Get the list of supported networks -const supportedNetworks = Object.keys(mergedNetworks) as NETWORK[]; - -// Function to get router configuration -const getRouterConfig = (network: NETWORK) => { - const config = mergedNetworks[network]; - if (!config) { - throw new Error("No config found for network: " + network); - } - - return { - router: config.router, - chainSelector: BigInt(config.chainSelector), - }; -}; - -// Function to get registry module configuration -const getRegistryModuleConfig = (network: NETWORK) => { - const config = mergedNetworks[network]; - if (!config) { - throw new Error("No config found for network: " + network); - } - - return config.registryModule; -}; - -// Function to get token admin registry configuration -const getTokenAdminRegistryConfig = (network: NETWORK) => { - const config = mergedNetworks[network]; - if (!config) { - throw new Error("No config found for network: " + network); - } - - return config.tokenAdminRegistry; -}; - -// Function to get ARM proxy configuration -const getArmProxyConfig = (network: NETWORK) => { - const config = mergedNetworks[network]; - if (!config) { - throw new Error("No config found for network: " + network); - } - - return config.armProxy; -}; - -// Function to get fee tokens for a network -const getFeeTokens = (network: NETWORK) => { - const config = mergedNetworks[network]; - if (!config || !config.feeTokens) { - throw new Error("No fee tokens found for network: " + network); - } - - return config.feeTokens; -}; - -// Export the types and functions -export { - NETWORK, - NetworkConfig, - supportedNetworks, - getRouterConfig, - getRegistryModuleConfig, - getTokenAdminRegistryConfig, - getArmProxyConfig, - getFeeTokens, -}; diff --git a/ccip/offchain/typescript/src/config/env.ts b/ccip/offchain/typescript/src/config/env.ts deleted file mode 100644 index 5c2dd9f8..00000000 --- a/ccip/offchain/typescript/src/config/env.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { NETWORK, supportedNetworks } from "."; - -const getRpcUrlName = (network: NETWORK) => - network.replace(/([A-Z])/g, "_$1").toUpperCase() + "_RPC_URL"; - -const getProviderRpcUrl = (network: NETWORK) => { - require("@chainlink/env-enc").config(); - if (!supportedNetworks.includes(network)) - throw new Error(`[ERROR] Network '${network}' is not supported. Supported networks: ${supportedNetworks.join(", ")}`); - - const environmentVariableName = getRpcUrlName(network); - const rpcUrl = process.env[environmentVariableName]; - - if (!rpcUrl) - throw new Error( - `[ERROR] RPC URL not found for network '${network}'. Please set ${environmentVariableName} in your environment variables` - ); - return rpcUrl; -}; - -const getPrivateKey = () => { - require("@chainlink/env-enc").config(); - const privateKey = process.env.PRIVATE_KEY; - if (!privateKey) - throw new Error( - `[ERROR] PRIVATE_KEY not found in environment variables. Please set PRIVATE_KEY using chainlink env-enc` - ); - return privateKey; -}; - -export { getPrivateKey, getProviderRpcUrl }; diff --git a/ccip/offchain/typescript/src/config/index.ts b/ccip/offchain/typescript/src/config/index.ts deleted file mode 100644 index 415e5376..00000000 --- a/ccip/offchain/typescript/src/config/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -export * from "./env"; -export * from "./ccip"; -export * from "./offramp"; - -// override console.log to disable ethersjs warning when there are duplicates in ABI - -const oldLog = console.log; - -const log = (...args: any[]) => { - const msg = args.length > 0 ? args[0] : ""; - - if (/Duplicate definition of/.test(msg)) { - return; - } - - oldLog(...args); // This will pass all the arguments to the original console.log function -}; - -console.log = log; diff --git a/ccip/offchain/typescript/src/config/offramp.ts b/ccip/offchain/typescript/src/config/offramp.ts deleted file mode 100644 index 37527c49..00000000 --- a/ccip/offchain/typescript/src/config/offramp.ts +++ /dev/null @@ -1,11 +0,0 @@ -import messageExecutionState from "../../../config/messageState.json"; - -const getMessageStatus = (status: bigint): string => { - const statusKey = status.toString() as keyof typeof messageExecutionState; - if (statusKey in messageExecutionState) { - return messageExecutionState[statusKey]; - } - return "unknown"; -}; - -export { getMessageStatus }; diff --git a/ccip/offchain/typescript/src/get-status.ts b/ccip/offchain/typescript/src/get-status.ts deleted file mode 100644 index f9e7dd9d..00000000 --- a/ccip/offchain/typescript/src/get-status.ts +++ /dev/null @@ -1,133 +0,0 @@ -import { - getProviderRpcUrl, - getRouterConfig, - getMessageStatus, - NETWORK, -} from "./config"; -import { JsonRpcProvider } from "ethers"; -import { Router__factory, OffRamp__factory } from "./typechain-types"; -import { match } from "assert"; - -// Command: npx ts-node src/get-status.ts sourceChain destinationChain messageId -// Examples (sepolia --> Fuji): -// npx ts-node src/get-status.ts ethereumSepolia avalancheFuji 0x6adcad3b71f62c7fcd45b3145d8d5aebfeb4a7ffacf567c09e5ce509120e8a8d - -interface Arguments { - sourceChain: NETWORK; - destinationChain: NETWORK; - messageId: string; -} - -const handleArguments = (): Arguments => { - // Check if the correct number of arguments are passed - if (process.argv.length !== 5) { - throw new Error( - "Wrong number of arguments. Expected format: npx ts-node src/get-status.ts " - ); - } - - // Extract the arguments from the command line - const sourceChain = process.argv[2] as NETWORK; - const destinationChain = process.argv[3] as NETWORK; - const messageId = process.argv[4]; - - // Return the arguments in an object - return { - sourceChain, - destinationChain, - messageId, - }; -}; - -// Main function to get the status of a message by its ID -const getStatus = async () => { - // Parse command-line arguments - const { sourceChain, destinationChain, messageId } = handleArguments(); - - // Get the RPC URLs for both the source and destination chains - const destinationRpcUrl = getProviderRpcUrl(destinationChain); - const sourceRpcUrl = getProviderRpcUrl(sourceChain); - - // Initialize providers for interacting with the blockchains - const destinationProvider = new JsonRpcProvider(destinationRpcUrl); - const sourceProvider = new JsonRpcProvider(sourceRpcUrl); - - // Retrieve router configuration for the source and destination chains - const sourceRouterConfig = getRouterConfig(sourceChain); - const destinationRouterConfig = getRouterConfig(destinationChain); - - const sourceRouterAddress = sourceRouterConfig.router.address; - const sourceChainSelector = sourceRouterConfig.chainSelector; - const destinationRouterAddress = destinationRouterConfig.router.address; - const destinationChainSelector = destinationRouterConfig.chainSelector; - - // Instantiate the router contract on the source chain - const sourceRouterContract = Router__factory.connect( - sourceRouterAddress, - sourceProvider - ); - - const isChainSupported = await sourceRouterContract.isChainSupported( - destinationChainSelector - ); - - if (!isChainSupported) { - throw new Error( - `Lane ${sourceChain} -> ${destinationChain} is not supported\n` - ); - } - - // Instantiate the router contract on the destination chain - const destinationRouterContract = Router__factory.connect( - destinationRouterAddress, - destinationProvider - ); - - // Fetch the OffRamp contract addresses on the destination chain - const offRamps = await destinationRouterContract.getOffRamps(); - - // Correctly compare the chain selectors (convert to strings) - const matchingOffRamps = offRamps.filter( - (offRamp) => - offRamp.sourceChainSelector.toString() === sourceChainSelector.toString() - ); - - // Initialize a flag to check if the message was found - let messageFound = false; - - // Loop through all matching OffRamps - for (const matchingOffRamp of matchingOffRamps) { - const offRampContract = OffRamp__factory.connect( - matchingOffRamp.offRamp, - destinationProvider - ); - - // Fetch events with the specific messageId - const events = await offRampContract.queryFilter( - offRampContract.filters.ExecutionStateChanged(undefined, messageId) - ); - - if (events.length > 0) { - const { state } = events[0].args; - const status = getMessageStatus(state); - console.log( - `Status of message ${messageId} on offRamp ${matchingOffRamp.offRamp} is ${status}\n` - ); - messageFound = true; - break; // Exit the loop since we've found the message - } - } - - // If no event found in any OffRamp - if (!messageFound) { - console.log( - `Either the message ${messageId} does not exist OR it has not been processed yet on the destination chain\n` - ); - } -}; - -// Run the getStatus function and handle any errors -getStatus().catch((e) => { - console.error(e); - process.exit(1); -}); diff --git a/ccip/offchain/typescript/src/supported-tokens.ts b/ccip/offchain/typescript/src/supported-tokens.ts deleted file mode 100644 index 464e29a2..00000000 --- a/ccip/offchain/typescript/src/supported-tokens.ts +++ /dev/null @@ -1,203 +0,0 @@ -import { - getProviderRpcUrl, - getRouterConfig, - NETWORK, - getTokenAdminRegistryConfig, -} from "./config"; -import { JsonRpcProvider } from "ethers"; -import { - Router__factory, - IERC20Metadata__factory, - TokenAdminRegistry__factory, - TokenPool__factory, -} from "./typechain-types"; - -// Interface for command-line arguments -interface Arguments { - sourceChain: NETWORK; - destinationChain: NETWORK; -} - -// Function to handle command-line arguments -const handleArguments = (): Arguments => { - // Check if the correct number of arguments have been passed - if (process.argv.length !== 4) { - throw new Error( - "Expects 2 arguments. Expected format: npx ts-node src/supported-tokens.ts " - ); - } - - // Retrieve the chain names from command line arguments - const sourceChain = process.argv[2] as NETWORK; - const destinationChain = process.argv[3] as NETWORK; - - return { sourceChain, destinationChain }; -}; - -// Function to fetch and display supported tokens -const getSupportedTokens = async () => { - console.log(`[INFO] Starting token discovery for cross-chain transfers`); - const { sourceChain, destinationChain } = handleArguments(); - - // Get the RPC URL for the chain from the config - const rpcUrl = getProviderRpcUrl(sourceChain); - // Initialize a provider using the obtained RPC URL - const provider = new JsonRpcProvider(rpcUrl); - - // Get the router's address for the specified chain - const routerAddress = getRouterConfig(sourceChain).router.address; - // Get the chain selector for the target chain - const destinationChainSelector = - getRouterConfig(destinationChain).chainSelector; - - // Create a contract instance for the router using its ABI and address - const sourceRouterContract = Router__factory.connect(routerAddress, provider); - - // Check if the destination chain is supported - const isChainSupported = await sourceRouterContract.isChainSupported( - destinationChainSelector - ); - - if (!isChainSupported) { - console.error( - `[ERROR] Lane ${sourceChain} -> ${destinationChain} is not supported` - ); - throw new Error( - `Lane ${sourceChain} -> ${destinationChain} is not supported\n` - ); - } - console.log(`[INFO] Lane ${sourceChain} -> ${destinationChain} is supported`); - - // Check if TokenAdminRegistry is present for the source chain - const tokenAdminRegistryConfig = getTokenAdminRegistryConfig(sourceChain); - - // TokenAdminRegistry is present, use getAllConfiguredTokens - const tokenAdminRegistryAddress = tokenAdminRegistryConfig.address; - const tokenAdminRegistryContract = TokenAdminRegistry__factory.connect( - tokenAdminRegistryAddress, - provider - ); - - // Handle pagination - let startIndex = 0; - const maxCount = 100; - let tokensBatch: string[] = []; - const tokenToPoolMap: Record = {}; // Mapping of token to pool - const uniqueTokens = new Set(); // Use Set to handle potential duplicates - - console.log( - `[INFO] Fetching all registered tokens from ${sourceChain} using TokenAdminRegistry at ${tokenAdminRegistryAddress}` - ); - - let totalProcessed = 0; - do { - console.log( - `[INFO] Fetching batch: offset=${startIndex}, limit=${maxCount}` - ); - tokensBatch = await tokenAdminRegistryContract.getAllConfiguredTokens( - startIndex, - maxCount - ); - totalProcessed += tokensBatch.length; - console.log( - `[INFO] Found ${tokensBatch.length} tokens (total processed: ${totalProcessed})` - ); - - // Add to Set instead of array to handle potential duplicates - tokensBatch.forEach((token) => uniqueTokens.add(token)); - startIndex = startIndex + tokensBatch.length; - - // Add log before pool checks - console.log( - `[INFO] Fetching pools for ${tokensBatch.length} tokens and checking support for ${destinationChain}` - ); - const pools = await tokenAdminRegistryContract.getPools([...tokensBatch]); - - // Process pools in chunks of 5 for parallel processing - for (let i = 0; i < tokensBatch.length; i += 5) { - const chunkEnd = Math.min(i + 5, tokensBatch.length); - const chunk = tokensBatch.slice(i, chunkEnd); - const poolsChunk = pools.slice(i, chunkEnd); - - const supportCheckPromises = poolsChunk.map((poolAddress, index) => { - const tokenPoolContract = TokenPool__factory.connect( - poolAddress, - provider - ); - return tokenPoolContract - .isSupportedChain(destinationChainSelector) - .then((isSupported) => ({ - token: chunk[index], - pool: poolAddress, - isSupported, - error: null, - })) - .catch((error) => ({ - token: chunk[index], - pool: poolAddress, - isSupported: false, - error, - })); - }); - - const results = await Promise.all(supportCheckPromises); - - // Process results - results.forEach(({ token, pool, isSupported, error }) => { - if (error) { - console.warn( - `Failed to check chain support for pool ${pool}, skipping...` - ); - } else if (isSupported) { - tokenToPoolMap[token] = pool; - } - }); - } - } while (tokensBatch.length === maxCount); - - const eligibleTokens = Object.keys(tokenToPoolMap).length; - console.log( - `[SUMMARY] Found ${uniqueTokens.size} unique tokens, ${eligibleTokens} support ${destinationChain}` - ); - - // Convert Set to Array for final processing - const supportedTokens = Array.from(uniqueTokens); - - // For each supported token, print its name, symbol, decimal precision, and pool - for (const supportedToken of supportedTokens) { - // Skip tokens whose pools don't support the destination chain - if (!tokenToPoolMap[supportedToken]) { - continue; - } - - // Create a contract instance for the token using its ABI and address - const erc20 = IERC20Metadata__factory.connect(supportedToken, provider); - - // Fetch the token's name, symbol, and decimal precision - const [name, symbol, decimals] = await Promise.all([ - erc20.name(), - erc20.symbol(), - erc20.decimals(), - ]); - - // Get the pool address for the token - const poolAddress = tokenToPoolMap[supportedToken]; - - // Print the token's details along with its pool - console.log( - `[INFO] Token: ${name} (${symbol}) at ${supportedToken}, decimals=${decimals}, pool=${poolAddress}` - ); - } -}; - -// Improve error handling -getSupportedTokens().catch((e) => { - console.error(`[ERROR] Token discovery failed:`); - if (e instanceof Error) { - console.error(`[ERROR] Message: ${e.message}`); - console.error(`[ERROR] Stack: ${e.stack}`); - } else { - console.error(`[ERROR] Unknown error type:`, e); - } - process.exit(1); -}); diff --git a/ccip/offchain/typescript/src/transfer-tokens.ts b/ccip/offchain/typescript/src/transfer-tokens.ts deleted file mode 100644 index 63221eb8..00000000 --- a/ccip/offchain/typescript/src/transfer-tokens.ts +++ /dev/null @@ -1,335 +0,0 @@ -import { - getProviderRpcUrl, - getRouterConfig, - getPrivateKey, - getMessageStatus, - getTokenAdminRegistryConfig, - NETWORK, -} from "./config"; -import { ethers, JsonRpcProvider } from "ethers"; -import { - Router__factory, - OffRamp__factory, - IERC20Metadata__factory, - TokenAdminRegistry__factory, -} from "./typechain-types"; -import { Client } from "./typechain-types/Router"; - -// Command: npx ts-node src/transfer-tokens.ts sourceChain destinationChain destinationAccount tokenAddress amount feeTokenAddress(optional) -// Example: npx ts-node src/transfer-tokens.ts ethereumSepolia avalancheFuji 0x9d087fC03ae39b088326b67fA3C788236645b717 0xFd57b4ddBf88a4e07fF4e34C487b99af2Fe82a05 100 - -interface Arguments { - sourceChain: NETWORK; - destinationChain: NETWORK; - destinationAccount: string; - tokenAddress: string; - amount: bigint; - feeTokenAddress?: string; -} - -const handleArguments = (): Arguments => { - if (process.argv.length !== 7 && process.argv.length !== 8) { - throw new Error( - "Wrong number of arguments. Expected format: npx ts-node src/transfer-tokens.ts [feeTokenAddress]" - ); - } - - const sourceChain = process.argv[2] as NETWORK; - const destinationChain = process.argv[3] as NETWORK; - const destinationAccount: string = ethers.getAddress(process.argv[4]); - const tokenAddress: string = ethers.getAddress(process.argv[5]); - const amount: bigint = BigInt(process.argv[6]); - const feeTokenAddress: string | undefined = - process.argv[7] && ethers.getAddress(process.argv[7]); - - return { - sourceChain, - destinationChain, - destinationAccount, - tokenAddress, - amount, - feeTokenAddress, - }; -}; - -const transferTokens = async () => { - const { - sourceChain, - destinationChain, - destinationAccount, - tokenAddress, - amount, - feeTokenAddress, - } = handleArguments(); - - // Get the RPC URL for the chain from the config - const rpcUrl = getProviderRpcUrl(sourceChain); - // Fetch the signer's private key - const privateKey = getPrivateKey(); - // Initialize a provider using the obtained RPC URL - const provider = new JsonRpcProvider(rpcUrl); - const wallet = new ethers.Wallet(privateKey); - const signer = wallet.connect(provider); - - // Get the router's address for the specified chain - const { router, chainSelector: sourceChainSelector } = - getRouterConfig(sourceChain); - - const sourceRouterAddress = router.address; - - // For the destination chain - const { chainSelector: destinationChainSelector } = - getRouterConfig(destinationChain); - - // Create a contract instance for the router using its ABI and address - const sourceRouter = Router__factory.connect(sourceRouterAddress, signer); - - // Default number of confirmation blocks to wait for - const DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS = 2; - - // Check if the destination chain is supported - const isChainSupported = await sourceRouter.isChainSupported( - destinationChainSelector - ); - - if (!isChainSupported) { - throw new Error( - `Lane ${sourceChain} -> ${destinationChain} is not supported` - ); - } - - // Check if TokenAdminRegistry is present for the source chain - const tokenAdminRegistryConfig = getTokenAdminRegistryConfig(sourceChain); - - if (!tokenAdminRegistryConfig) { - // TokenAdminRegistry not present, proceed as before - const supportedTokens = await sourceRouter.getSupportedTokens( - destinationChainSelector - ); - - if (!supportedTokens.includes(tokenAddress)) { - throw new Error( - `Token address ${tokenAddress} not in the list of supported tokens ${supportedTokens}` - ); - } - } else { - // TokenAdminRegistry is present, use getPool to check if token is supported - const tokenAdminRegistryAddress = tokenAdminRegistryConfig.address; - const tokenAdminRegistry = TokenAdminRegistry__factory.connect( - tokenAdminRegistryAddress, - provider - ); - - const poolAddress = await tokenAdminRegistry.getPool(tokenAddress); - - if (poolAddress === ethers.ZeroAddress) { - throw new Error( - `Token address ${tokenAddress} is not supported (no pool found)` - ); - } - } - - // Build message - const tokenAmounts: Client.EVMTokenAmountStruct[] = [ - { - token: tokenAddress, - amount: amount, - }, - ]; - - // Encoding the data - const functionSelector = ethers.id("CCIP EVMExtraArgsV2").slice(0, 10); - // Extra arguments are encoded as [ 'uint256','bool'] - // ExtraArgs are { gasLimit: 0, allowOutOfOrderExecution: true } - // uint256: Set gasLimit to 0 because we are not sending any data - // bool: allowOutOfOrderExecution is set to true - const defaultAbiCoder = ethers.AbiCoder.defaultAbiCoder(); - const extraArgs = defaultAbiCoder.encode(["uint256", "bool"], [0, true]); - - const encodedExtraArgs = functionSelector + extraArgs.slice(2); - - const message: Client.EVM2AnyMessageStruct = { - receiver: defaultAbiCoder.encode(["address"], [destinationAccount]), - data: "0x", // No data - tokenAmounts: tokenAmounts, - feeToken: feeTokenAddress || ethers.ZeroAddress, // If fee token address is provided, fees must be paid in fee token - extraArgs: encodedExtraArgs, - }; - - const fees = await sourceRouter.getFee(destinationChainSelector, message); - if (!feeTokenAddress) { - console.log(`Estimated fees (native): ${fees}\n`); - } else { - const erc20 = IERC20Metadata__factory.connect(feeTokenAddress, provider); - const symbol = await erc20.symbol(); - const decimals = await erc20.decimals(); - const feesFormatted = ethers.formatUnits(fees, decimals); - - console.log(`Estimated fees (${symbol}): ${feesFormatted}\n`); - } - - // Create a contract instance for the token using its ABI and address - const erc20 = IERC20Metadata__factory.connect(tokenAddress, signer); - let sendTx, approvalTx; - - if (!feeTokenAddress) { - // Pay with native token - // First approve the router to spend tokens - console.log( - `Approving router ${sourceRouterAddress} to spend ${amount} of token ${tokenAddress}\n` - ); - approvalTx = await erc20.approve(sourceRouterAddress, amount); - await approvalTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - console.log(`Approval done. Transaction: ${approvalTx.hash}\n`); - - console.log( - `Calling the router to send ${amount} of token ${tokenAddress} to account ${destinationAccount} on destination chain ${destinationChain} using CCIP\n` - ); - sendTx = await sourceRouter.ccipSend(destinationChainSelector, message, { - value: fees, - }); // Fees are sent as value since we are paying the fees in native currency - } else { - if (tokenAddress === feeTokenAddress) { - // Fee token is the same as the token to transfer - // Amount of tokens to approve is transfer amount + fees - console.log( - `Approving router ${sourceRouterAddress} to spend ${amount} and fees ${fees} of token ${tokenAddress}\n` - ); - approvalTx = await erc20.approve(sourceRouterAddress, amount + fees); - await approvalTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - console.log(`Approval done. Transaction: ${approvalTx.hash}\n`); - } else { - // Fee token is different from the token to transfer - // Need two approvals - console.log( - `Approving router ${sourceRouterAddress} to spend ${amount} of token ${tokenAddress}\n` - ); - approvalTx = await erc20.approve(sourceRouterAddress, amount); // Approval for the tokens to transfer - await approvalTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - console.log(`Approval done. Transaction: ${approvalTx.hash}\n`); - - const erc20Fees = IERC20Metadata__factory.connect( - feeTokenAddress, - signer - ); - console.log( - `Approving router ${sourceRouterAddress} to spend fees ${fees} of fee token ${feeTokenAddress}\n` - ); - approvalTx = await erc20Fees.approve(sourceRouterAddress, fees); // Approval for the fee token - await approvalTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); - console.log(`Approval done. Transaction: ${approvalTx.hash}\n`); - } - - console.log( - `Calling the router to send ${amount} of token ${tokenAddress} to account ${destinationAccount} on destination chain ${destinationChain} using CCIP\n` - ); - sendTx = await sourceRouter.ccipSend(destinationChainSelector, message); // Fees are part of the message - } - - const receipt = await sendTx.wait(DEFAULT_VERIFICATION_BLOCK_CONFIRMATIONS); // Wait for the transaction to be mined - // Simulate a call to the router to fetch the message ID - - if (!receipt) throw new Error("Transaction not mined yet"); - const call = { - from: sendTx.from, - to: sendTx.to, - data: sendTx.data, - gasLimit: sendTx.gasLimit, - gasPrice: sendTx.gasPrice, - value: sendTx.value, - blockTag: receipt.blockNumber - 1, // Simulate a contract call with the transaction data at the block before the transaction - }; - - const messageId = await provider.call(call); - - console.log( - `\n✅ ${amount} of Tokens(${tokenAddress}) sent to account ${destinationAccount} on destination chain ${destinationChain} using CCIP. Transaction hash ${sendTx.hash} - Message ID is ${messageId}\n` - ); - - // Fetch status on destination chain - const destinationRpcUrl = getProviderRpcUrl(destinationChain); - - // Initialize providers for interacting with the blockchains - const destinationProvider = new JsonRpcProvider(destinationRpcUrl); - const destinationRouterAddress = - getRouterConfig(destinationChain).router.address; - - // Instantiate the router contract on the destination chain - const destinationRouterContract = Router__factory.connect( - destinationRouterAddress, - destinationProvider - ); - - // Get the current block number on the destination chain. This will be used to reduce the number of blocks to poll - const currentBlockNumber = await destinationProvider.getBlockNumber(); - - // CHECK DESTINATION CHAIN - POLL UNTIL the message ID is found or timeout - - const POLLING_INTERVAL = 60000; // Poll every 60 seconds - const TIMEOUT = 40 * 60 * 1000; // 40 minutes in milliseconds - - let pollingId: NodeJS.Timeout; - let timeoutId: NodeJS.Timeout; - - const pollStatus = async () => { - // Fetch the OffRamp contract addresses on the destination chain - const offRamps = await destinationRouterContract.getOffRamps(); - - // Iterate through OffRamps to find the one linked to the source chain and check message status - for (const offRamp of offRamps) { - if (offRamp.sourceChainSelector === sourceChainSelector) { - const offRampContract = OffRamp__factory.connect( - offRamp.offRamp, - destinationProvider - ); - - const executionStateChangeEvent = - offRampContract.filters.ExecutionStateChanged(undefined, messageId); - - const events = await offRampContract.queryFilter( - executionStateChangeEvent, - currentBlockNumber - ); - - // Check if an event with the specific messageId exists and log its status - for (let event of events) { - if (event.args && event.args.messageId === messageId) { - const state = event.args.state; - const status = getMessageStatus(state); - console.log( - `\n✅ Status of message ${messageId} is ${status} - Check the explorer https://ccip.chain.link/msg/${messageId}` - ); - - // Clear the polling and the timeout - clearInterval(pollingId); - clearTimeout(timeoutId); - return; - } - } - } - } - // If no event found, the message has not yet been processed on the destination chain - console.log( - `Message ${messageId} has not been processed yet on the destination chain. Trying again in 60 seconds - Check the explorer https://ccip.chain.link/msg/${messageId}` - ); - }; - - // Start polling - console.log( - `Waiting for message ${messageId} to be executed on the destination chain - Check the explorer https://ccip.chain.link/msg/${messageId}\n` - ); - pollingId = setInterval(pollStatus, POLLING_INTERVAL); - - // Set timeout to stop polling after 40 minutes - timeoutId = setTimeout(() => { - console.log( - `Timeout reached. Stopping polling - check again later (Run "get-status" script) or check the explorer https://ccip.chain.link/msg/${messageId}\n` - ); - clearInterval(pollingId); - }, TIMEOUT); -}; - -transferTokens().catch((e) => { - console.error(e); - process.exit(1); -}); diff --git a/ccip/offchain/typescript/tsconfig.json b/ccip/offchain/typescript/tsconfig.json deleted file mode 100644 index b1b1546d..00000000 --- a/ccip/offchain/typescript/tsconfig.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "commonjs" /* Specify what module code is generated. */, - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - "resolveJsonModule": true /* Enable importing .json files. */, - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - // "outDir": "./", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - - /* Type Checking */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -}