From f9350f29793adf82f30e8de963c388901d573ec5 Mon Sep 17 00:00:00 2001 From: Aleksandr Bukata Date: Fri, 13 Dec 2024 12:36:43 +0000 Subject: [PATCH] fix --- contracts/foundry.toml | 5 ---- .../ccip/pools/LBTC/adapters/CLAdapter.sol | 25 +++++++++++++------ .../pools/LBTC/adapters/LombardTokenPool.sol | 10 ++------ core/gethwrappers/ccip/go_generate.go | 2 +- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/contracts/foundry.toml b/contracts/foundry.toml index 02cded087d..e1399964dd 100644 --- a/contracts/foundry.toml +++ b/contracts/foundry.toml @@ -11,16 +11,11 @@ libs = ['node_modules'] bytecode_hash = "none" ffi = false - - # default is zero, using a non-zero amount enables us to test e.g. billing based on gas prices. gas_price = 1 block_timestamp = 1234567890 block_number = 12345 -[etherscan] -base = { chain = 84532, key = "EKGEZWKTMIKZE7WWE5EYGY8ATB2ED4K5U8", url = "https://api-sepolia.basescan.org/api" } - [fmt] tab_width = 2 multiline_func_header = "params_first" diff --git a/contracts/src/v0.8/ccip/pools/LBTC/adapters/CLAdapter.sol b/contracts/src/v0.8/ccip/pools/LBTC/adapters/CLAdapter.sol index 77841fefad..318dcb91d4 100644 --- a/contracts/src/v0.8/ccip/pools/LBTC/adapters/CLAdapter.sol +++ b/contracts/src/v0.8/ccip/pools/LBTC/adapters/CLAdapter.sol @@ -40,16 +40,25 @@ contract CLAdapter is AbstractAdapter, Ownable { /// token pool implementation constructor( IBridge bridge_, - LombardTokenPool tokenPool_, - uint128 executionGasLimit_ - ) AbstractAdapter(bridge_) Ownable() { + uint128 executionGasLimit_, + // + address ccipRouter_, + address[] memory allowlist_, + address rmnProxy_, + bool attestationEnable_ + ) AbstractAdapter(bridge_) Ownable(_msgSender()) { _setExecutionGasLimit(executionGasLimit_); - tokenPool = tokenPool_; - emit CLTokenPoolDeployed(address(tokenPool)); - } - function setTokenPool(LombardTokenPool tokenPool_) external onlyOwner { - tokenPool = tokenPool_; + tokenPool = new LombardTokenPool( + IERC20(address(bridge_.lbtc())), + ccipRouter_, + allowlist_, + rmnProxy_, + CLAdapter(this), + attestationEnable_ + ); + tokenPool.transferOwnership(_msgSender()); + emit CLTokenPoolDeployed(address(tokenPool)); } /// USER ACTIONS /// diff --git a/contracts/src/v0.8/ccip/pools/LBTC/adapters/LombardTokenPool.sol b/contracts/src/v0.8/ccip/pools/LBTC/adapters/LombardTokenPool.sol index b031393f67..23cb02b0ef 100644 --- a/contracts/src/v0.8/ccip/pools/LBTC/adapters/LombardTokenPool.sol +++ b/contracts/src/v0.8/ccip/pools/LBTC/adapters/LombardTokenPool.sol @@ -20,16 +20,10 @@ contract LombardTokenPool is TokenPool { address ccipRouter_, address[] memory allowlist_, address rmnProxy_, + CLAdapter adapter_, bool attestationEnable_ - ) TokenPool(lbtc_, 8, allowlist_, rmnProxy_, ccipRouter_) { - isAttestationEnabled = attestationEnable_; - } - - function setAdapter(CLAdapter adapter_) external onlyOwner { + ) TokenPool(lbtc_, allowlist_, rmnProxy_, ccipRouter_) { adapter = adapter_; - } - - function setAttestationEnabled(bool attestationEnable_) external onlyOwner { isAttestationEnabled = attestationEnable_; } diff --git a/core/gethwrappers/ccip/go_generate.go b/core/gethwrappers/ccip/go_generate.go index ad3ac56418..d57df8d017 100644 --- a/core/gethwrappers/ccip/go_generate.go +++ b/core/gethwrappers/ccip/go_generate.go @@ -27,7 +27,7 @@ package ccip //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/TokenPool/TokenPool.abi ../../../contracts/solc/v0.8.24/TokenPool/TokenPool.bin TokenPool token_pool //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/USDCTokenPool/USDCTokenPool.abi ../../../contracts/solc/v0.8.24/USDCTokenPool/USDCTokenPool.bin USDCTokenPool usdc_token_pool //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/CLAdapter/CLAdapter.abi ../../../contracts/solc/v0.8.24/CLAdapter/CLAdapter.bin CLAdapter lbtc_adapter -//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/LombardTokenPool/LombardTokenPool.abi ../../../contracts/solc/v0.8.24/CLAdapter/LombardTokenPool.bin LombardTokenPool lbtc_token_pool +//go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/LombardTokenPool/LombardTokenPool.abi ../../../contracts/solc/v0.8.24/LombardTokenPool/LombardTokenPool.bin LombardTokenPool lbtc_token_pool // Helpers //go:generate go run ../generation/generate/wrap.go ../../../contracts/solc/v0.8.24/MockV3Aggregator/MockV3Aggregator.abi ../../../contracts/solc/v0.8.24/MockV3Aggregator/MockV3Aggregator.bin MockV3Aggregator mock_v3_aggregator_contract