From a3e7558c705ec9ff181f3860765e0219f7350337 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Wed, 20 May 2026 14:20:04 +0200 Subject: [PATCH] ops gen 1.5 --- chains/evm/GNUmakefile | 16 +- .../evm/deployment/operations_gen_config.yaml | 13 - .../deployment/operations_gen_config_1_5.yaml | 72 ++++ .../burn_mint_token_pool_and_proxy.go | 208 ++++-------- .../evm/deployment/v1_5_1/adapters/tokens.go | 56 +-- .../burn_from_mint_token_pool.go | 28 +- .../burn_mint_token_pool.go | 28 +- .../burn_to_address_mint_token_pool.go | 30 +- .../burn_with_from_mint_token_pool.go | 28 +- .../lock_release_token_pool.go | 30 +- .../operations/token_pool/token_pool.go | 319 ++++++++++++------ .../v1_5_1/sequences/deploy_token_pool.go | 19 +- .../configure_token_pool_for_remote_chains.go | 25 +- .../configure_token_pool_for_remote_chain.go | 40 ++- 14 files changed, 507 insertions(+), 405 deletions(-) create mode 100644 chains/evm/deployment/operations_gen_config_1_5.yaml diff --git a/chains/evm/GNUmakefile b/chains/evm/GNUmakefile index 71400e1c69..194ba3c035 100644 --- a/chains/evm/GNUmakefile +++ b/chains/evm/GNUmakefile @@ -67,10 +67,18 @@ mockery: $(mockery) ## Install mockery. extract-bytecode-abi: ## Extract bytecode and abi from versioned gobindings to bytecode and abi directories cd gobindings && go run ./cmd/extract_bytecode/main.go -.PHONY: operations -operations: pnpmdep wrappers +OPERATIONS_GEN_V2 := github.com/smartcontractkit/chainlink-deployments-framework/tools/operations-gen@v0.0.2-0.20260515181606-62d38f5a89b0 + +.PHONY: operations-legacy +operations-legacy: go run cmd/operations-gen/main.go -config deployment/operations_gen_config.yaml +.PHONY: operations-1-5 +operations-1-5: + go run $(OPERATIONS_GEN_V2) -config deployment/operations_gen_config_1_5.yaml + +.PHONY: operations +operations: pnpmdep wrappers operations-legacy operations-1-5 + .PHONY: operations-fast -operations-fast: - go run cmd/operations-gen/main.go -config deployment/operations_gen_config.yaml +operations-fast: operations-legacy operations-1-5 diff --git a/chains/evm/deployment/operations_gen_config.yaml b/chains/evm/deployment/operations_gen_config.yaml index 6e5d4e7779..d458e78d2c 100644 --- a/chains/evm/deployment/operations_gen_config.yaml +++ b/chains/evm/deployment/operations_gen_config.yaml @@ -11,19 +11,6 @@ output: # - (none): Public/Read functions don't need access control contracts: - # 1.5.0 - - contract_name: BurnMintTokenPoolAndProxy - version: "1.5.0" - functions: - - name: getRemotePool - access: public - - name: getCurrentInboundRateLimiterState - access: public - - name: getCurrentOutboundRateLimiterState - access: public - - name: getPreviousPool - access: public - # 1.6.3 - contract_name: FeeQuoter version: "1.6.3" diff --git a/chains/evm/deployment/operations_gen_config_1_5.yaml b/chains/evm/deployment/operations_gen_config_1_5.yaml new file mode 100644 index 0000000000..44723857b3 --- /dev/null +++ b/chains/evm/deployment/operations_gen_config_1_5.yaml @@ -0,0 +1,72 @@ +# Schema for github.com/smartcontractkit/chainlink-deployments-framework/tools/operations-gen +# (generates operations using chain/evm/operations2/contract). +# Covers EVM deployment versions <= 1.5.1 only. +version: "1.0.0" +chain_family: evm + +input: + gobindings_package: "../gobindings/generated" + +output: + base_path: "." + +contracts: + # 1.5.0 + - contract_name: BurnMintTokenPoolAndProxy + version: "1.5.0" + functions: + - name: getRemotePool + access: public + - name: getCurrentInboundRateLimiterState + access: public + - name: getCurrentOutboundRateLimiterState + access: public + - name: getPreviousPool + access: public + + # 1.5.1 + - contract_name: TokenPool + version: "1.5.1" + omit_deploy: true + functions: + - name: applyChainUpdates + access: owner + - name: setRateLimitAdmin + access: owner + - name: getRateLimitAdmin + access: public + - name: setChainRateLimiterConfig + access: owner + - name: getToken + access: public + - name: getTokenDecimals + access: public + - name: isSupportedToken + access: public + - name: getSupportedChains + access: public + - name: getRemoteToken + access: public + - name: getRemotePools + access: public + - name: addRemotePool + access: owner + - name: getCurrentInboundRateLimiterState + access: public + - name: getCurrentOutboundRateLimiterState + access: public + + - contract_name: BurnMintTokenPool + version: "1.5.1" + + - contract_name: BurnFromMintTokenPool + version: "1.5.1" + + - contract_name: BurnToAddressMintTokenPool + version: "1.5.1" + + - contract_name: BurnWithFromMintTokenPool + version: "1.5.1" + + - contract_name: LockReleaseTokenPool + version: "1.5.1" diff --git a/chains/evm/deployment/v1_5_0/operations/burn_mint_token_pool_and_proxy/burn_mint_token_pool_and_proxy.go b/chains/evm/deployment/v1_5_0/operations/burn_mint_token_pool_and_proxy/burn_mint_token_pool_and_proxy.go index 32352c539a..6324f05ead 100644 --- a/chains/evm/deployment/v1_5_0/operations/burn_mint_token_pool_and_proxy/burn_mint_token_pool_and_proxy.go +++ b/chains/evm/deployment/v1_5_0/operations/burn_mint_token_pool_and_proxy/burn_mint_token_pool_and_proxy.go @@ -3,173 +3,87 @@ package burn_mint_token_pool_and_proxy import ( - "math/big" - - "strings" - "github.com/Masterminds/semver/v3" - "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" + gobindings "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/burn_mint_token_pool_and_proxy" + cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" - - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + cld_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" ) var ContractType cldf_deployment.ContractType = "BurnMintTokenPoolAndProxy" var Version = semver.MustParse("1.5.0") var TypeAndVersion = cldf_deployment.NewTypeAndVersion(ContractType, *Version) -const BurnMintTokenPoolAndProxyABI = `[{"inputs":[{"internalType":"contract IBurnMintERC20","name":"token","type":"address"},{"internalType":"address[]","name":"allowlist","type":"address[]"},{"internalType":"address","name":"rmnProxy","type":"address"},{"internalType":"address","name":"router","type":"address"}],"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":"AllowListNotEnabled","type":"error"},{"inputs":[],"name":"BucketOverfilled","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":"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":[{"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":false,"internalType":"contract IPoolPriorTo1_5","name":"oldPool","type":"address"},{"indexed":false,"internalType":"contract IPoolPriorTo1_5","name":"newPool","type":"address"}],"name":"LegacyPoolChanged","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokens","type":"uint256"}],"name":"TokensConsumed","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":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"getOnRamp","outputs":[{"internalType":"address","name":"onRampAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPreviousPool","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"sourceChainSelector","type":"uint64"},{"internalType":"address","name":"offRamp","type":"address"}],"name":"isOffRamp","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"","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":"contract IPoolPriorTo1_5","name":"prevPool","type":"address"}],"name":"setPreviousPool","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"},{"inputs":[],"name":"typeAndVersion","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]` -const BurnMintTokenPoolAndProxyBin = "0x60e06040523480156200001157600080fd5b506040516200497338038062004973833981016040819052620000349162000554565b83838383838383833380600081620000935760405162461bcd60e51b815260206004820152601860248201527f43616e6e6f7420736574206f776e657220746f207a65726f000000000000000060448201526064015b60405180910390fd5b600080546001600160a01b0319166001600160a01b0384811691909117909155811615620000c657620000c6816200017e565b5050506001600160a01b0384161580620000e757506001600160a01b038116155b80620000fa57506001600160a01b038216155b1562000119576040516342bcdf7f60e11b815260040160405180910390fd5b6001600160a01b0384811660805282811660a052600480546001600160a01b031916918316919091179055825115801560c0526200016c576040805160008152602081019091526200016c908462000229565b505050505050505050505050620006b2565b336001600160a01b03821603620001d85760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016200008a565b600180546001600160a01b0319166001600160a01b0383811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b60c0516200024a576040516335f4a7b360e01b815260040160405180910390fd5b60005b8251811015620002d55760008382815181106200026e576200026e62000664565b602090810291909101015190506200028860028262000386565b15620002cb576040516001600160a01b03821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b506001016200024d565b5060005b815181101562000381576000828281518110620002fa57620002fa62000664565b6020026020010151905060006001600160a01b0316816001600160a01b03160362000326575062000378565b62000333600282620003a6565b1562000376576040516001600160a01b03821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101620002d9565b505050565b60006200039d836001600160a01b038416620003bd565b90505b92915050565b60006200039d836001600160a01b038416620004c1565b60008181526001830160205260408120548015620004b6576000620003e46001836200067a565b8554909150600090620003fa906001906200067a565b9050808214620004665760008660000182815481106200041e576200041e62000664565b906000526020600020015490508087600001848154811062000444576200044462000664565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806200047a576200047a6200069c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050620003a0565b6000915050620003a0565b60008181526001830160205260408120546200050a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620003a0565b506000620003a0565b6001600160a01b03811681146200052957600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b80516200054f8162000513565b919050565b600080600080608085870312156200056b57600080fd5b8451620005788162000513565b602086810151919550906001600160401b03808211156200059857600080fd5b818801915088601f830112620005ad57600080fd5b815181811115620005c257620005c26200052c565b8060051b604051601f19603f83011681018181108582111715620005ea57620005ea6200052c565b60405291825284820192508381018501918b8311156200060957600080fd5b938501935b828510156200063257620006228562000542565b845293850193928501926200060e565b809850505050505050620006496040860162000542565b9150620006596060860162000542565b905092959194509250565b634e487b7160e01b600052603260045260246000fd5b81810381811115620003a057634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05161423d620007366000396000818161056001528181611ae8015261253a01526000818161053a0152818161187b0152611d9b015260008181610265015281816102ba0152818161078001528181610e060152818161179b01528181611cbb01528181611ea1015281816124d00152612725015261423d6000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80639a4575b911610104578063c0d78655116100a2578063db6327dc11610071578063db6327dc14610525578063dc0bd97114610538578063e0351e131461055e578063f2fde38b1461058457600080fd5b8063c0d78655146104d7578063c4bffe2b146104ea578063c75eea9c146104ff578063cf7401f31461051257600080fd5b8063a8d87a3b116100de578063a8d87a3b14610424578063af58d59f14610437578063b0f479a1146104a6578063b7946580146104c457600080fd5b80639a4575b9146103d1578063a2b261d8146103f1578063a7cd63b71461040f57600080fd5b80636d3d1a581161017c57806383826b2b1161014b57806383826b2b1461037a5780638926f54f1461038d5780638da5cb5b146103a05780639766b932146103be57600080fd5b80636d3d1a581461032e57806378a010b21461034c57806379ba50971461035f5780637d54534e1461036757600080fd5b806321df0da7116101b857806321df0da714610263578063240028e8146102aa57806339077537146102f757806354c8a4f31461031957600080fd5b806301ffc9a7146101df5780630a2fd49314610207578063181f5a7714610227575b600080fd5b6101f26101ed3660046131d2565b610597565b60405190151581526020015b60405180910390f35b61021a610215366004613231565b61067c565b6040516101fe91906132ba565b61021a6040518060400160405280601f81526020017f4275726e4d696e74546f6b656e506f6f6c416e6450726f787920312e352e300081525081565b7f00000000000000000000000000000000000000000000000000000000000000005b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101fe565b6101f26102b83660046132fa565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff90811691161490565b61030a610305366004613317565b61072c565b604051905181526020016101fe565b61032c61032736600461339f565b6108e4565b005b60085473ffffffffffffffffffffffffffffffffffffffff16610285565b61032c61035a36600461340b565b61095f565b61032c610ad3565b61032c6103753660046132fa565b610bd0565b6101f261038836600461348e565b610c1f565b6101f261039b366004613231565b610cec565b60005473ffffffffffffffffffffffffffffffffffffffff16610285565b61032c6103cc3660046132fa565b610d03565b6103e46103df3660046134c5565b610d92565b6040516101fe9190613500565b60095473ffffffffffffffffffffffffffffffffffffffff16610285565b610417610f02565b6040516101fe9190613560565b610285610432366004613231565b503090565b61044a610445366004613231565b610f13565b6040516101fe919081516fffffffffffffffffffffffffffffffff908116825260208084015163ffffffff1690830152604080840151151590830152606080840151821690830152608092830151169181019190915260a00190565b60045473ffffffffffffffffffffffffffffffffffffffff16610285565b61021a6104d2366004613231565b610fe8565b61032c6104e53660046132fa565b611013565b6104f26110e7565b6040516101fe91906135ba565b61044a61050d366004613231565b61119f565b61032c610520366004613771565b611271565b61032c6105333660046137b6565b6112fa565b7f0000000000000000000000000000000000000000000000000000000000000000610285565b7f00000000000000000000000000000000000000000000000000000000000000006101f2565b61032c6105923660046132fa565b611780565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167faff2afbf00000000000000000000000000000000000000000000000000000000148061062a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e64dd2900000000000000000000000000000000000000000000000000000000145b8061067657507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b67ffffffffffffffff811660009081526007602052604090206004018054606091906106a7906137f8565b80601f01602080910402602001604051908101604052809291908181526020018280546106d3906137f8565b80156107205780601f106106f557610100808354040283529160200191610720565b820191906000526020600020905b81548152906001019060200180831161070357829003601f168201915b50505050509050919050565b60408051602081019091526000815261074c610747836138e7565b611794565b60095473ffffffffffffffffffffffffffffffffffffffff166108425773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166340c10f196107b560608501604086016132fa565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015260608501356024820152604401600060405180830381600087803b15801561082557600080fd5b505af1158015610839573d6000803e3d6000fd5b50505050610853565b61085361084e836138e7565b6119c5565b61086360608301604084016132fa565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f9d228d69b5fdb8d273a2336f8fb8612d039631024ea9bf09c424a9503aa078f084606001356040516108c591815260200190565b60405180910390a3506040805160208101909152606090910135815290565b6108ec611a63565b61095984848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808802828101820190935287825290935087925086918291850190849080828437600092019190915250611ae692505050565b50505050565b610967611a63565b61097083610cec565b6109b7576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024015b60405180910390fd5b67ffffffffffffffff8316600090815260076020526040812060040180546109de906137f8565b80601f0160208091040260200160405190810160405280929190818152602001828054610a0a906137f8565b8015610a575780601f10610a2c57610100808354040283529160200191610a57565b820191906000526020600020905b815481529060010190602001808311610a3a57829003601f168201915b5050505067ffffffffffffffff8616600090815260076020526040902091925050600401610a86838583613a2c565b508367ffffffffffffffff167fdb4d6220746a38cbc5335f7e108f7de80f482f4d23350253dfd0917df75a14bf828585604051610ac593929190613b46565b60405180910390a250505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314610b54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4d7573742062652070726f706f736564206f776e65720000000000000000000060448201526064016109ae565b60008054337fffffffffffffffffffffffff00000000000000000000000000000000000000008083168217845560018054909116905560405173ffffffffffffffffffffffffffffffffffffffff90921692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610bd8611a63565b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600073ffffffffffffffffffffffffffffffffffffffff8216301480610ce55750600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff86169281019290925273ffffffffffffffffffffffffffffffffffffffff848116602484015216906383826b2b90604401602060405180830381865afa158015610cc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce59190613baa565b9392505050565b6000610676600567ffffffffffffffff8416611c9c565b610d0b611a63565b6009805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f81accd0a7023865eaa51b3399dd0eafc488bf3ba238402911e1659cfe860f22891015b60405180910390a15050565b6040805180820190915260608082526020820152610db7610db283613bc7565b611cb4565b60095473ffffffffffffffffffffffffffffffffffffffff16610e7c576040517f42966c68000000000000000000000000000000000000000000000000000000008152606083013560048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906342966c6890602401600060405180830381600087803b158015610e5f57600080fd5b505af1158015610e73573d6000803e3d6000fd5b50505050610e8d565b610e8d610e8883613bc7565b611e7e565b6040516060830135815233907f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df79060200160405180910390a26040518060400160405280610ee78460200160208101906104d29190613231565b81526040805160208181019092526000815291015292915050565b6060610f0e6002611f98565b905090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845260028201546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600390910154808416606083015291909104909116608082015261067690611fa5565b67ffffffffffffffff811660009081526007602052604090206005018054606091906106a7906137f8565b61101b611a63565b73ffffffffffffffffffffffffffffffffffffffff8116611068576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6004805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527f02dc5c233404867c793b749c6d644beb2277536d18a7e7974d3f238e4c6f16849101610d86565b606060006110f56005611f98565b90506000815167ffffffffffffffff811115611113576111136135fc565b60405190808252806020026020018201604052801561113c578160200160208202803683370190505b50905060005b82518110156111985782818151811061115d5761115d613c69565b602002602001015182828151811061117757611177613c69565b67ffffffffffffffff90921660209283029190910190910152600101611142565b5092915050565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915267ffffffffffffffff8216600090815260076020908152604091829020825160a08101845281546fffffffffffffffffffffffffffffffff808216835270010000000000000000000000000000000080830463ffffffff16958401959095527401000000000000000000000000000000000000000090910460ff16151594820194909452600190910154808416606083015291909104909116608082015261067690611fa5565b60085473ffffffffffffffffffffffffffffffffffffffff1633148015906112b1575060005473ffffffffffffffffffffffffffffffffffffffff163314155b156112ea576040517f8e4a23d60000000000000000000000000000000000000000000000000000000081523360048201526024016109ae565b6112f5838383612057565b505050565b611302611a63565b60005b818110156112f557600083838381811061132157611321613c69565b90506020028101906113339190613c98565b61133c90613cd6565b90506113518160800151826020015115612141565b6113648160a00151826020015115612141565b8060200151156116605780516113869060059067ffffffffffffffff1661227a565b6113cb5780516040517f1d5ad3c500000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016109ae565b60408101515115806113e05750606081015151155b15611417576040517f8579befe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805161012081018252608083810180516020908101516fffffffffffffffffffffffffffffffff9081168486019081524263ffffffff90811660a0808901829052865151151560c08a01528651860151851660e08a015295518901518416610100890152918752875180860189529489018051850151841686528585019290925281515115158589015281518401518316606080870191909152915188015183168587015283870194855288880151878901908152828a015183890152895167ffffffffffffffff1660009081526007865289902088518051825482890151838e01519289167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316177001000000000000000000000000000000009188168202177fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff90811674010000000000000000000000000000000000000000941515850217865584890151948d0151948a16948a168202949094176001860155995180516002860180549b8301519f830151918b169b9093169a909a179d9096168a029c909c179091169615150295909517909855908101519401519381169316909102919091176003820155915190919060048201906115f89082613d8a565b506060820151600582019061160d9082613d8a565b505081516060830151608084015160a08501516040517f8d340f17e19058004c20453540862a9c62778504476f6756755cb33bcd6c38c295506116539493929190613ea4565b60405180910390a1611777565b80516116789060059067ffffffffffffffff16612286565b6116bd5780516040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff90911660048201526024016109ae565b805167ffffffffffffffff16600090815260076020526040812080547fffffffffffffffffffffff000000000000000000000000000000000000000000908116825560018201839055600282018054909116905560038101829055906117266004830182613184565b611734600583016000613184565b5050805160405167ffffffffffffffff90911681527f5204aec90a3c794d8e90fded8b46ae9c7c552803e7e832e0c1d358396d8599169060200160405180910390a15b50600101611305565b611788611a63565b61179181612292565b50565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff9081169116146118295760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016109ae565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa1580156118d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118fb9190613baa565b15611932576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61193f8160200151612387565b600061194e826020015161067c565b9050805160001480611972575080805190602001208260a001518051906020012014155b156119af578160a001516040517f24eb47e50000000000000000000000000000000000000000000000000000000081526004016109ae91906132ba565b6119c1826020015183606001516124ad565b5050565b60095481516040808401516060850151602086015192517f8627fad600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694638627fad694611a2e9490939291600401613f3d565b600060405180830381600087803b158015611a4857600080fd5b505af1158015611a5c573d6000803e3d6000fd5b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611ae4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4f6e6c792063616c6c61626c65206279206f776e65720000000000000000000060448201526064016109ae565b565b7f0000000000000000000000000000000000000000000000000000000000000000611b3d576040517f35f4a7b300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8251811015611bd3576000838281518110611b5d57611b5d613c69565b60200260200101519050611b7b8160026124f490919063ffffffff16565b15611bca5760405173ffffffffffffffffffffffffffffffffffffffff821681527f800671136ab6cfee9fbe5ed1fb7ca417811aca3cf864800d127b927adedf75669060200160405180910390a15b50600101611b40565b5060005b81518110156112f5576000828281518110611bf457611bf4613c69565b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c385750611c94565b611c43600282612516565b15611c925760405173ffffffffffffffffffffffffffffffffffffffff821681527f2640d4d76caf8bf478aabfa982fa4e1c4eb71a37f93cd15e80dbc657911546d89060200160405180910390a15b505b600101611bd7565b60008181526001830160205260408120541515610ce5565b60808101517f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff908116911614611d495760808101516040517f961c9a4f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911660048201526024016109ae565b60208101516040517f2cbc26bb00000000000000000000000000000000000000000000000000000000815260809190911b77ffffffffffffffff000000000000000000000000000000001660048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632cbc26bb90602401602060405180830381865afa158015611df7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1b9190613baa565b15611e52576040517f53ad11d800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e5f8160400151612538565b611e6c81602001516125b7565b61179181602001518260600151612705565b6009546060820151611ecb9173ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811692911690612749565b60095460408083015183516060850151602086015193517f9687544500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90951694639687544594611f3394939291600401613f9e565b6000604051808303816000875af1158015611f52573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526119c19190810190613ffe565b60606000610ce5836127d6565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915261203382606001516fffffffffffffffffffffffffffffffff1683600001516fffffffffffffffffffffffffffffffff16846020015163ffffffff1642612017919061409b565b85608001516fffffffffffffffffffffffffffffffff16612831565b6fffffffffffffffffffffffffffffffff1682525063ffffffff4216602082015290565b61206083610cec565b6120a2576040517f1e670e4b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff841660048201526024016109ae565b6120ad826000612141565b67ffffffffffffffff831660009081526007602052604090206120d0908361285b565b6120db816000612141565b67ffffffffffffffff83166000908152600760205260409020612101906002018261285b565b7f0350d63aa5f270e01729d00d627eeb8f3429772b1818c016c66a588a864f912b838383604051612134939291906140ae565b60405180910390a1505050565b8151156122085781602001516fffffffffffffffffffffffffffffffff1682604001516fffffffffffffffffffffffffffffffff16101580612197575060408201516fffffffffffffffffffffffffffffffff16155b156121d057816040517f8020d1240000000000000000000000000000000000000000000000000000000081526004016109ae9190614131565b80156119c1576040517f433fc33d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408201516fffffffffffffffffffffffffffffffff16151580612241575060208201516fffffffffffffffffffffffffffffffff1615155b156119c157816040517fd68af9cc0000000000000000000000000000000000000000000000000000000081526004016109ae9190614131565b6000610ce583836129fd565b6000610ce58383612a4c565b3373ffffffffffffffffffffffffffffffffffffffff821603612311576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f43616e6e6f74207472616e7366657220746f2073656c6600000000000000000060448201526064016109ae565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83811691821790925560008054604051929316917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b61239081610cec565b6123d2576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016109ae565b600480546040517f83826b2b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925233602483015273ffffffffffffffffffffffffffffffffffffffff16906383826b2b90604401602060405180830381865afa158015612451573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124759190613baa565b611791576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016109ae565b67ffffffffffffffff821660009081526007602052604090206119c190600201827f0000000000000000000000000000000000000000000000000000000000000000612b3f565b6000610ce58373ffffffffffffffffffffffffffffffffffffffff8416612a4c565b6000610ce58373ffffffffffffffffffffffffffffffffffffffff84166129fd565b7f00000000000000000000000000000000000000000000000000000000000000001561179157612569600282612ec2565b611791576040517fd0d2597600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016109ae565b6125c081610cec565b612602576040517fa9902c7e00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff821660048201526024016109ae565b600480546040517fa8d87a3b00000000000000000000000000000000000000000000000000000000815267ffffffffffffffff84169281019290925273ffffffffffffffffffffffffffffffffffffffff169063a8d87a3b90602401602060405180830381865afa15801561267b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061269f919061416d565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611791576040517f728fe07b0000000000000000000000000000000000000000000000000000000081523360048201526024016109ae565b67ffffffffffffffff821660009081526007602052604090206119c190827f0000000000000000000000000000000000000000000000000000000000000000612b3f565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526112f5908490612ef1565b60608160000180548060200260200160405190810160405280929190818152602001828054801561072057602002820191906000526020600020905b8154815260200190600101908083116128125750505050509050919050565b600061285085612841848661418a565b61284b90876141a1565b612ffd565b90505b949350505050565b815460009061288490700100000000000000000000000000000000900463ffffffff164261409b565b9050801561292657600183015483546128cc916fffffffffffffffffffffffffffffffff80821692811691859170010000000000000000000000000000000090910416612831565b83546fffffffffffffffffffffffffffffffff919091167fffffffffffffffffffffffff0000000000000000000000000000000000000000909116177001000000000000000000000000000000004263ffffffff16021783555b6020820151835461294c916fffffffffffffffffffffffffffffffff9081169116612ffd565b83548351151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffff000000000000000000000000000000009091166fffffffffffffffffffffffffffffffff92831617178455602083015160408085015183167001000000000000000000000000000000000291909216176001850155517f9ea3374b67bf275e6bb9c8ae68f9cae023e1c528b4b27e092f0bb209d3531c1990612134908490614131565b6000818152600183016020526040812054612a4457508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610676565b506000610676565b60008181526001830160205260408120548015612b35576000612a7060018361409b565b8554909150600090612a849060019061409b565b9050808214612ae9576000866000018281548110612aa457612aa4613c69565b9060005260206000200154905080876000018481548110612ac757612ac7613c69565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612afa57612afa6141b4565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610676565b6000915050610676565b825474010000000000000000000000000000000000000000900460ff161580612b66575081155b15612b7057505050565b825460018401546fffffffffffffffffffffffffffffffff80831692911690600090612bb690700100000000000000000000000000000000900463ffffffff164261409b565b90508015612c765781831115612bf8576040517f9725942a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001860154612c329083908590849070010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16612831565b86547fffffffffffffffffffffffff00000000ffffffffffffffffffffffffffffffff167001000000000000000000000000000000004263ffffffff160217875592505b84821015612d2d5773ffffffffffffffffffffffffffffffffffffffff8416612cd5576040517ff94ebcd100000000000000000000000000000000000000000000000000000000815260048101839052602481018690526044016109ae565b6040517f1a76572a000000000000000000000000000000000000000000000000000000008152600481018390526024810186905273ffffffffffffffffffffffffffffffffffffffff851660448201526064016109ae565b84831015612e405760018681015470010000000000000000000000000000000090046fffffffffffffffffffffffffffffffff16906000908290612d71908261409b565b612d7b878a61409b565b612d8591906141a1565b612d8f91906141e3565b905073ffffffffffffffffffffffffffffffffffffffff8616612de8576040517f15279c0800000000000000000000000000000000000000000000000000000000815260048101829052602481018690526044016109ae565b6040517fd0c8d23a000000000000000000000000000000000000000000000000000000008152600481018290526024810186905273ffffffffffffffffffffffffffffffffffffffff871660448201526064016109ae565b612e4a858461409b565b86547fffffffffffffffffffffffffffffffff00000000000000000000000000000000166fffffffffffffffffffffffffffffffff82161787556040518681529093507f1871cdf8010e63f2eb8384381a68dfa7416dc571a5517e66e88b2d2d0c0a690a9060200160405180910390a1505050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526001830160205260408120541515610ce5565b6000612f53826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166130139092919063ffffffff16565b8051909150156112f55780806020019051810190612f719190613baa565b6112f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016109ae565b600081831061300c5781610ce5565b5090919050565b60606128538484600085856000808673ffffffffffffffffffffffffffffffffffffffff168587604051613047919061421e565b60006040518083038185875af1925050503d8060008114613084576040519150601f19603f3d011682016040523d82523d6000602084013e613089565b606091505b509150915061309a878383876130a5565b979650505050505050565b6060831561313b5782516000036131345773ffffffffffffffffffffffffffffffffffffffff85163b613134576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016109ae565b5081612853565b61285383838151156131505781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ae91906132ba565b508054613190906137f8565b6000825580601f106131a0575050565b601f01602090049060005260206000209081019061179191905b808211156131ce57600081556001016131ba565b5090565b6000602082840312156131e457600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610ce557600080fd5b803567ffffffffffffffff8116811461322c57600080fd5b919050565b60006020828403121561324357600080fd5b610ce582613214565b60005b8381101561326757818101518382015260200161324f565b50506000910152565b6000815180845261328881602086016020860161324c565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610ce56020830184613270565b73ffffffffffffffffffffffffffffffffffffffff8116811461179157600080fd5b803561322c816132cd565b60006020828403121561330c57600080fd5b8135610ce5816132cd565b60006020828403121561332957600080fd5b813567ffffffffffffffff81111561334057600080fd5b82016101008185031215610ce557600080fd5b60008083601f84011261336557600080fd5b50813567ffffffffffffffff81111561337d57600080fd5b6020830191508360208260051b850101111561339857600080fd5b9250929050565b600080600080604085870312156133b557600080fd5b843567ffffffffffffffff808211156133cd57600080fd5b6133d988838901613353565b909650945060208701359150808211156133f257600080fd5b506133ff87828801613353565b95989497509550505050565b60008060006040848603121561342057600080fd5b61342984613214565b9250602084013567ffffffffffffffff8082111561344657600080fd5b818601915086601f83011261345a57600080fd5b81358181111561346957600080fd5b87602082850101111561347b57600080fd5b6020830194508093505050509250925092565b600080604083850312156134a157600080fd5b6134aa83613214565b915060208301356134ba816132cd565b809150509250929050565b6000602082840312156134d757600080fd5b813567ffffffffffffffff8111156134ee57600080fd5b820160a08185031215610ce557600080fd5b60208152600082516040602084015261351c6060840182613270565b905060208401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08483030160408501526135578282613270565b95945050505050565b6020808252825182820181905260009190848201906040850190845b818110156135ae57835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161357c565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156135ae57835167ffffffffffffffff16835292840192918401916001016135d6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff8111828210171561364f5761364f6135fc565b60405290565b60405160c0810167ffffffffffffffff8111828210171561364f5761364f6135fc565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156136bf576136bf6135fc565b604052919050565b801515811461179157600080fd5b803561322c816136c7565b80356fffffffffffffffffffffffffffffffff8116811461322c57600080fd5b60006060828403121561371257600080fd5b6040516060810181811067ffffffffffffffff82111715613735576137356135fc565b6040529050808235613746816136c7565b8152613754602084016136e0565b6020820152613765604084016136e0565b60408201525092915050565b600080600060e0848603121561378657600080fd5b61378f84613214565b925061379e8560208601613700565b91506137ad8560808601613700565b90509250925092565b600080602083850312156137c957600080fd5b823567ffffffffffffffff8111156137e057600080fd5b6137ec85828601613353565b90969095509350505050565b600181811c9082168061380c57607f821691505b602082108103613845577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b600067ffffffffffffffff821115613865576138656135fc565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f8301126138a257600080fd5b81356138b56138b08261384b565b613678565b8181528460208386010111156138ca57600080fd5b816020850160208301376000918101602001919091529392505050565b600061010082360312156138fa57600080fd5b61390261362b565b823567ffffffffffffffff8082111561391a57600080fd5b61392636838701613891565b835261393460208601613214565b6020840152613945604086016132ef565b604084015260608501356060840152613960608086016132ef565b608084015260a085013591508082111561397957600080fd5b61398536838701613891565b60a084015260c085013591508082111561399e57600080fd5b6139aa36838701613891565b60c084015260e08501359150808211156139c357600080fd5b506139d036828601613891565b60e08301525092915050565b601f8211156112f5576000816000526020600020601f850160051c81016020861015613a055750805b601f850160051c820191505b81811015613a2457828155600101613a11565b505050505050565b67ffffffffffffffff831115613a4457613a446135fc565b613a5883613a5283546137f8565b836139dc565b6000601f841160018114613aaa5760008515613a745750838201355b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b1c1916600186901b178355611a5c565b6000838152602090207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0861690835b82811015613af95786850135825560209485019460019092019101613ad9565b5086821015613b34577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60f88860031b161c19848701351681555b505060018560011b0183555050505050565b604081526000613b596040830186613270565b82810360208401528381528385602083013760006020858301015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f860116820101915050949350505050565b600060208284031215613bbc57600080fd5b8151610ce5816136c7565b600060a08236031215613bd957600080fd5b60405160a0810167ffffffffffffffff8282108183111715613bfd57613bfd6135fc565b816040528435915080821115613c1257600080fd5b50613c1f36828601613891565b825250613c2e60208401613214565b60208201526040830135613c41816132cd565b6040820152606083810135908201526080830135613c5e816132cd565b608082015292915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec1833603018112613ccc57600080fd5b9190910192915050565b60006101408236031215613ce957600080fd5b613cf1613655565b613cfa83613214565b8152613d08602084016136d5565b6020820152604083013567ffffffffffffffff80821115613d2857600080fd5b613d3436838701613891565b60408401526060850135915080821115613d4d57600080fd5b50613d5a36828601613891565b606083015250613d6d3660808501613700565b6080820152613d7f3660e08501613700565b60a082015292915050565b815167ffffffffffffffff811115613da457613da46135fc565b613db881613db284546137f8565b846139dc565b602080601f831160018114613e0b5760008415613dd55750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555613a24565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b82811015613e5857888601518255948401946001909101908401613e39565b5085821015613e9457878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b600061010067ffffffffffffffff87168352806020840152613ec881840187613270565b8551151560408581019190915260208701516fffffffffffffffffffffffffffffffff9081166060870152908701511660808501529150613f069050565b8251151560a083015260208301516fffffffffffffffffffffffffffffffff90811660c084015260408401511660e0830152613557565b60a081526000613f5060a0830187613270565b73ffffffffffffffffffffffffffffffffffffffff8616602084015284604084015267ffffffffffffffff841660608401528281036080840152600081526020810191505095945050505050565b73ffffffffffffffffffffffffffffffffffffffff8516815260a060208201526000613fcd60a0830186613270565b60408301949094525067ffffffffffffffff9190911660608201528082036080909101526000815260200192915050565b60006020828403121561401057600080fd5b815167ffffffffffffffff81111561402757600080fd5b8201601f8101841361403857600080fd5b80516140466138b08261384b565b81815285602083850101111561405b57600080fd5b61355782602083016020860161324c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156106765761067661406c565b67ffffffffffffffff8416815260e081016140fa60208301858051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b82511515608083015260208301516fffffffffffffffffffffffffffffffff90811660a084015260408401511660c0830152612853565b6060810161067682848051151582526020808201516fffffffffffffffffffffffffffffffff9081169184019190915260409182015116910152565b60006020828403121561417f57600080fd5b8151610ce5816132cd565b80820281158282048414176106765761067661406c565b808201808211156106765761067661406c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600082614219577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008251613ccc81846020870161324c56fea164736f6c6343000818000a" - -type BurnMintTokenPoolAndProxyContract struct { - address common.Address - abi abi.ABI - backend bind.ContractBackend - contract *bind.BoundContract -} - -func NewBurnMintTokenPoolAndProxyContract( - address common.Address, - backend bind.ContractBackend, -) (*BurnMintTokenPoolAndProxyContract, error) { - parsed, err := abi.JSON(strings.NewReader(BurnMintTokenPoolAndProxyABI)) - if err != nil { - return nil, err - } - return &BurnMintTokenPoolAndProxyContract{ - address: address, - abi: parsed, - backend: backend, - contract: bind.NewBoundContract(address, parsed, backend, backend, backend), - }, nil -} - -func (c *BurnMintTokenPoolAndProxyContract) Address() common.Address { - return c.address -} - -func (c *BurnMintTokenPoolAndProxyContract) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []any - err := c.contract.Call(opts, &out, "owner") - if err != nil { - return common.Address{}, err - } - return *abi.ConvertType(out[0], new(common.Address)).(*common.Address), nil -} - -func (c *BurnMintTokenPoolAndProxyContract) GetRemotePool(opts *bind.CallOpts, args uint64) ([]byte, error) { - var out []any - err := c.contract.Call(opts, &out, "getRemotePool", args) - if err != nil { - var zero []byte - return zero, err - } - return *abi.ConvertType(out[0], new([]byte)).(*[]byte), nil -} - -func (c *BurnMintTokenPoolAndProxyContract) GetCurrentInboundRateLimiterState(opts *bind.CallOpts, args uint64) (TokenBucket, error) { - var out []any - err := c.contract.Call(opts, &out, "getCurrentInboundRateLimiterState", args) - if err != nil { - var zero TokenBucket - return zero, err - } - return *abi.ConvertType(out[0], new(TokenBucket)).(*TokenBucket), nil -} - -func (c *BurnMintTokenPoolAndProxyContract) GetCurrentOutboundRateLimiterState(opts *bind.CallOpts, args uint64) (TokenBucket, error) { - var out []any - err := c.contract.Call(opts, &out, "getCurrentOutboundRateLimiterState", args) - if err != nil { - var zero TokenBucket - return zero, err - } - return *abi.ConvertType(out[0], new(TokenBucket)).(*TokenBucket), nil -} - -func (c *BurnMintTokenPoolAndProxyContract) GetPreviousPool(opts *bind.CallOpts) (common.Address, error) { - var out []any - err := c.contract.Call(opts, &out, "getPreviousPool") - if err != nil { - var zero common.Address - return zero, err - } - return *abi.ConvertType(out[0], new(common.Address)).(*common.Address), nil -} - -type TokenBucket struct { - Tokens *big.Int - LastUpdated uint32 - IsEnabled bool - Capacity *big.Int - Rate *big.Int -} - type ConstructorArgs struct { - Token common.Address - Allowlist []common.Address - RmnProxy common.Address - Router common.Address + Token common.Address `json:"token"` + Allowlist []common.Address `json:"allowlist"` + RmnProxy common.Address `json:"rmnProxy"` + Router common.Address `json:"router"` } var Deploy = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ - Name: "burn-mint-token-pool-and-proxy:deploy", - Version: Version, - Description: "Deploys the BurnMintTokenPoolAndProxy contract", - ContractMetadata: &bind.MetaData{ - ABI: BurnMintTokenPoolAndProxyABI, - Bin: BurnMintTokenPoolAndProxyBin, - }, + Name: "burn-mint-token-pool-and-proxy:deploy", + Version: Version, + Description: "Deploys the BurnMintTokenPoolAndProxy contract", + ContractMetadata: gobindings.BurnMintTokenPoolAndProxyMetaData, BytecodeByTypeAndVersion: map[string]contract.Bytecode{ cldf_deployment.NewTypeAndVersion(ContractType, *Version).String(): { - EVM: common.FromHex(BurnMintTokenPoolAndProxyBin), + EVM: common.FromHex(gobindings.BurnMintTokenPoolAndProxyMetaData.Bin), }, }, - Validate: func(ConstructorArgs) error { return nil }, }) -var GetRemotePool = contract.NewRead(contract.ReadParams[uint64, []byte, *BurnMintTokenPoolAndProxyContract]{ - Name: "burn-mint-token-pool-and-proxy:get-remote-pool", - Version: Version, - Description: "Calls getRemotePool on the contract", - ContractType: ContractType, - NewContract: NewBurnMintTokenPoolAndProxyContract, - CallContract: func(c *BurnMintTokenPoolAndProxyContract, opts *bind.CallOpts, args uint64) ([]byte, error) { - return c.GetRemotePool(opts, args) - }, -}) +func NewReadGetRemotePool(c gobindings.BurnMintTokenPoolAndProxyInterface) *cld_ops.Operation[contract.FunctionInput[uint64], []byte, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[uint64, []byte, gobindings.BurnMintTokenPoolAndProxyInterface]{ + Name: "burn-mint-token-pool-and-proxy:get-remote-pool", + Version: Version, + Description: "Calls getRemotePool on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.BurnMintTokenPoolAndProxyInterface, opts *bind.CallOpts, args uint64) ([]byte, error) { + return c.GetRemotePool(opts, args) + }, + }) +} -var GetCurrentInboundRateLimiterState = contract.NewRead(contract.ReadParams[uint64, TokenBucket, *BurnMintTokenPoolAndProxyContract]{ - Name: "burn-mint-token-pool-and-proxy:get-current-inbound-rate-limiter-state", - Version: Version, - Description: "Calls getCurrentInboundRateLimiterState on the contract", - ContractType: ContractType, - NewContract: NewBurnMintTokenPoolAndProxyContract, - CallContract: func(c *BurnMintTokenPoolAndProxyContract, opts *bind.CallOpts, args uint64) (TokenBucket, error) { - return c.GetCurrentInboundRateLimiterState(opts, args) - }, -}) +func NewReadGetCurrentInboundRateLimiterState(c gobindings.BurnMintTokenPoolAndProxyInterface) *cld_ops.Operation[contract.FunctionInput[uint64], gobindings.RateLimiterTokenBucket, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[uint64, gobindings.RateLimiterTokenBucket, gobindings.BurnMintTokenPoolAndProxyInterface]{ + Name: "burn-mint-token-pool-and-proxy:get-current-inbound-rate-limiter-state", + Version: Version, + Description: "Calls getCurrentInboundRateLimiterState on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.BurnMintTokenPoolAndProxyInterface, opts *bind.CallOpts, args uint64) (gobindings.RateLimiterTokenBucket, error) { + return c.GetCurrentInboundRateLimiterState(opts, args) + }, + }) +} -var GetCurrentOutboundRateLimiterState = contract.NewRead(contract.ReadParams[uint64, TokenBucket, *BurnMintTokenPoolAndProxyContract]{ - Name: "burn-mint-token-pool-and-proxy:get-current-outbound-rate-limiter-state", - Version: Version, - Description: "Calls getCurrentOutboundRateLimiterState on the contract", - ContractType: ContractType, - NewContract: NewBurnMintTokenPoolAndProxyContract, - CallContract: func(c *BurnMintTokenPoolAndProxyContract, opts *bind.CallOpts, args uint64) (TokenBucket, error) { - return c.GetCurrentOutboundRateLimiterState(opts, args) - }, -}) +func NewReadGetCurrentOutboundRateLimiterState(c gobindings.BurnMintTokenPoolAndProxyInterface) *cld_ops.Operation[contract.FunctionInput[uint64], gobindings.RateLimiterTokenBucket, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[uint64, gobindings.RateLimiterTokenBucket, gobindings.BurnMintTokenPoolAndProxyInterface]{ + Name: "burn-mint-token-pool-and-proxy:get-current-outbound-rate-limiter-state", + Version: Version, + Description: "Calls getCurrentOutboundRateLimiterState on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.BurnMintTokenPoolAndProxyInterface, opts *bind.CallOpts, args uint64) (gobindings.RateLimiterTokenBucket, error) { + return c.GetCurrentOutboundRateLimiterState(opts, args) + }, + }) +} -var GetPreviousPool = contract.NewRead(contract.ReadParams[struct{}, common.Address, *BurnMintTokenPoolAndProxyContract]{ - Name: "burn-mint-token-pool-and-proxy:get-previous-pool", - Version: Version, - Description: "Calls getPreviousPool on the contract", - ContractType: ContractType, - NewContract: NewBurnMintTokenPoolAndProxyContract, - CallContract: func(c *BurnMintTokenPoolAndProxyContract, opts *bind.CallOpts, args struct{}) (common.Address, error) { - return c.GetPreviousPool(opts) - }, -}) +func NewReadGetPreviousPool(c gobindings.BurnMintTokenPoolAndProxyInterface) *cld_ops.Operation[contract.FunctionInput[struct{}], common.Address, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[struct{}, common.Address, gobindings.BurnMintTokenPoolAndProxyInterface]{ + Name: "burn-mint-token-pool-and-proxy:get-previous-pool", + Version: Version, + Description: "Calls getPreviousPool on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.BurnMintTokenPoolAndProxyInterface, opts *bind.CallOpts, args struct{}) (common.Address, error) { + return c.GetPreviousPool(opts) + }, + }) +} diff --git a/chains/evm/deployment/v1_5_1/adapters/tokens.go b/chains/evm/deployment/v1_5_1/adapters/tokens.go index b272474344..5b35f1c6da 100644 --- a/chains/evm/deployment/v1_5_1/adapters/tokens.go +++ b/chains/evm/deployment/v1_5_1/adapters/tokens.go @@ -21,6 +21,7 @@ import ( cldf_chain "github.com/smartcontractkit/chainlink-deployments-framework/chain" "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" evm_contract "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations/contract" + ops2contract "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" ) @@ -121,11 +122,14 @@ func (t *TokenAdapter) ConfigureTokenForTransfersSequence() *cldf_ops.Sequence[t type poolOpsV151 struct{} func (p *poolOpsV151) GetToken(b cldf_ops.Bundle, chain evm.Chain, poolAddr common.Address) (common.Address, error) { + tp, err := token_pool.NewTokenPool(poolAddr, chain.Client) + if err != nil { + return common.Address{}, fmt.Errorf("failed to instantiate token pool v1.5.1 contract: %w", err) + } res, err := cldf_ops.ExecuteOperation(b, - tpOps.GetToken, chain, - evm_contract.FunctionInput[struct{}]{ - ChainSelector: chain.Selector, - Address: poolAddr, + tpOps.NewReadGetToken(tp), chain, + ops2contract.FunctionInput[struct{}]{ + Args: struct{}{}, }, ) if err != nil { @@ -175,18 +179,20 @@ func (p *poolOpsV151) SetRateLimiterConfig(b cldf_ops.Bundle, chain evm.Chain, p return nil, fmt.Errorf("inbound rate limiter config is enabled but rate and capacity are both zero") } + tp, err := token_pool.NewTokenPool(poolAddr, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to instantiate token pool v1.5.1 contract: %w", err) + } report, err := cldf_ops.ExecuteOperation(b, - tpOps.SetChainRateLimiterConfig, chain, - evm_contract.FunctionInput[tpOps.SetChainRateLimiterConfigArgs]{ - ChainSelector: chain.Selector, - Address: poolAddr, + tpOps.NewWriteSetChainRateLimiterConfig(tp), chain, + ops2contract.FunctionInput[tpOps.SetChainRateLimiterConfigArgs]{ Args: tpOps.SetChainRateLimiterConfigArgs{ - OutboundRateLimitConfig: token_pool.RateLimiterConfig{ + OutboundConfig: token_pool.RateLimiterConfig{ IsEnabled: outbound.IsEnabled, Capacity: outbound.Capacity, Rate: outbound.Rate, }, - InboundRateLimitConfig: token_pool.RateLimiterConfig{ + InboundConfig: token_pool.RateLimiterConfig{ IsEnabled: inbound.IsEnabled, Capacity: inbound.Capacity, Rate: inbound.Rate, @@ -197,23 +203,35 @@ func (p *poolOpsV151) SetRateLimiterConfig(b cldf_ops.Bundle, chain evm.Chain, p if err != nil { return nil, fmt.Errorf("SetChainRateLimiterConfig v1.5.1: %w", err) } - return []evm_contract.WriteOutput{report.Output}, nil + return []evm_contract.WriteOutput{writeOutputOps2ToOps(report.Output)}, nil } func (p *poolOpsV151) SetRateLimitAdmin(b cldf_ops.Bundle, chain evm.Chain, poolAddr common.Address, newAdmin common.Address) (evm_contract.WriteOutput, error) { + tp, err := token_pool.NewTokenPool(poolAddr, chain.Client) + if err != nil { + return evm_contract.WriteOutput{}, fmt.Errorf("failed to instantiate token pool v1.5.1 contract: %w", err) + } report, err := cldf_ops.ExecuteOperation(b, - tpOps.SetRateLimitAdmin, chain, - evm_contract.FunctionInput[tpOps.SetRateLimitAdminArgs]{ - ChainSelector: chain.Selector, - Address: poolAddr, - Args: tpOps.SetRateLimitAdminArgs{ - NewAdmin: newAdmin, - }, + tpOps.NewWriteSetRateLimitAdmin(tp), chain, + ops2contract.FunctionInput[common.Address]{ + Args: newAdmin, }) if err != nil { return evm_contract.WriteOutput{}, fmt.Errorf("SetRateLimitAdmin v1.5.1: %w", err) } - return report.Output, nil + return writeOutputOps2ToOps(report.Output), nil +} + +func writeOutputOps2ToOps(out ops2contract.WriteOutput) evm_contract.WriteOutput { + var execInfo *evm_contract.ExecInfo + if out.ExecInfo != nil { + execInfo = &evm_contract.ExecInfo{Hash: out.ExecInfo.Hash} + } + return evm_contract.WriteOutput{ + ChainSelector: out.ChainSelector, + Tx: out.Tx, + ExecInfo: execInfo, + } } func (p *poolOpsV151) GetCurrentInboundRateLimit(b cldf_ops.Bundle, chain evm.Chain, poolAddr common.Address, remoteSelector uint64) (tokensapi.RateLimiterConfig, error) { diff --git a/chains/evm/deployment/v1_5_1/operations/burn_from_mint_token_pool/burn_from_mint_token_pool.go b/chains/evm/deployment/v1_5_1/operations/burn_from_mint_token_pool/burn_from_mint_token_pool.go index 0f4c746593..3fb680dea0 100644 --- a/chains/evm/deployment/v1_5_1/operations/burn_from_mint_token_pool/burn_from_mint_token_pool.go +++ b/chains/evm/deployment/v1_5_1/operations/burn_from_mint_token_pool/burn_from_mint_token_pool.go @@ -1,37 +1,35 @@ +// Code generated by operations-gen. DO NOT EDIT. + package burn_from_mint_token_pool import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" - - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_from_mint_token_pool" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + gobindings "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_from_mint_token_pool" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" ) var ContractType cldf_deployment.ContractType = "BurnFromMintTokenPool" +var Version = semver.MustParse("1.5.1") var TypeAndVersion = cldf_deployment.NewTypeAndVersion(ContractType, *Version) -var Version *semver.Version = utils.Version_1_5_1 - type ConstructorArgs struct { - Token common.Address // The token managed by this pool - LocalTokenDecimals uint8 // The token decimals on the local chain - Allowlist []common.Address // List of addresses allowed to trigger lockOrBurn - RmnProxy common.Address // The RMN proxy address - Router common.Address // The router address + Token common.Address `json:"token"` + LocalTokenDecimals uint8 `json:"localTokenDecimals"` + Allowlist []common.Address `json:"allowlist"` + RmnProxy common.Address `json:"rmnProxy"` + Router common.Address `json:"router"` } var Deploy = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ - Name: "burn_from_mint_token_pool:deploy", + Name: "burn-from-mint-token-pool:deploy", Version: Version, Description: "Deploys the BurnFromMintTokenPool contract", - ContractMetadata: burn_from_mint_token_pool.BurnFromMintTokenPoolMetaData, + ContractMetadata: gobindings.BurnFromMintTokenPoolMetaData, BytecodeByTypeAndVersion: map[string]contract.Bytecode{ cldf_deployment.NewTypeAndVersion(ContractType, *Version).String(): { - EVM: common.FromHex(burn_from_mint_token_pool.BurnFromMintTokenPoolBin), + EVM: common.FromHex(gobindings.BurnFromMintTokenPoolMetaData.Bin), }, }, - Validate: func(args ConstructorArgs) error { return nil }, }) diff --git a/chains/evm/deployment/v1_5_1/operations/burn_mint_token_pool/burn_mint_token_pool.go b/chains/evm/deployment/v1_5_1/operations/burn_mint_token_pool/burn_mint_token_pool.go index bac1781a5a..2bb35ece58 100644 --- a/chains/evm/deployment/v1_5_1/operations/burn_mint_token_pool/burn_mint_token_pool.go +++ b/chains/evm/deployment/v1_5_1/operations/burn_mint_token_pool/burn_mint_token_pool.go @@ -1,37 +1,35 @@ +// Code generated by operations-gen. DO NOT EDIT. + package burn_mint_token_pool import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" - - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_mint_token_pool" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + gobindings "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_mint_token_pool" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" ) var ContractType cldf_deployment.ContractType = "BurnMintTokenPool" +var Version = semver.MustParse("1.5.1") var TypeAndVersion = cldf_deployment.NewTypeAndVersion(ContractType, *Version) -var Version *semver.Version = utils.Version_1_5_1 - type ConstructorArgs struct { - Token common.Address // The token managed by this pool - LocalTokenDecimals uint8 // The token decimals on the local chain - Allowlist []common.Address // List of addresses allowed to trigger lockOrBurn - RmnProxy common.Address // The RMN proxy address - Router common.Address // The router address + Token common.Address `json:"token"` + LocalTokenDecimals uint8 `json:"localTokenDecimals"` + Allowlist []common.Address `json:"allowlist"` + RmnProxy common.Address `json:"rmnProxy"` + Router common.Address `json:"router"` } var Deploy = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ - Name: "burn_mint_token_pool:deploy", + Name: "burn-mint-token-pool:deploy", Version: Version, Description: "Deploys the BurnMintTokenPool contract", - ContractMetadata: burn_mint_token_pool.BurnMintTokenPoolMetaData, + ContractMetadata: gobindings.BurnMintTokenPoolMetaData, BytecodeByTypeAndVersion: map[string]contract.Bytecode{ cldf_deployment.NewTypeAndVersion(ContractType, *Version).String(): { - EVM: common.FromHex(burn_mint_token_pool.BurnMintTokenPoolBin), + EVM: common.FromHex(gobindings.BurnMintTokenPoolMetaData.Bin), }, }, - Validate: func(args ConstructorArgs) error { return nil }, }) diff --git a/chains/evm/deployment/v1_5_1/operations/burn_to_address_mint_token_pool/burn_to_address_mint_token_pool.go b/chains/evm/deployment/v1_5_1/operations/burn_to_address_mint_token_pool/burn_to_address_mint_token_pool.go index c85c34d1fa..acff7e458d 100644 --- a/chains/evm/deployment/v1_5_1/operations/burn_to_address_mint_token_pool/burn_to_address_mint_token_pool.go +++ b/chains/evm/deployment/v1_5_1/operations/burn_to_address_mint_token_pool/burn_to_address_mint_token_pool.go @@ -1,38 +1,36 @@ +// Code generated by operations-gen. DO NOT EDIT. + package burn_to_address_mint_token_pool import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" - - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_to_address_mint_token_pool" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + gobindings "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_to_address_mint_token_pool" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" ) var ContractType cldf_deployment.ContractType = "BurnToAddressMintTokenPool" +var Version = semver.MustParse("1.5.1") var TypeAndVersion = cldf_deployment.NewTypeAndVersion(ContractType, *Version) -var Version *semver.Version = utils.Version_1_5_1 - type ConstructorArgs struct { - Token common.Address // The token managed by this pool - LocalTokenDecimals uint8 // The token decimals on the local chain - Allowlist []common.Address // List of addresses allowed to trigger lockOrBurn - RmnProxy common.Address // The RMN proxy address - Router common.Address // The router address - BurnAddress common.Address // The address to burn tokens to + Token common.Address `json:"token"` + LocalTokenDecimals uint8 `json:"localTokenDecimals"` + Allowlist []common.Address `json:"allowlist"` + RmnProxy common.Address `json:"rmnProxy"` + Router common.Address `json:"router"` + BurnAddress common.Address `json:"burnAddress"` } var Deploy = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ - Name: "burn_to_address_mint_token_pool:deploy", + Name: "burn-to-address-mint-token-pool:deploy", Version: Version, Description: "Deploys the BurnToAddressMintTokenPool contract", - ContractMetadata: burn_to_address_mint_token_pool.BurnToAddressMintTokenPoolMetaData, + ContractMetadata: gobindings.BurnToAddressMintTokenPoolMetaData, BytecodeByTypeAndVersion: map[string]contract.Bytecode{ cldf_deployment.NewTypeAndVersion(ContractType, *Version).String(): { - EVM: common.FromHex(burn_to_address_mint_token_pool.BurnToAddressMintTokenPoolBin), + EVM: common.FromHex(gobindings.BurnToAddressMintTokenPoolMetaData.Bin), }, }, - Validate: func(args ConstructorArgs) error { return nil }, }) diff --git a/chains/evm/deployment/v1_5_1/operations/burn_with_from_mint_token_pool/burn_with_from_mint_token_pool.go b/chains/evm/deployment/v1_5_1/operations/burn_with_from_mint_token_pool/burn_with_from_mint_token_pool.go index 39fad0c7da..4623e5fdab 100644 --- a/chains/evm/deployment/v1_5_1/operations/burn_with_from_mint_token_pool/burn_with_from_mint_token_pool.go +++ b/chains/evm/deployment/v1_5_1/operations/burn_with_from_mint_token_pool/burn_with_from_mint_token_pool.go @@ -1,37 +1,35 @@ +// Code generated by operations-gen. DO NOT EDIT. + package burn_with_from_mint_token_pool import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" - - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_with_from_mint_token_pool" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + gobindings "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/burn_with_from_mint_token_pool" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" ) var ContractType cldf_deployment.ContractType = "BurnWithFromMintTokenPool" +var Version = semver.MustParse("1.5.1") var TypeAndVersion = cldf_deployment.NewTypeAndVersion(ContractType, *Version) -var Version *semver.Version = utils.Version_1_5_1 - type ConstructorArgs struct { - Token common.Address // The token managed by this pool - LocalTokenDecimals uint8 // The token decimals on the local chain - Allowlist []common.Address // List of addresses allowed to trigger lockOrBurn - RmnProxy common.Address // The RMN proxy address - Router common.Address // The router address + Token common.Address `json:"token"` + LocalTokenDecimals uint8 `json:"localTokenDecimals"` + Allowlist []common.Address `json:"allowlist"` + RmnProxy common.Address `json:"rmnProxy"` + Router common.Address `json:"router"` } var Deploy = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ - Name: "burn_with_from_mint_token_pool:deploy", + Name: "burn-with-from-mint-token-pool:deploy", Version: Version, Description: "Deploys the BurnWithFromMintTokenPool contract", - ContractMetadata: burn_with_from_mint_token_pool.BurnWithFromMintTokenPoolMetaData, + ContractMetadata: gobindings.BurnWithFromMintTokenPoolMetaData, BytecodeByTypeAndVersion: map[string]contract.Bytecode{ cldf_deployment.NewTypeAndVersion(ContractType, *Version).String(): { - EVM: common.FromHex(burn_with_from_mint_token_pool.BurnWithFromMintTokenPoolBin), + EVM: common.FromHex(gobindings.BurnWithFromMintTokenPoolMetaData.Bin), }, }, - Validate: func(args ConstructorArgs) error { return nil }, }) diff --git a/chains/evm/deployment/v1_5_1/operations/lock_release_token_pool/lock_release_token_pool.go b/chains/evm/deployment/v1_5_1/operations/lock_release_token_pool/lock_release_token_pool.go index cb580fbda1..bb209cc085 100644 --- a/chains/evm/deployment/v1_5_1/operations/lock_release_token_pool/lock_release_token_pool.go +++ b/chains/evm/deployment/v1_5_1/operations/lock_release_token_pool/lock_release_token_pool.go @@ -1,38 +1,36 @@ +// Code generated by operations-gen. DO NOT EDIT. + package lock_release_token_pool import ( "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/common" - - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/lock_release_token_pool" - "github.com/smartcontractkit/chainlink-ccip/deployment/utils" + gobindings "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/lock_release_token_pool" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" ) var ContractType cldf_deployment.ContractType = "LockReleaseTokenPool" +var Version = semver.MustParse("1.5.1") var TypeAndVersion = cldf_deployment.NewTypeAndVersion(ContractType, *Version) -var Version *semver.Version = utils.Version_1_5_1 - type ConstructorArgs struct { - Token common.Address // The token managed by this pool - LocalTokenDecimals uint8 // The token decimals on the local chain - Allowlist []common.Address // List of addresses allowed to trigger lockOrBurn - RmnProxy common.Address // The RMN proxy address - AcceptLiquidity bool // Whether the pool should accept liquidity - Router common.Address // The router address + Token common.Address `json:"token"` + LocalTokenDecimals uint8 `json:"localTokenDecimals"` + Allowlist []common.Address `json:"allowlist"` + RmnProxy common.Address `json:"rmnProxy"` + AcceptLiquidity bool `json:"acceptLiquidity"` + Router common.Address `json:"router"` } var Deploy = contract.NewDeploy(contract.DeployParams[ConstructorArgs]{ - Name: "lock_release_token_pool:deploy", + Name: "lock-release-token-pool:deploy", Version: Version, Description: "Deploys the LockReleaseTokenPool contract", - ContractMetadata: lock_release_token_pool.LockReleaseTokenPoolMetaData, + ContractMetadata: gobindings.LockReleaseTokenPoolMetaData, BytecodeByTypeAndVersion: map[string]contract.Bytecode{ cldf_deployment.NewTypeAndVersion(ContractType, *Version).String(): { - EVM: common.FromHex(lock_release_token_pool.LockReleaseTokenPoolBin), + EVM: common.FromHex(gobindings.LockReleaseTokenPoolMetaData.Bin), }, }, - Validate: func(args ConstructorArgs) error { return nil }, }) diff --git a/chains/evm/deployment/v1_5_1/operations/token_pool/token_pool.go b/chains/evm/deployment/v1_5_1/operations/token_pool/token_pool.go index c9a8c1b6e0..4ccde1ceff 100644 --- a/chains/evm/deployment/v1_5_1/operations/token_pool/token_pool.go +++ b/chains/evm/deployment/v1_5_1/operations/token_pool/token_pool.go @@ -1,120 +1,237 @@ +// Code generated by operations-gen. DO NOT EDIT. + package token_pool import ( - "fmt" - "github.com/Masterminds/semver/v3" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" - - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + gobindings "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_1/token_pool" + cldf_evm "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" + "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_deployment "github.com/smartcontractkit/chainlink-deployments-framework/deployment" + cld_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" ) -var ( - ContractType cldf_deployment.ContractType = "TokenPool" - Version *semver.Version = semver.MustParse("1.5.1") -) +var ContractType cldf_deployment.ContractType = "TokenPool" +var Version = semver.MustParse("1.5.1") +var TypeAndVersion = cldf_deployment.NewTypeAndVersion(ContractType, *Version) type ApplyChainUpdatesArgs struct { - RemoteChainSelectorsToRemove []uint64 - ChainsToAdd []token_pool.TokenPoolChainUpdate + RemoteChainSelectorsToRemove []uint64 `json:"remoteChainSelectorsToRemove"` + ChainsToAdd []gobindings.TokenPoolChainUpdate `json:"chainsToAdd"` } type SetChainRateLimiterConfigArgs struct { - RemoteChainSelector uint64 - OutboundRateLimitConfig token_pool.RateLimiterConfig - InboundRateLimitConfig token_pool.RateLimiterConfig + RemoteChainSelector uint64 `json:"remoteChainSelector"` + OutboundConfig gobindings.RateLimiterConfig `json:"outboundConfig"` + InboundConfig gobindings.RateLimiterConfig `json:"inboundConfig"` } type AddRemotePoolArgs struct { - RemoteChainSelector uint64 - RemotePoolAddress []byte -} - -type SetRateLimitAdminArgs struct { - NewAdmin common.Address -} - -var GetToken = contract.NewRead(contract.ReadParams[struct{}, common.Address, *token_pool.TokenPool]{ - Name: "token-pool:get-token", - Version: Version, - Description: "Gets the token address managed by the TokenPool 1.5.1 contract", - ContractType: ContractType, - NewContract: token_pool.NewTokenPool, - CallContract: func(tp *token_pool.TokenPool, opts *bind.CallOpts, args struct{}) (common.Address, error) { - return tp.GetToken(opts) - }, -}) - -var ApplyChainUpdates = contract.NewWrite(contract.WriteParams[ApplyChainUpdatesArgs, *token_pool.TokenPool]{ - Name: "token-pool:apply-chain-updates", - Version: Version, - Description: "Applies chain updates to the TokenPool 1.5.1 contract", - ContractType: ContractType, - ContractABI: token_pool.TokenPoolABI, - NewContract: token_pool.NewTokenPool, - IsAllowedCaller: contract.OnlyOwner[*token_pool.TokenPool, ApplyChainUpdatesArgs], - Validate: func(args ApplyChainUpdatesArgs) error { return nil }, - CallContract: func(tp *token_pool.TokenPool, opts *bind.TransactOpts, args ApplyChainUpdatesArgs) (*types.Transaction, error) { - return tp.ApplyChainUpdates(opts, args.RemoteChainSelectorsToRemove, args.ChainsToAdd) - }, -}) - -var SetChainRateLimiterConfig = contract.NewWrite(contract.WriteParams[SetChainRateLimiterConfigArgs, *token_pool.TokenPool]{ - Name: "token-pool:set-chain-rate-limiter-config", - Version: Version, - Description: "Sets the rate limiter configuration for a remote chain on the TokenPool 1.5.1 contract", - ContractType: ContractType, - ContractABI: token_pool.TokenPoolABI, - NewContract: token_pool.NewTokenPool, - IsAllowedCaller: func(tp *token_pool.TokenPool, opts *bind.CallOpts, caller common.Address, input SetChainRateLimiterConfigArgs) (bool, error) { - admin, err := tp.GetRateLimitAdmin(opts) - if err != nil { - return false, fmt.Errorf("failed to get rate limit admin for pool at address %q: %w", tp.Address().Hex(), err) - } - - owner, err := tp.Owner(opts) - if err != nil { - return false, fmt.Errorf("failed to get owner for pool at address %q: %w", tp.Address().Hex(), err) - } - - // Rate limit config can be set by either the rate limit admin or the owner - return caller.Cmp(admin) == 0 || caller.Cmp(owner) == 0, nil - }, - Validate: func(args SetChainRateLimiterConfigArgs) error { return nil }, - CallContract: func(tp *token_pool.TokenPool, opts *bind.TransactOpts, args SetChainRateLimiterConfigArgs) (*types.Transaction, error) { - return tp.SetChainRateLimiterConfig(opts, args.RemoteChainSelector, args.OutboundRateLimitConfig, args.InboundRateLimitConfig) - }, -}) - -var AddRemotePool = contract.NewWrite(contract.WriteParams[AddRemotePoolArgs, *token_pool.TokenPool]{ - Name: "token-pool:add-remote-pool", - Version: Version, - Description: "Adds a remote pool for a given chain selector on the TokenPool 1.5.1 contract", - ContractType: ContractType, - ContractABI: token_pool.TokenPoolABI, - NewContract: token_pool.NewTokenPool, - IsAllowedCaller: contract.OnlyOwner[*token_pool.TokenPool, AddRemotePoolArgs], - Validate: func(args AddRemotePoolArgs) error { return nil }, - CallContract: func(tp *token_pool.TokenPool, opts *bind.TransactOpts, args AddRemotePoolArgs) (*types.Transaction, error) { - return tp.AddRemotePool(opts, args.RemoteChainSelector, args.RemotePoolAddress) - }, -}) - -var SetRateLimitAdmin = contract.NewWrite(contract.WriteParams[SetRateLimitAdminArgs, *token_pool.TokenPool]{ - Name: "token-pool:set-rate-limit-admin", - Version: Version, - Description: "Sets the rate limit admin for the TokenPool 1.5.1 contract", - ContractType: ContractType, - ContractABI: token_pool.TokenPoolABI, - NewContract: token_pool.NewTokenPool, - IsAllowedCaller: contract.OnlyOwner[*token_pool.TokenPool, SetRateLimitAdminArgs], - Validate: func(args SetRateLimitAdminArgs) error { return nil }, - CallContract: func(tp *token_pool.TokenPool, opts *bind.TransactOpts, args SetRateLimitAdminArgs) (*types.Transaction, error) { - return tp.SetRateLimitAdmin(opts, args.NewAdmin) - }, -}) + RemoteChainSelector uint64 `json:"remoteChainSelector"` + RemotePoolAddress []byte `json:"remotePoolAddress"` +} + +func NewWriteApplyChainUpdates(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[ApplyChainUpdatesArgs], contract.WriteOutput, cldf_evm.Chain] { + return contract.NewWrite(contract.WriteParams[ApplyChainUpdatesArgs, gobindings.TokenPoolInterface]{ + Name: "token-pool:apply-chain-updates", + Version: Version, + Description: "Calls applyChainUpdates on the contract", + ContractType: ContractType, + ContractABI: gobindings.TokenPoolMetaData.ABI, + Contract: c, + IsAllowedCaller: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, caller common.Address, args ApplyChainUpdatesArgs) (bool, error) { + return contract.OnlyOwner(c, opts, caller, args) + }, + CallContract: func( + c gobindings.TokenPoolInterface, + opts *bind.TransactOpts, + args ApplyChainUpdatesArgs, + ) (*types.Transaction, error) { + return c.ApplyChainUpdates(opts, args.RemoteChainSelectorsToRemove, args.ChainsToAdd) + }, + }) +} + +func NewWriteSetRateLimitAdmin(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[common.Address], contract.WriteOutput, cldf_evm.Chain] { + return contract.NewWrite(contract.WriteParams[common.Address, gobindings.TokenPoolInterface]{ + Name: "token-pool:set-rate-limit-admin", + Version: Version, + Description: "Calls setRateLimitAdmin on the contract", + ContractType: ContractType, + ContractABI: gobindings.TokenPoolMetaData.ABI, + Contract: c, + IsAllowedCaller: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, caller common.Address, args common.Address) (bool, error) { + return contract.OnlyOwner(c, opts, caller, args) + }, + CallContract: func( + c gobindings.TokenPoolInterface, + opts *bind.TransactOpts, + args common.Address, + ) (*types.Transaction, error) { + return c.SetRateLimitAdmin(opts, args) + }, + }) +} + +func NewReadGetRateLimitAdmin(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[struct{}], common.Address, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[struct{}, common.Address, gobindings.TokenPoolInterface]{ + Name: "token-pool:get-rate-limit-admin", + Version: Version, + Description: "Calls getRateLimitAdmin on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args struct{}) (common.Address, error) { + return c.GetRateLimitAdmin(opts) + }, + }) +} + +func NewWriteSetChainRateLimiterConfig(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[SetChainRateLimiterConfigArgs], contract.WriteOutput, cldf_evm.Chain] { + return contract.NewWrite(contract.WriteParams[SetChainRateLimiterConfigArgs, gobindings.TokenPoolInterface]{ + Name: "token-pool:set-chain-rate-limiter-config", + Version: Version, + Description: "Calls setChainRateLimiterConfig on the contract", + ContractType: ContractType, + ContractABI: gobindings.TokenPoolMetaData.ABI, + Contract: c, + IsAllowedCaller: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, caller common.Address, args SetChainRateLimiterConfigArgs) (bool, error) { + return contract.OnlyOwner(c, opts, caller, args) + }, + CallContract: func( + c gobindings.TokenPoolInterface, + opts *bind.TransactOpts, + args SetChainRateLimiterConfigArgs, + ) (*types.Transaction, error) { + return c.SetChainRateLimiterConfig(opts, args.RemoteChainSelector, args.OutboundConfig, args.InboundConfig) + }, + }) +} + +func NewReadGetToken(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[struct{}], common.Address, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[struct{}, common.Address, gobindings.TokenPoolInterface]{ + Name: "token-pool:get-token", + Version: Version, + Description: "Calls getToken on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args struct{}) (common.Address, error) { + return c.GetToken(opts) + }, + }) +} + +func NewReadGetTokenDecimals(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[struct{}], uint8, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[struct{}, uint8, gobindings.TokenPoolInterface]{ + Name: "token-pool:get-token-decimals", + Version: Version, + Description: "Calls getTokenDecimals on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args struct{}) (uint8, error) { + return c.GetTokenDecimals(opts) + }, + }) +} + +func NewReadIsSupportedToken(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[common.Address], bool, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[common.Address, bool, gobindings.TokenPoolInterface]{ + Name: "token-pool:is-supported-token", + Version: Version, + Description: "Calls isSupportedToken on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args common.Address) (bool, error) { + return c.IsSupportedToken(opts, args) + }, + }) +} + +func NewReadGetSupportedChains(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[struct{}], []uint64, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[struct{}, []uint64, gobindings.TokenPoolInterface]{ + Name: "token-pool:get-supported-chains", + Version: Version, + Description: "Calls getSupportedChains on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args struct{}) ([]uint64, error) { + return c.GetSupportedChains(opts) + }, + }) +} + +func NewReadGetRemoteToken(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[uint64], []byte, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[uint64, []byte, gobindings.TokenPoolInterface]{ + Name: "token-pool:get-remote-token", + Version: Version, + Description: "Calls getRemoteToken on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args uint64) ([]byte, error) { + return c.GetRemoteToken(opts, args) + }, + }) +} + +func NewReadGetRemotePools(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[uint64], [][]byte, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[uint64, [][]byte, gobindings.TokenPoolInterface]{ + Name: "token-pool:get-remote-pools", + Version: Version, + Description: "Calls getRemotePools on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args uint64) ([][]byte, error) { + return c.GetRemotePools(opts, args) + }, + }) +} + +func NewWriteAddRemotePool(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[AddRemotePoolArgs], contract.WriteOutput, cldf_evm.Chain] { + return contract.NewWrite(contract.WriteParams[AddRemotePoolArgs, gobindings.TokenPoolInterface]{ + Name: "token-pool:add-remote-pool", + Version: Version, + Description: "Calls addRemotePool on the contract", + ContractType: ContractType, + ContractABI: gobindings.TokenPoolMetaData.ABI, + Contract: c, + IsAllowedCaller: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, caller common.Address, args AddRemotePoolArgs) (bool, error) { + return contract.OnlyOwner(c, opts, caller, args) + }, + CallContract: func( + c gobindings.TokenPoolInterface, + opts *bind.TransactOpts, + args AddRemotePoolArgs, + ) (*types.Transaction, error) { + return c.AddRemotePool(opts, args.RemoteChainSelector, args.RemotePoolAddress) + }, + }) +} + +func NewReadGetCurrentInboundRateLimiterState(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[uint64], gobindings.RateLimiterTokenBucket, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[uint64, gobindings.RateLimiterTokenBucket, gobindings.TokenPoolInterface]{ + Name: "token-pool:get-current-inbound-rate-limiter-state", + Version: Version, + Description: "Calls getCurrentInboundRateLimiterState on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args uint64) (gobindings.RateLimiterTokenBucket, error) { + return c.GetCurrentInboundRateLimiterState(opts, args) + }, + }) +} + +func NewReadGetCurrentOutboundRateLimiterState(c gobindings.TokenPoolInterface) *cld_ops.Operation[contract.FunctionInput[uint64], gobindings.RateLimiterTokenBucket, cldf_evm.Chain] { + return contract.NewRead(contract.ReadParams[uint64, gobindings.RateLimiterTokenBucket, gobindings.TokenPoolInterface]{ + Name: "token-pool:get-current-outbound-rate-limiter-state", + Version: Version, + Description: "Calls getCurrentOutboundRateLimiterState on the contract", + ContractType: ContractType, + Contract: c, + CallContract: func(c gobindings.TokenPoolInterface, opts *bind.CallOpts, args uint64) (gobindings.RateLimiterTokenBucket, error) { + return c.GetCurrentOutboundRateLimiterState(opts, args) + }, + }) +} diff --git a/chains/evm/deployment/v1_5_1/sequences/deploy_token_pool.go b/chains/evm/deployment/v1_5_1/sequences/deploy_token_pool.go index 2402e6a8a5..3f36f14760 100644 --- a/chains/evm/deployment/v1_5_1/sequences/deploy_token_pool.go +++ b/chains/evm/deployment/v1_5_1/sequences/deploy_token_pool.go @@ -13,7 +13,7 @@ import ( cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" "github.com/smartcontractkit/chainlink-evm/gethwrappers/shared/generated/initial/burn_mint_erc20" - "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract" + ops2contract "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" rmnproxyops "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/rmn_proxy" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router" v1_5_1_burn_from_mint_token_pool "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_1/operations/burn_from_mint_token_pool" @@ -102,9 +102,8 @@ var DeployTokenPool = cldf_ops.NewSequence( switch typeAndVersion { case v1_5_1_burn_mint_token_pool.TypeAndVersion.String(): - poolRef, err = contract.MaybeDeployContract(b, v1_5_1_burn_mint_token_pool.Deploy, chain, contract.DeployInput[v1_5_1_burn_mint_token_pool.ConstructorArgs]{ + poolRef, err = ops2contract.MaybeDeployContract(b, v1_5_1_burn_mint_token_pool.Deploy, chain, ops2contract.DeployInput[v1_5_1_burn_mint_token_pool.ConstructorArgs]{ TypeAndVersion: v1_5_1_burn_mint_token_pool.TypeAndVersion, - ChainSelector: chain.Selector, Args: v1_5_1_burn_mint_token_pool.ConstructorArgs{ Token: common.HexToAddress(tokenAddr), LocalTokenDecimals: tokenDecimal, @@ -119,9 +118,8 @@ var DeployTokenPool = cldf_ops.NewSequence( } case v1_5_1_burn_from_mint_token_pool.TypeAndVersion.String(): - poolRef, err = contract.MaybeDeployContract(b, v1_5_1_burn_from_mint_token_pool.Deploy, chain, contract.DeployInput[v1_5_1_burn_from_mint_token_pool.ConstructorArgs]{ + poolRef, err = ops2contract.MaybeDeployContract(b, v1_5_1_burn_from_mint_token_pool.Deploy, chain, ops2contract.DeployInput[v1_5_1_burn_from_mint_token_pool.ConstructorArgs]{ TypeAndVersion: v1_5_1_burn_from_mint_token_pool.TypeAndVersion, - ChainSelector: chain.Selector, Args: v1_5_1_burn_from_mint_token_pool.ConstructorArgs{ Token: common.HexToAddress(tokenAddr), LocalTokenDecimals: tokenDecimal, @@ -136,9 +134,8 @@ var DeployTokenPool = cldf_ops.NewSequence( } case v1_5_1_burn_to_address_mint_token_pool.TypeAndVersion.String(): - poolRef, err = contract.MaybeDeployContract(b, v1_5_1_burn_to_address_mint_token_pool.Deploy, chain, contract.DeployInput[v1_5_1_burn_to_address_mint_token_pool.ConstructorArgs]{ + poolRef, err = ops2contract.MaybeDeployContract(b, v1_5_1_burn_to_address_mint_token_pool.Deploy, chain, ops2contract.DeployInput[v1_5_1_burn_to_address_mint_token_pool.ConstructorArgs]{ TypeAndVersion: v1_5_1_burn_to_address_mint_token_pool.TypeAndVersion, - ChainSelector: chain.Selector, Args: v1_5_1_burn_to_address_mint_token_pool.ConstructorArgs{ Token: common.HexToAddress(tokenAddr), LocalTokenDecimals: tokenDecimal, @@ -154,9 +151,8 @@ var DeployTokenPool = cldf_ops.NewSequence( } case v1_5_1_burn_with_from_mint_token_pool.TypeAndVersion.String(): - poolRef, err = contract.MaybeDeployContract(b, v1_5_1_burn_with_from_mint_token_pool.Deploy, chain, contract.DeployInput[v1_5_1_burn_with_from_mint_token_pool.ConstructorArgs]{ + poolRef, err = ops2contract.MaybeDeployContract(b, v1_5_1_burn_with_from_mint_token_pool.Deploy, chain, ops2contract.DeployInput[v1_5_1_burn_with_from_mint_token_pool.ConstructorArgs]{ TypeAndVersion: v1_5_1_burn_with_from_mint_token_pool.TypeAndVersion, - ChainSelector: chain.Selector, Args: v1_5_1_burn_with_from_mint_token_pool.ConstructorArgs{ Token: common.HexToAddress(tokenAddr), LocalTokenDecimals: tokenDecimal, @@ -171,9 +167,8 @@ var DeployTokenPool = cldf_ops.NewSequence( } case v1_5_1_lock_release_token_pool.TypeAndVersion.String(): - poolRef, err = contract.MaybeDeployContract(b, v1_5_1_lock_release_token_pool.Deploy, chain, contract.DeployInput[v1_5_1_lock_release_token_pool.ConstructorArgs]{ + poolRef, err = ops2contract.MaybeDeployContract(b, v1_5_1_lock_release_token_pool.Deploy, chain, ops2contract.DeployInput[v1_5_1_lock_release_token_pool.ConstructorArgs]{ TypeAndVersion: v1_5_1_lock_release_token_pool.TypeAndVersion, - ChainSelector: chain.Selector, Args: v1_5_1_lock_release_token_pool.ConstructorArgs{ Token: common.HexToAddress(tokenAddr), LocalTokenDecimals: tokenDecimal, @@ -192,7 +187,7 @@ var DeployTokenPool = cldf_ops.NewSequence( return sequences.OnChainOutput{}, fmt.Errorf("unsupported v1.5.1 token pool type and version: %s", typeAndVersion) } - batchOp, err := contract.NewBatchOperationFromWrites(nil) + batchOp, err := ops2contract.NewBatchOperationFromWrites(nil) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to create batch operation from writes: %w", err) } diff --git a/chains/evm/deployment/v1_5_1/sequences/token_pool/configure_token_pool_for_remote_chains.go b/chains/evm/deployment/v1_5_1/sequences/token_pool/configure_token_pool_for_remote_chains.go index 4c4f128fcf..4ad947abf4 100644 --- a/chains/evm/deployment/v1_5_1/sequences/token_pool/configure_token_pool_for_remote_chains.go +++ b/chains/evm/deployment/v1_5_1/sequences/token_pool/configure_token_pool_for_remote_chains.go @@ -17,6 +17,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/deployment/utils/sequences" "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations/contract" + ops2contract "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" mcms_types "github.com/smartcontractkit/mcms/types" ) @@ -195,7 +196,7 @@ var ConfigureTokenPoolForRemoteChain = cldf_ops.NewSequence( // Token pool remote chain configuration can vary depending on whether the remote // pool is or isn't supported. The different cases to consider are recorded below // in the code. - reportWrites := []contract.WriteOutput{} + reportWrites := []ops2contract.WriteOutput{} remotesToDel := []uint64{} if slices.Contains(sc, input.RemoteChainSelector) { remoteToken, err := tp.GetRemoteToken(&bind.CallOpts{Context: b.GetContext()}, input.RemoteChainSelector) @@ -254,13 +255,11 @@ var ConfigureTokenPoolForRemoteChain = cldf_ops.NewSequence( // If either rate limiter config is different, then update it if !isOutboundEqual || !isInboundEqual { - report, err := cldf_ops.ExecuteOperation(b, tpops.SetChainRateLimiterConfig, chain, contract.FunctionInput[tpops.SetChainRateLimiterConfigArgs]{ - ChainSelector: chain.Selector, - Address: input.TokenPoolAddress, + report, err := cldf_ops.ExecuteOperation(b, tpops.NewWriteSetChainRateLimiterConfig(tp), chain, ops2contract.FunctionInput[tpops.SetChainRateLimiterConfigArgs]{ Args: tpops.SetChainRateLimiterConfigArgs{ - OutboundRateLimitConfig: token_pool.RateLimiterConfig{IsEnabled: inputORL.IsEnabled, Capacity: inputORL.Capacity, Rate: inputORL.Rate}, - InboundRateLimitConfig: token_pool.RateLimiterConfig{IsEnabled: inputIRL.IsEnabled, Capacity: inputIRL.Capacity, Rate: inputIRL.Rate}, - RemoteChainSelector: remoteCS, + OutboundConfig: token_pool.RateLimiterConfig{IsEnabled: inputORL.IsEnabled, Capacity: inputORL.Capacity, Rate: inputORL.Rate}, + InboundConfig: token_pool.RateLimiterConfig{IsEnabled: inputIRL.IsEnabled, Capacity: inputIRL.Capacity, Rate: inputIRL.Rate}, + RemoteChainSelector: remoteCS, }, }) if err != nil { @@ -271,9 +270,7 @@ var ConfigureTokenPoolForRemoteChain = cldf_ops.NewSequence( // If the exact 32-byte remote pool address is not registered, add it if !hasRemoteTP { - report, err := cldf_ops.ExecuteOperation(b, tpops.AddRemotePool, chain, contract.FunctionInput[tpops.AddRemotePoolArgs]{ - ChainSelector: chain.Selector, - Address: input.TokenPoolAddress, + report, err := cldf_ops.ExecuteOperation(b, tpops.NewWriteAddRemotePool(tp), chain, ops2contract.FunctionInput[tpops.AddRemotePoolArgs]{ Args: tpops.AddRemotePoolArgs{ RemoteChainSelector: remoteCS, RemotePoolAddress: remoteTP, @@ -310,9 +307,7 @@ var ConfigureTokenPoolForRemoteChain = cldf_ops.NewSequence( // if len(reportWrites) == 0 { paddedRemoteTokenPoolAddress := common.LeftPadBytes(input.RemoteChainConfig.RemotePool, 32) - applyChainUpdatesInput := contract.FunctionInput[tpops.ApplyChainUpdatesArgs]{ - ChainSelector: chain.Selector, - Address: input.TokenPoolAddress, + applyChainUpdatesInput := ops2contract.FunctionInput[tpops.ApplyChainUpdatesArgs]{ Args: tpops.ApplyChainUpdatesArgs{ RemoteChainSelectorsToRemove: remotesToDel, ChainsToAdd: []token_pool.TokenPoolChainUpdate{ @@ -335,7 +330,7 @@ var ConfigureTokenPoolForRemoteChain = cldf_ops.NewSequence( }, } - report, err := cldf_ops.ExecuteOperation(b, tpops.ApplyChainUpdates, chain, applyChainUpdatesInput) + report, err := cldf_ops.ExecuteOperation(b, tpops.NewWriteApplyChainUpdates(tp), chain, applyChainUpdatesInput) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to apply chain updates: %w", err) } @@ -343,7 +338,7 @@ var ConfigureTokenPoolForRemoteChain = cldf_ops.NewSequence( reportWrites = append(reportWrites, report.Output) } - batchOp, err := contract.NewBatchOperationFromWrites(reportWrites) + batchOp, err := ops2contract.NewBatchOperationFromWrites(reportWrites) if err != nil { return sequences.OnChainOutput{}, fmt.Errorf("failed to create batch operation: %w", err) } diff --git a/chains/evm/deployment/v2_0_0/sequences/tokens/configure_token_pool_for_remote_chain.go b/chains/evm/deployment/v2_0_0/sequences/tokens/configure_token_pool_for_remote_chain.go index 50ac2ce7ae..8ff800ddd6 100644 --- a/chains/evm/deployment/v2_0_0/sequences/tokens/configure_token_pool_for_remote_chain.go +++ b/chains/evm/deployment/v2_0_0/sequences/tokens/configure_token_pool_for_remote_chain.go @@ -16,6 +16,7 @@ import ( fqops_v163 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_3/operations/fee_quoter" "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm" evm_contract "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations/contract" + ops2contract "github.com/smartcontractkit/chainlink-deployments-framework/chain/evm/operations2/contract" cldf_ops "github.com/smartcontractkit/chainlink-deployments-framework/operations" mcms_types "github.com/smartcontractkit/mcms/types" @@ -31,6 +32,7 @@ import ( "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_0_0/operations/type_and_version" token_pool_v150 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/burn_mint_token_pool_and_proxy" + bmtp_v150 "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/burn_mint_token_pool_and_proxy" "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_5_0/operations/token_admin_registry" token_pool_v161 "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_6_1/operations/token_pool" "github.com/smartcontractkit/chainlink-ccip/chains/evm/gobindings/generated/v1_5_0/evm_2_evm_onramp" @@ -515,11 +517,13 @@ func importConfigFromActivePoolV150( ) (*activePoolImportedConfig, error) { typeStr := string(tav.Type) poolForRateLimits := activePool + proxyPool, err := bmtp_v150.NewBurnMintTokenPoolAndProxy(activePool, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to instantiate burn mint token pool and proxy: %w", err) + } if strings.Contains(typeStr, "Proxy") { - prevReport, err := cldf_ops.ExecuteOperation(b, token_pool_v150.GetPreviousPool, chain, evm_contract.FunctionInput[struct{}]{ - ChainSelector: chainSelector, - Address: activePool, - Args: struct{}{}, + prevReport, err := cldf_ops.ExecuteOperation(b, token_pool_v150.NewReadGetPreviousPool(proxyPool), chain, ops2contract.FunctionInput[struct{}]{ + Args: struct{}{}, }) if err != nil { return nil, fmt.Errorf("failed to get previous pool from proxy: %w", err) @@ -558,26 +562,28 @@ func fetchRateLimitsAndRemotePoolV150( poolForRateLimits, poolForRemotePool common.Address, remoteChainSelector uint64, ) (*activePoolImportedConfig, error) { - inboundReport, err := cldf_ops.ExecuteOperation(b, token_pool_v150.GetCurrentInboundRateLimiterState, chain, evm_contract.FunctionInput[uint64]{ - ChainSelector: chainSelector, - Address: poolForRateLimits, - Args: remoteChainSelector, + ratePool, err := bmtp_v150.NewBurnMintTokenPoolAndProxy(poolForRateLimits, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to instantiate pool for rate limits: %w", err) + } + remotePoolContract, err := bmtp_v150.NewBurnMintTokenPoolAndProxy(poolForRemotePool, chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to instantiate pool for remote pool: %w", err) + } + inboundReport, err := cldf_ops.ExecuteOperation(b, token_pool_v150.NewReadGetCurrentInboundRateLimiterState(ratePool), chain, ops2contract.FunctionInput[uint64]{ + Args: remoteChainSelector, }) if err != nil { return nil, fmt.Errorf("failed to get inbound rate limiter state: %w", err) } - outboundReport, err := cldf_ops.ExecuteOperation(b, token_pool_v150.GetCurrentOutboundRateLimiterState, chain, evm_contract.FunctionInput[uint64]{ - ChainSelector: chainSelector, - Address: poolForRateLimits, - Args: remoteChainSelector, + outboundReport, err := cldf_ops.ExecuteOperation(b, token_pool_v150.NewReadGetCurrentOutboundRateLimiterState(ratePool), chain, ops2contract.FunctionInput[uint64]{ + Args: remoteChainSelector, }) if err != nil { return nil, fmt.Errorf("failed to get outbound rate limiter state: %w", err) } - remotePoolReport, err := cldf_ops.ExecuteOperation(b, token_pool_v150.GetRemotePool, chain, evm_contract.FunctionInput[uint64]{ - ChainSelector: chainSelector, - Address: poolForRemotePool, - Args: remoteChainSelector, + remotePoolReport, err := cldf_ops.ExecuteOperation(b, token_pool_v150.NewReadGetRemotePool(remotePoolContract), chain, ops2contract.FunctionInput[uint64]{ + Args: remoteChainSelector, }) if err != nil { return nil, fmt.Errorf("failed to get remote pool: %w", err) @@ -663,7 +669,7 @@ func scaleDecimalsInt(amount *big.Int, fromDecimals, toDecimals uint8) *big.Int } // tokenBucketV150ToRateLimiterConfig converts a 1.5.0 (proxy bindings) RateLimiterTokenBucket to tokens.RateLimiterConfig. -func tokenBucketV150ToRateLimiterConfig(b token_pool_v150.TokenBucket) *tokens.RateLimiterConfig { +func tokenBucketV150ToRateLimiterConfig(b bmtp_v150.RateLimiterTokenBucket) *tokens.RateLimiterConfig { return &tokens.RateLimiterConfig{ IsEnabled: b.IsEnabled, Capacity: new(big.Int).Set(b.Capacity),