Connect Wallet (Ethers.js):
+{connectError}
} + {currentAccount &&{`Address: ${currentAccount}`}
} + {currentChainId && ( + <> +{`Connected to Chain ID: ${currentChainId} (Status: ${connectionStatus})`}
+{switchChainError}
} + > + )} +Approve Transfer
+{txHash}
+ Transfer Tokens
+{txHash}
+ {messageId}
+ Send Message
+{txHash}
+ {messageId}
+ Send Function Data
+Using ERC20 transfer function
+{txHash}
+ {messageId}
+ Get allowance:
+{allowance}
+ Get On-ramp address:
+{onRamp}
+ Get supported fee tokens:
+
+ {supportedFeeTokens.map(address => (
+
+ {address}
+
+ ))}
+
+ Get lane rate refil limits:
+
+
+ {`Tokens: ${rateLimits.tokens.toLocaleString()}`}
+
+
+ {`Last updated: ${new Date(rateLimits.lastUpdated * 1000).toLocaleString()}`}
+
+ {`Is enabled: ${rateLimits.isEnabled.toString()}`}
+ {`Capacity: ${rateLimits.capacity.toLocaleString()}`}
+ {`Rate: ${rateLimits.rate.toLocaleString()}`}
+
+ Get token rate limit by lane:
+
+
+ {`Tokens: ${tokenRateLimits.tokens.toLocaleString()}`}
+
+
+ {`Last updated: ${new Date(tokenRateLimits.lastUpdated * 1000).toLocaleString()}`}
+
+ {`Is enabled: ${tokenRateLimits.isEnabled.toString()}`}
+ {`Capacity: ${tokenRateLimits.capacity.toLocaleString()}`}
+ {`Rate: ${tokenRateLimits.rate.toLocaleString()}`}
+
+ Is token supported:
+{isTokenSupported.toLocaleString()}
+ Token admin registry:
+{tokenAdminRegistry.toLocaleString()}
+ Get transaction receipt:
+ +{`Block Number: ${transactionReceipt.blockNumber.toString()}`}
+{`From: ${transactionReceipt.from}`}
+{`To: ${transactionReceipt.to}`}
+{`Status: ${transactionReceipt.status}`}
+
+
+ {`Block Number: ${transactionReceipt.blockNumber.toString()}`}
+
+ {`From: ${transactionReceipt.from}`}
+ {`To: ${transactionReceipt.to}`}
+ {`Status: ${transactionReceipt.status}`}
+
+ Get fee
+{fee}
+ Get allowance:
@@ -488,14 +489,19 @@ function GetAllowance({ publicClient }: { publicClient: PublicClient }) {{error}
}Get On-ramp address:
@@ -540,13 +548,18 @@ function GetOnRampAddress({ publicClient }: { publicClient: PublicClient }) {{error}
} ); } @@ -566,6 +580,7 @@ function GetSupportedFeeTokens({ publicClient }: { publicClient: PublicClient }) const [routerAddress, setRouterAddress] = useState{error}
} ); } @@ -623,6 +644,7 @@ function GetLaneRateRefillLimits({ publicClient }: { publicClient: PublicClient const [routerAddress, setRouterAddress] = useState{error}
} ); } @@ -685,6 +713,7 @@ function GetTokenRateLimitByLane({ publicClient }: { publicClient: PublicClient const [destinationChainSelector, setDestinationChainSelector] = useState{error}
} ); } @@ -759,6 +794,7 @@ function IsTokenSupported({ publicClient }: { publicClient: PublicClient }) { const [destinationChainSelector, setDestinationChainSelector] = useState{error}
} ); } @@ -821,6 +863,7 @@ function GetTokenAdminRegistry({ publicClient }: { publicClient: PublicClient }) const [destinationChainSelector, setDestinationChainSelector] = useStateToken admin registry:
@@ -854,14 +897,19 @@ function GetTokenAdminRegistry({ publicClient }: { publicClient: PublicClient }){error}
} ); } @@ -880,6 +929,7 @@ function GetTokenAdminRegistry({ publicClient }: { publicClient: PublicClient }) function GetTransactionReceipt({ publicClient }: { publicClient: PublicClient }) { const [hash, setHash] = useState{error}
} ); } @@ -1020,6 +1076,7 @@ function GetFee({ publicClient }: { publicClient: PublicClient }) { const [destinationAccount, setDestinationAccount] = useState{error}
} ); } diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index 9013ba3..31039d6 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -13,9 +13,10 @@ "lint": "next lint" }, "dependencies": { - "@chainlink/ccip-js": "^0.2.1", + "@chainlink/ccip-js": "workspace:^", "@chainlink/ccip-react-components": "^0.3.0", "@tanstack/react-query": "^5.37.1", + "ethers": "6.13.4", "next": "14.2.3", "react": "18", "react-dom": "18", @@ -32,4 +33,4 @@ "postcss": "^8", "tailwindcss": "^3.4.1" } -} +} \ No newline at end of file diff --git a/packages/ccip-js/README.md b/packages/ccip-js/README.md index f591365..e25f532 100644 --- a/packages/ccip-js/README.md +++ b/packages/ccip-js/README.md @@ -118,49 +118,91 @@ const walletClient = createWalletClient({ }) // Approve Router to transfer tokens on user's behalf -const { txHash, txReceipt } = await ccipClient.approveRouter({ - client: walletClient, - routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', - tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', - amount: 1000000000000000000n, - waitForReceipt: true, -}) +async function main() { + const { txHash, txReceipt } = await ccipClient.approveRouter({ + client: walletClient, + routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + amount: 1000000000000000000n, + waitForReceipt: true, + }) -console.log(`Transfer approved. Transaction hash: ${txHash}. Transaction receipt: ${txReceipt}`) + console.log(`Transfer approved. Transaction hash: ${txHash}. Transaction receipt: ${txReceipt}`) // Get fee for the transfer -const fee = await ccipClient.getFee({ - client: publicClient, - routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', - tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', - amount: 1000000000000000000n, - destinationAccount: '0x1234567890abcdef1234567890abcdef12345678', - destinationChainSelector: '1234', -}) + const fee = await ccipClient.getFee({ + client: publicClient, + routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + amount: 1000000000000000000n, + destinationAccount: '0x1234567890abcdef1234567890abcdef12345678', + destinationChainSelector: '1234', + }) -console.log(`Fee: ${fee.toLocaleString()}`) + console.log(`Fee: ${fee.toLocaleString()}`) // Variant 1: Transfer via CCIP using native token fee -const { txHash, messageId } = await client.transferTokens({ - client: walletClient, - routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', - tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', - amount: 1000000000000000000n, - destinationAccount: '0x1234567890abcdef1234567890abcdef12345678', - destinationChainSelector: '1234', -}) + const { txHash, messageId } = await client.transferTokens({ + client: walletClient, + routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + amount: 1000000000000000000n, + destinationAccount: '0x1234567890abcdef1234567890abcdef12345678', + destinationChainSelector: '1234', + }) -console.log(`Transfer success. Transaction hash: ${txHash}. Message ID: ${messageId}`) + console.log(`Transfer success. Transaction hash: ${txHash}. Message ID: ${messageId}`) // Variant 2: Transfer via CCIP using the provided supported token for fee payment -const { txHash, messageId } = await client.transferTokens({ - client: walletClient, - routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', - tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', - amount: 1000000000000000000n, - destinationAccount: '0x1234567890abcdef1234567890abcdef12345678', - destinationChainSelector: '1234', - feeTokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + const { txHash: txHash2, messageId: messageId2 } = await client.transferTokens({ + client: walletClient, + routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + amount: 1000000000000000000n, + destinationAccount: '0x1234567890abcdef1234567890abcdef12345678', + destinationChainSelector: '1234', + feeTokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + }) +} + +main().catch((err) => { + console.error(err) + process.exit(1) +}) +``` + +### Using ethers.js + +You can pass ethers providers/signers by adapting them to Viem clients with the provided helpers. The client methods now accept either Viem clients or ethers Provider/Signer where applicable (e.g. `approveRouter`, `transferTokens`, `sendCCIPMessage`, reads). Avoid hardcoding secrets; load keys from environment variables and wrap usage in an async function. + +```typescript +import 'dotenv/config' +import { ethers } from 'ethers' +import * as CCIP from '@chainlink/ccip-js' +import { mainnet } from 'viem/chains' + +async function main() { + const provider = new ethers.JsonRpcProvider(process.env.RPC_URL!) + const signer = new ethers.Wallet(process.env.PRIVATE_KEY!, provider) + + const walletClient = await CCIP.ethersSignerToWalletClient(signer, mainnet) + const publicClient = CCIP.ethersProviderToPublicClient(provider, mainnet) + + const ccipClient = CCIP.createClient() + + const { txHash } = await ccipClient.approveRouter({ + client: walletClient, + routerAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + tokenAddress: '0xabcdefabcdefabcdefabcdefabcdefabcdefabcdef', + amount: 1000000000000000000n, + }) + + console.log('approve tx hash', txHash) +} + +main().catch((err) => { + console.error(err) + process.exit(1) }) ``` diff --git a/packages/ccip-js/src/abi/BridgeToken.json b/packages/ccip-js/src/abi/BridgeToken.json index 47435c3..332ac44 100644 --- a/packages/ccip-js/src/abi/BridgeToken.json +++ b/packages/ccip-js/src/abi/BridgeToken.json @@ -1,787 +1,787 @@ [ - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "supplyAfterMint", - "type": "uint256" - } - ], - "name": "MaxSupplyExceeded", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SenderNotBurner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "SenderNotMinter", - "type": "error" - }, - { - "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": "burner", - "type": "address" - } - ], - "name": "BurnAccessGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "burner", - "type": "address" - } - ], - "name": "BurnAccessRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "MintAccessGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "MintAccessRevoked", - "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": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "Transfer", - "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": [], - "name": "acceptOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "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": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseApproval", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "drip", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getBurners", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getMinters", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "burner", - "type": "address" - } - ], - "name": "grantBurnRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "burnAndMinter", - "type": "address" - } - ], - "name": "grantMintAndBurnRoles", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "grantMintRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseApproval", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "burner", - "type": "address" - } - ], - "name": "isBurner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "isMinter", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], + { + "inputs": [ + { + "internalType": "string", "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "burner", - "type": "address" - } - ], - "name": "revokeBurnRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "revokeMintRole", - "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": [], + "type": "string" + }, + { + "internalType": "string", "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": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "transferAndCall", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "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" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] \ No newline at end of file + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "supplyAfterMint", + "type": "uint256" + } + ], + "name": "MaxSupplyExceeded", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "SenderNotBurner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "SenderNotMinter", + "type": "error" + }, + { + "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": "burner", + "type": "address" + } + ], + "name": "BurnAccessGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "burner", + "type": "address" + } + ], + "name": "BurnAccessRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MintAccessGranted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "MintAccessRevoked", + "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": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "Transfer", + "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": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "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": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseApproval", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "drip", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getBurners", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMinters", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "burner", + "type": "address" + } + ], + "name": "grantBurnRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "burnAndMinter", + "type": "address" + } + ], + "name": "grantMintAndBurnRoles", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "grantMintRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseApproval", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "burner", + "type": "address" + } + ], + "name": "isBurner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "isMinter", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "burner", + "type": "address" + } + ], + "name": "revokeBurnRole", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "minter", + "type": "address" + } + ], + "name": "revokeMintRole", + "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": [], + "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": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "transferAndCall", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/packages/ccip-js/src/abi/CCIPLocalSimulator.json b/packages/ccip-js/src/abi/CCIPLocalSimulator.json index a6179eb..5b1b212 100644 --- a/packages/ccip-js/src/abi/CCIPLocalSimulator.json +++ b/packages/ccip-js/src/abi/CCIPLocalSimulator.json @@ -1,143 +1,143 @@ [ { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" }, { - "inputs": [], - "name": "CCIPLocalSimulator__MsgSenderIsNotTokenOwner", - "type": "error" + "inputs": [], + "name": "CCIPLocalSimulator__MsgSenderIsNotTokenOwner", + "type": "error" }, { - "inputs": [], - "name": "configuration", - "outputs": [ - { - "internalType": "uint64", - "name": "chainSelector_", - "type": "uint64" - }, - { - "internalType": "contract IRouterClient", - "name": "sourceRouter_", - "type": "address" - }, - { - "internalType": "contract IRouterClient", - "name": "destinationRouter_", - "type": "address" - }, - { - "internalType": "contract WETH9", - "name": "wrappedNative_", - "type": "address" - }, - { - "internalType": "contract LinkToken", - "name": "linkToken_", - "type": "address" - }, - { - "internalType": "contract BurnMintERC677Helper", - "name": "ccipBnM_", - "type": "address" - }, - { - "internalType": "contract BurnMintERC677Helper", - "name": "ccipLnM_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" + "inputs": [], + "name": "configuration", + "outputs": [ + { + "internalType": "uint64", + "name": "chainSelector_", + "type": "uint64" + }, + { + "internalType": "contract IRouterClient", + "name": "sourceRouter_", + "type": "address" + }, + { + "internalType": "contract IRouterClient", + "name": "destinationRouter_", + "type": "address" + }, + { + "internalType": "contract WETH9", + "name": "wrappedNative_", + "type": "address" + }, + { + "internalType": "contract LinkToken", + "name": "linkToken_", + "type": "address" + }, + { + "internalType": "contract BurnMintERC677Helper", + "name": "ccipBnM_", + "type": "address" + }, + { + "internalType": "contract BurnMintERC677Helper", + "name": "ccipLnM_", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" }, { - "inputs": [ - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - } - ], - "name": "getSupportedTokens", - "outputs": [ - { - "internalType": "address[]", - "name": "tokens", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" + "inputs": [ + { + "internalType": "uint64", + "name": "chainSelector", + "type": "uint64" + } + ], + "name": "getSupportedTokens", + "outputs": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" }, { - "inputs": [ - { - "internalType": "uint64", - "name": "chainSelector", - "type": "uint64" - } - ], - "name": "isChainSupported", - "outputs": [ - { - "internalType": "bool", - "name": "supported", - "type": "bool" - } - ], - "stateMutability": "pure", - "type": "function" + "inputs": [ + { + "internalType": "uint64", + "name": "chainSelector", + "type": "uint64" + } + ], + "name": "isChainSupported", + "outputs": [ + { + "internalType": "bool", + "name": "supported", + "type": "bool" + } + ], + "stateMutability": "pure", + "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "requestLinkFromFaucet", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "requestLinkFromFaucet", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } - ], - "name": "supportNewTokenViaGetCCIPAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "supportNewTokenViaGetCCIPAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" }, { - "inputs": [ - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - } - ], - "name": "supportNewTokenViaOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" + "inputs": [ + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + } + ], + "name": "supportNewTokenViaOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } -] \ No newline at end of file +] diff --git a/packages/ccip-js/src/abi/OnRamp_1_6.json b/packages/ccip-js/src/abi/OnRamp_1_6.json index 35c7825..0e0e865 100644 --- a/packages/ccip-js/src/abi/OnRamp_1_6.json +++ b/packages/ccip-js/src/abi/OnRamp_1_6.json @@ -1,1028 +1,1028 @@ [ - { - "type": "constructor", - "inputs": [ - { - "name": "staticConfig", - "type": "tuple", - "internalType": "struct OnRamp.StaticConfig", - "components": [ - { - "name": "chainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "rmnRemote", - "type": "address", - "internalType": "contract IRMNRemote" - }, - { - "name": "nonceManager", - "type": "address", - "internalType": "address" - }, - { - "name": "tokenAdminRegistry", - "type": "address", - "internalType": "address" - } - ] - }, - { - "name": "dynamicConfig", - "type": "tuple", - "internalType": "struct OnRamp.DynamicConfig", - "components": [ - { - "name": "feeQuoter", - "type": "address", - "internalType": "address" - }, - { - "name": "reentrancyGuardEntered", - "type": "bool", - "internalType": "bool" - }, - { - "name": "messageInterceptor", - "type": "address", - "internalType": "address" - }, - { - "name": "feeAggregator", - "type": "address", - "internalType": "address" - }, - { - "name": "allowlistAdmin", - "type": "address", - "internalType": "address" - } - ] - }, - { - "name": "destChainConfigArgs", - "type": "tuple[]", - "internalType": "struct OnRamp.DestChainConfigArgs[]", - "components": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "router", - "type": "address", - "internalType": "contract IRouter" - }, - { - "name": "allowlistEnabled", - "type": "bool", - "internalType": "bool" - } - ] - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "acceptOwnership", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "applyAllowlistUpdates", - "inputs": [ - { - "name": "allowlistConfigArgsItems", - "type": "tuple[]", - "internalType": "struct OnRamp.AllowlistConfigArgs[]", - "components": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "allowlistEnabled", - "type": "bool", - "internalType": "bool" - }, - { - "name": "addedAllowlistedSenders", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "removedAllowlistedSenders", - "type": "address[]", - "internalType": "address[]" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "applyDestChainConfigUpdates", - "inputs": [ - { - "name": "destChainConfigArgs", - "type": "tuple[]", - "internalType": "struct OnRamp.DestChainConfigArgs[]", - "components": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "router", - "type": "address", - "internalType": "contract IRouter" - }, - { - "name": "allowlistEnabled", - "type": "bool", - "internalType": "bool" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "forwardFromRouter", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "message", - "type": "tuple", - "internalType": "struct Client.EVM2AnyMessage", - "components": [ - { - "name": "receiver", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "tokenAmounts", - "type": "tuple[]", - "internalType": "struct Client.EVMTokenAmount[]", - "components": [ - { - "name": "token", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "name": "feeToken", - "type": "address", - "internalType": "address" - }, - { - "name": "extraArgs", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "name": "feeTokenAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "originalSender", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "getAllowedSendersList", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [ - { - "name": "isEnabled", - "type": "bool", - "internalType": "bool" - }, - { - "name": "configuredAddresses", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getDestChainConfig", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [ - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "allowlistEnabled", - "type": "bool", - "internalType": "bool" - }, - { - "name": "router", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getDynamicConfig", - "inputs": [], - "outputs": [ - { - "name": "dynamicConfig", - "type": "tuple", - "internalType": "struct OnRamp.DynamicConfig", - "components": [ - { - "name": "feeQuoter", - "type": "address", - "internalType": "address" - }, - { - "name": "reentrancyGuardEntered", - "type": "bool", - "internalType": "bool" - }, - { - "name": "messageInterceptor", - "type": "address", - "internalType": "address" - }, - { - "name": "feeAggregator", - "type": "address", - "internalType": "address" - }, - { - "name": "allowlistAdmin", - "type": "address", - "internalType": "address" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getExpectedNextSequenceNumber", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [ - { - "name": "", - "type": "uint64", - "internalType": "uint64" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getFee", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "message", - "type": "tuple", - "internalType": "struct Client.EVM2AnyMessage", - "components": [ - { - "name": "receiver", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "tokenAmounts", - "type": "tuple[]", - "internalType": "struct Client.EVMTokenAmount[]", - "components": [ - { - "name": "token", - "type": "address", - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "name": "feeToken", - "type": "address", - "internalType": "address" - }, - { - "name": "extraArgs", - "type": "bytes", - "internalType": "bytes" - } - ] - } - ], - "outputs": [ - { - "name": "feeTokenAmount", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getPoolBySourceToken", - "inputs": [ - { - "name": "", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "sourceToken", - "type": "address", - "internalType": "contract IERC20" - } - ], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "contract IPoolV1" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getStaticConfig", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct OnRamp.StaticConfig", - "components": [ - { - "name": "chainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "rmnRemote", - "type": "address", - "internalType": "contract IRMNRemote" - }, - { - "name": "nonceManager", - "type": "address", - "internalType": "address" - }, - { - "name": "tokenAdminRegistry", - "type": "address", - "internalType": "address" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getSupportedTokens", - "inputs": [ - { - "name": "", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [ - { - "name": "", - "type": "address[]", - "internalType": "address[]" - } - ], - "stateMutability": "pure" - }, - { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "setDynamicConfig", - "inputs": [ - { - "name": "dynamicConfig", - "type": "tuple", - "internalType": "struct OnRamp.DynamicConfig", - "components": [ - { - "name": "feeQuoter", - "type": "address", - "internalType": "address" - }, - { - "name": "reentrancyGuardEntered", - "type": "bool", - "internalType": "bool" - }, - { - "name": "messageInterceptor", - "type": "address", - "internalType": "address" - }, - { - "name": "feeAggregator", - "type": "address", - "internalType": "address" - }, - { - "name": "allowlistAdmin", - "type": "address", - "internalType": "address" - } - ] - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "transferOwnership", - "inputs": [ - { - "name": "to", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "typeAndVersion", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "withdrawFeeTokens", - "inputs": [ - { - "name": "feeTokens", - "type": "address[]", - "internalType": "address[]" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "event", - "name": "AllowListAdminSet", - "inputs": [ - { - "name": "allowlistAdmin", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "AllowListSendersAdded", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "indexed": true, - "internalType": "uint64" - }, - { - "name": "senders", - "type": "address[]", - "indexed": false, - "internalType": "address[]" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "AllowListSendersRemoved", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "indexed": true, - "internalType": "uint64" - }, - { - "name": "senders", - "type": "address[]", - "indexed": false, - "internalType": "address[]" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "CCIPMessageSent", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "indexed": true, - "internalType": "uint64" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "indexed": true, - "internalType": "uint64" - }, - { - "name": "message", - "type": "tuple", - "indexed": false, - "internalType": "struct Internal.EVM2AnyRampMessage", - "components": [ - { - "name": "header", - "type": "tuple", - "internalType": "struct Internal.RampMessageHeader", - "components": [ - { - "name": "messageId", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "sourceChainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "nonce", - "type": "uint64", - "internalType": "uint64" - } - ] - }, - { - "name": "sender", - "type": "address", - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "receiver", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "extraArgs", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "feeToken", - "type": "address", - "internalType": "address" - }, - { - "name": "feeTokenAmount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "feeValueJuels", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokenAmounts", - "type": "tuple[]", - "internalType": "struct Internal.EVM2AnyTokenTransfer[]", - "components": [ - { - "name": "sourcePoolAddress", - "type": "address", - "internalType": "address" - }, - { - "name": "destTokenAddress", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "extraData", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "destExecData", - "type": "bytes", - "internalType": "bytes" - } - ] - } - ] - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ConfigSet", - "inputs": [ - { - "name": "staticConfig", - "type": "tuple", - "indexed": false, - "internalType": "struct OnRamp.StaticConfig", - "components": [ - { - "name": "chainSelector", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "rmnRemote", - "type": "address", - "internalType": "contract IRMNRemote" - }, - { - "name": "nonceManager", - "type": "address", - "internalType": "address" - }, - { - "name": "tokenAdminRegistry", - "type": "address", - "internalType": "address" - } - ] - }, - { - "name": "dynamicConfig", - "type": "tuple", - "indexed": false, - "internalType": "struct OnRamp.DynamicConfig", - "components": [ - { - "name": "feeQuoter", - "type": "address", - "internalType": "address" - }, - { - "name": "reentrancyGuardEntered", - "type": "bool", - "internalType": "bool" - }, - { - "name": "messageInterceptor", - "type": "address", - "internalType": "address" - }, - { - "name": "feeAggregator", - "type": "address", - "internalType": "address" - }, - { - "name": "allowlistAdmin", - "type": "address", - "internalType": "address" - } - ] - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "DestChainConfigSet", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "indexed": true, - "internalType": "uint64" - }, - { - "name": "sequenceNumber", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - }, - { - "name": "router", - "type": "address", - "indexed": false, - "internalType": "contract IRouter" - }, - { - "name": "allowlistEnabled", - "type": "bool", - "indexed": false, - "internalType": "bool" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "FeeTokenWithdrawn", - "inputs": [ - { - "name": "feeAggregator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "feeToken", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "amount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "OwnershipTransferRequested", - "inputs": [ - { - "name": "from", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "to", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [ - { - "name": "from", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "to", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "error", - "name": "CannotSendZeroTokens", - "inputs": [] - }, - { - "type": "error", - "name": "CannotTransferToSelf", - "inputs": [] - }, - { - "type": "error", - "name": "CursedByRMN", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - } - ] - }, - { - "type": "error", - "name": "GetSupportedTokensFunctionalityRemovedCheckAdminRegistry", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidAllowListRequest", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - } - ] - }, - { - "type": "error", - "name": "InvalidConfig", - "inputs": [] - }, - { - "type": "error", - "name": "InvalidDestChainConfig", - "inputs": [ - { - "name": "destChainSelector", - "type": "uint64", - "internalType": "uint64" - } - ] - }, - { - "type": "error", - "name": "MustBeCalledByRouter", - "inputs": [] - }, - { - "type": "error", - "name": "MustBeProposedOwner", - "inputs": [] - }, - { - "type": "error", - "name": "OnlyCallableByOwner", - "inputs": [] - }, - { - "type": "error", - "name": "OnlyCallableByOwnerOrAllowlistAdmin", - "inputs": [] - }, - { - "type": "error", - "name": "OwnerCannotBeZero", - "inputs": [] - }, - { - "type": "error", - "name": "ReentrancyGuardReentrantCall", - "inputs": [] - }, - { - "type": "error", - "name": "RouterMustSetOriginalSender", - "inputs": [] - }, - { - "type": "error", - "name": "SenderNotAllowed", - "inputs": [ - { - "name": "sender", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "UnsupportedToken", - "inputs": [ - { - "name": "token", - "type": "address", - "internalType": "address" - } - ] - } - ] \ No newline at end of file + { + "type": "constructor", + "inputs": [ + { + "name": "staticConfig", + "type": "tuple", + "internalType": "struct OnRamp.StaticConfig", + "components": [ + { + "name": "chainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "rmnRemote", + "type": "address", + "internalType": "contract IRMNRemote" + }, + { + "name": "nonceManager", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAdminRegistry", + "type": "address", + "internalType": "address" + } + ] + }, + { + "name": "dynamicConfig", + "type": "tuple", + "internalType": "struct OnRamp.DynamicConfig", + "components": [ + { + "name": "feeQuoter", + "type": "address", + "internalType": "address" + }, + { + "name": "reentrancyGuardEntered", + "type": "bool", + "internalType": "bool" + }, + { + "name": "messageInterceptor", + "type": "address", + "internalType": "address" + }, + { + "name": "feeAggregator", + "type": "address", + "internalType": "address" + }, + { + "name": "allowlistAdmin", + "type": "address", + "internalType": "address" + } + ] + }, + { + "name": "destChainConfigArgs", + "type": "tuple[]", + "internalType": "struct OnRamp.DestChainConfigArgs[]", + "components": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "router", + "type": "address", + "internalType": "contract IRouter" + }, + { + "name": "allowlistEnabled", + "type": "bool", + "internalType": "bool" + } + ] + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "acceptOwnership", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "applyAllowlistUpdates", + "inputs": [ + { + "name": "allowlistConfigArgsItems", + "type": "tuple[]", + "internalType": "struct OnRamp.AllowlistConfigArgs[]", + "components": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "allowlistEnabled", + "type": "bool", + "internalType": "bool" + }, + { + "name": "addedAllowlistedSenders", + "type": "address[]", + "internalType": "address[]" + }, + { + "name": "removedAllowlistedSenders", + "type": "address[]", + "internalType": "address[]" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "applyDestChainConfigUpdates", + "inputs": [ + { + "name": "destChainConfigArgs", + "type": "tuple[]", + "internalType": "struct OnRamp.DestChainConfigArgs[]", + "components": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "router", + "type": "address", + "internalType": "contract IRouter" + }, + { + "name": "allowlistEnabled", + "type": "bool", + "internalType": "bool" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "forwardFromRouter", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "message", + "type": "tuple", + "internalType": "struct Client.EVM2AnyMessage", + "components": [ + { + "name": "receiver", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "tokenAmounts", + "type": "tuple[]", + "internalType": "struct Client.EVMTokenAmount[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "feeToken", + "type": "address", + "internalType": "address" + }, + { + "name": "extraArgs", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "name": "feeTokenAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "originalSender", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "getAllowedSendersList", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + } + ], + "outputs": [ + { + "name": "isEnabled", + "type": "bool", + "internalType": "bool" + }, + { + "name": "configuredAddresses", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getDestChainConfig", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + } + ], + "outputs": [ + { + "name": "sequenceNumber", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "allowlistEnabled", + "type": "bool", + "internalType": "bool" + }, + { + "name": "router", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getDynamicConfig", + "inputs": [], + "outputs": [ + { + "name": "dynamicConfig", + "type": "tuple", + "internalType": "struct OnRamp.DynamicConfig", + "components": [ + { + "name": "feeQuoter", + "type": "address", + "internalType": "address" + }, + { + "name": "reentrancyGuardEntered", + "type": "bool", + "internalType": "bool" + }, + { + "name": "messageInterceptor", + "type": "address", + "internalType": "address" + }, + { + "name": "feeAggregator", + "type": "address", + "internalType": "address" + }, + { + "name": "allowlistAdmin", + "type": "address", + "internalType": "address" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getExpectedNextSequenceNumber", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + } + ], + "outputs": [ + { + "name": "", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getFee", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "message", + "type": "tuple", + "internalType": "struct Client.EVM2AnyMessage", + "components": [ + { + "name": "receiver", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "tokenAmounts", + "type": "tuple[]", + "internalType": "struct Client.EVMTokenAmount[]", + "components": [ + { + "name": "token", + "type": "address", + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "name": "feeToken", + "type": "address", + "internalType": "address" + }, + { + "name": "extraArgs", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ], + "outputs": [ + { + "name": "feeTokenAmount", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getPoolBySourceToken", + "inputs": [ + { + "name": "", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "sourceToken", + "type": "address", + "internalType": "contract IERC20" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IPoolV1" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getStaticConfig", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "tuple", + "internalType": "struct OnRamp.StaticConfig", + "components": [ + { + "name": "chainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "rmnRemote", + "type": "address", + "internalType": "contract IRMNRemote" + }, + { + "name": "nonceManager", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAdminRegistry", + "type": "address", + "internalType": "address" + } + ] + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getSupportedTokens", + "inputs": [ + { + "name": "", + "type": "uint64", + "internalType": "uint64" + } + ], + "outputs": [ + { + "name": "", + "type": "address[]", + "internalType": "address[]" + } + ], + "stateMutability": "pure" + }, + { + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "setDynamicConfig", + "inputs": [ + { + "name": "dynamicConfig", + "type": "tuple", + "internalType": "struct OnRamp.DynamicConfig", + "components": [ + { + "name": "feeQuoter", + "type": "address", + "internalType": "address" + }, + { + "name": "reentrancyGuardEntered", + "type": "bool", + "internalType": "bool" + }, + { + "name": "messageInterceptor", + "type": "address", + "internalType": "address" + }, + { + "name": "feeAggregator", + "type": "address", + "internalType": "address" + }, + { + "name": "allowlistAdmin", + "type": "address", + "internalType": "address" + } + ] + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferOwnership", + "inputs": [ + { + "name": "to", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "typeAndVersion", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string", + "internalType": "string" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "withdrawFeeTokens", + "inputs": [ + { + "name": "feeTokens", + "type": "address[]", + "internalType": "address[]" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "AllowListAdminSet", + "inputs": [ + { + "name": "allowlistAdmin", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "AllowListSendersAdded", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "indexed": true, + "internalType": "uint64" + }, + { + "name": "senders", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "AllowListSendersRemoved", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "indexed": true, + "internalType": "uint64" + }, + { + "name": "senders", + "type": "address[]", + "indexed": false, + "internalType": "address[]" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "CCIPMessageSent", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "indexed": true, + "internalType": "uint64" + }, + { + "name": "sequenceNumber", + "type": "uint64", + "indexed": true, + "internalType": "uint64" + }, + { + "name": "message", + "type": "tuple", + "indexed": false, + "internalType": "struct Internal.EVM2AnyRampMessage", + "components": [ + { + "name": "header", + "type": "tuple", + "internalType": "struct Internal.RampMessageHeader", + "components": [ + { + "name": "messageId", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "sourceChainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "sequenceNumber", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "nonce", + "type": "uint64", + "internalType": "uint64" + } + ] + }, + { + "name": "sender", + "type": "address", + "internalType": "address" + }, + { + "name": "data", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "receiver", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "extraArgs", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "feeToken", + "type": "address", + "internalType": "address" + }, + { + "name": "feeTokenAmount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "feeValueJuels", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "tokenAmounts", + "type": "tuple[]", + "internalType": "struct Internal.EVM2AnyTokenTransfer[]", + "components": [ + { + "name": "sourcePoolAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "destTokenAddress", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "extraData", + "type": "bytes", + "internalType": "bytes" + }, + { + "name": "amount", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "destExecData", + "type": "bytes", + "internalType": "bytes" + } + ] + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ConfigSet", + "inputs": [ + { + "name": "staticConfig", + "type": "tuple", + "indexed": false, + "internalType": "struct OnRamp.StaticConfig", + "components": [ + { + "name": "chainSelector", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "rmnRemote", + "type": "address", + "internalType": "contract IRMNRemote" + }, + { + "name": "nonceManager", + "type": "address", + "internalType": "address" + }, + { + "name": "tokenAdminRegistry", + "type": "address", + "internalType": "address" + } + ] + }, + { + "name": "dynamicConfig", + "type": "tuple", + "indexed": false, + "internalType": "struct OnRamp.DynamicConfig", + "components": [ + { + "name": "feeQuoter", + "type": "address", + "internalType": "address" + }, + { + "name": "reentrancyGuardEntered", + "type": "bool", + "internalType": "bool" + }, + { + "name": "messageInterceptor", + "type": "address", + "internalType": "address" + }, + { + "name": "feeAggregator", + "type": "address", + "internalType": "address" + }, + { + "name": "allowlistAdmin", + "type": "address", + "internalType": "address" + } + ] + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DestChainConfigSet", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "indexed": true, + "internalType": "uint64" + }, + { + "name": "sequenceNumber", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + }, + { + "name": "router", + "type": "address", + "indexed": false, + "internalType": "contract IRouter" + }, + { + "name": "allowlistEnabled", + "type": "bool", + "indexed": false, + "internalType": "bool" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "FeeTokenWithdrawn", + "inputs": [ + { + "name": "feeAggregator", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "feeToken", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferRequested", + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "from", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "CannotSendZeroTokens", + "inputs": [] + }, + { + "type": "error", + "name": "CannotTransferToSelf", + "inputs": [] + }, + { + "type": "error", + "name": "CursedByRMN", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + } + ] + }, + { + "type": "error", + "name": "GetSupportedTokensFunctionalityRemovedCheckAdminRegistry", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidAllowListRequest", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + } + ] + }, + { + "type": "error", + "name": "InvalidConfig", + "inputs": [] + }, + { + "type": "error", + "name": "InvalidDestChainConfig", + "inputs": [ + { + "name": "destChainSelector", + "type": "uint64", + "internalType": "uint64" + } + ] + }, + { + "type": "error", + "name": "MustBeCalledByRouter", + "inputs": [] + }, + { + "type": "error", + "name": "MustBeProposedOwner", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyCallableByOwner", + "inputs": [] + }, + { + "type": "error", + "name": "OnlyCallableByOwnerOrAllowlistAdmin", + "inputs": [] + }, + { + "type": "error", + "name": "OwnerCannotBeZero", + "inputs": [] + }, + { + "type": "error", + "name": "ReentrancyGuardReentrantCall", + "inputs": [] + }, + { + "type": "error", + "name": "RouterMustSetOriginalSender", + "inputs": [] + }, + { + "type": "error", + "name": "SenderNotAllowed", + "inputs": [ + { + "name": "sender", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "UnsupportedToken", + "inputs": [ + { + "name": "token", + "type": "address", + "internalType": "address" + } + ] + } +] diff --git a/packages/ccip-js/src/adapters/ethers.ts b/packages/ccip-js/src/adapters/ethers.ts new file mode 100644 index 0000000..33ceb00 --- /dev/null +++ b/packages/ccip-js/src/adapters/ethers.ts @@ -0,0 +1,543 @@ +import type { + Address, + Chain, + Client as ViemClient, + Hex, + PublicClient, + Transport, + WalletClient, + TransactionReceipt as ViemTransactionReceipt, + AbiEvent, +} from 'viem' + +import type { + ContractCallArgs, + TransactionArgs, + ReceiptArgs, + LogsArgs, +} from './types' +import { + createPublicClient, + createWalletClient, + custom, + parseEventLogs, + keccak256, + toHex, + isAddress, + zeroAddress, + isAddressEqual, +} from 'viem' +import { toAccount } from 'viem/accounts' +import type { Provider, Signer, TypedDataField, BrowserProvider } from 'ethers' +import { Contract, type TransactionReceipt as EthersTxReceipt, type TransactionResponse } from 'ethers' +import { + readContract as viemReadContract, + writeContract as viemWriteContract, + waitForTransactionReceipt as viemWaitForTransactionReceipt, + getTransactionReceipt as viemGetTransactionReceipt, + getBlockNumber as viemGetBlockNumber, + getLogs as viemGetLogs, +} from 'viem/actions' + +/** + * Converts an ethers Provider to a viem Transport for use with viem clients. + */ +export function ethersProviderToTransport(provider: Provider): Transport { + return custom({ + async request({ method, params }) { + const anyProvider = provider as any + if (typeof anyProvider.request === 'function') { + return anyProvider.request({ method, params }) + } + if (typeof anyProvider.send === 'function') { + return anyProvider.send(method, params as any) + } + throw new Error('Unsupported ethers provider: missing request/send method') + }, + }) +} + +/** + * Adapts an ethers Signer into a viem LocalAccount supporting message, transaction, + * and EIP-712 typed data signing. + */ +export async function ethersSignerToAccount(signer: Signer) { + return toAccount({ + address: (await signer.getAddress()) as unknown as Address, + async signMessage({ message }) { + let data: any + if (typeof message === 'string') { + data = message + } else if (typeof message === 'object' && message !== null && 'raw' in (message as any)) { + const raw = (message as any).raw as Hex | Uint8Array + data = typeof raw === 'string' ? (raw as string) : (raw as Uint8Array) + } else { + data = message as any + } + return (await signer.signMessage(data)) as unknown as Hex + }, + async signTransaction(txn) { + const serialized = await signer.signTransaction({ + chainId: txn.chainId, + data: txn.data, + gasLimit: txn.gas, + gasPrice: txn.gasPrice, + nonce: txn.nonce, + to: txn.to, + value: txn.value, + type: + txn.type === 'legacy' + ? 0 + : txn.type === 'eip2930' + ? 1 + : txn.type === 'eip1559' + ? 2 + : txn.type === 'eip4844' + ? 3 + : undefined, + ...(txn.type && txn.accessList ? { accessList: txn.accessList } : {}), + ...(txn.maxPriorityFeePerGas ? { maxPriorityFeePerGas: txn.maxPriorityFeePerGas } : {}), + ...(txn.maxFeePerGas ? { maxFeePerGas: txn.maxFeePerGas } : {}), + ...((txn as any).maxFeePerBlobGas ? { maxFeePerBlobGas: (txn as any).maxFeePerBlobGas } : {}), + ...((txn as any).blobVersionedHashes ? { blobVersionedHashes: (txn as any).blobVersionedHashes } : {}), + ...((txn as any).blobs ? { blobs: (txn as any).blobs } : {}), + } as any) + return serialized as unknown as Hex + }, + async signTypedData({ domain, types, message }) { + const { EIP712Domain: _ignored, ...rest } = (types || {}) as Record