From 3be724700a2c17b610b6bb5076db46e5b8f956ca Mon Sep 17 00:00:00 2001 From: RuslanProgrammer Date: Thu, 4 Jan 2024 11:57:45 +0100 Subject: [PATCH] fixed token bridge --- contracts/Distribution.sol | 2 +- contracts/L1Sender.sol | 4 ++-- deploy/2_token.migration.ts | 5 ++--- deploy/data/config_sepolia.json | 8 ++++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/contracts/Distribution.sol b/contracts/Distribution.sol index 78cca71..bb7a71b 100644 --- a/contracts/Distribution.sol +++ b/contracts/Distribution.sol @@ -315,7 +315,7 @@ contract Distribution is IDistribution, OwnableUpgradeable, UUPSUpgradeable { IERC20(depositToken).safeTransfer(l1Sender, overplus_); - return L1Sender(l1Sender).sendDepositToken(gasLimit_, maxFeePerGas_, maxSubmissionCost_); + return L1Sender(l1Sender).sendDepositToken{value: msg.value}(gasLimit_, maxFeePerGas_, maxSubmissionCost_); } /**********************************************************************************************/ diff --git a/contracts/L1Sender.sol b/contracts/L1Sender.sol index 530ad67..a10fe12 100644 --- a/contracts/L1Sender.sol +++ b/contracts/L1Sender.sol @@ -81,11 +81,11 @@ contract L1Sender is IL1Sender, ERC165, OwnableUpgradeable, UUPSUpgradeable { bool isAllowedChanged_ = (oldToken_ != newToken_) || (oldGateway_ != newGateway_); if (oldGateway_ != address(0) && isAllowedChanged_) { - IERC20(oldToken_).approve(oldGateway_, 0); + IERC20(oldToken_).approve(IGatewayRouter(oldGateway_).getGateway(oldToken_), 0); } if (isAllowedChanged_) { - IERC20(newToken_).approve(newGateway_, type(uint256).max); + IERC20(newToken_).approve(IGatewayRouter(newGateway_).getGateway(newToken_), type(uint256).max); } } diff --git a/deploy/2_token.migration.ts b/deploy/2_token.migration.ts index 1160e47..8f4f460 100644 --- a/deploy/2_token.migration.ts +++ b/deploy/2_token.migration.ts @@ -6,7 +6,6 @@ import { Distribution__factory, ERC1967Proxy__factory, L1Sender__factory, - L2MessageReceiver__factory, LZEndpointMock__factory, StETHMock__factory, WStETHMock__factory, @@ -58,13 +57,13 @@ module.exports = async function (deployer: Deployer) { const rewardTokenConfig: IL1Sender.RewardTokenConfigStruct = { gateway: lzEndpointL1, - receiver: await deployer.deployed(L2MessageReceiver__factory, 'L2MessageReceiver Proxy'), + receiver: UserStorage.get('L2MessageReceiver Proxy'), receiverChainId: config.chainsConfig.receiverChainId, }; const depositTokenConfig: IL1Sender.DepositTokenConfigStruct = { token: wStEth, gateway: arbitrumBridgeGatewayRouter, - receiver: await deployer.deployed(L2MessageReceiver__factory, 'L2MessageReceiver Proxy'), + receiver: UserStorage.get('L2TokenReceiver Proxy'), }; const l1SenderImpl = await deployer.deploy(L1Sender__factory); diff --git a/deploy/data/config_sepolia.json b/deploy/data/config_sepolia.json index 9f7a1a0..b41fe6f 100644 --- a/deploy/data/config_sepolia.json +++ b/deploy/data/config_sepolia.json @@ -6,23 +6,23 @@ }, "pools": [ { - "payoutStart": 1704309630, + "payoutStart": 1704360948, "decreaseInterval": 86400, "withdrawLockPeriod": 120, "claimLockPeriod": 60, "initialReward": "14400000000000000000000", "rewardDecrease": "2468994701000000000", - "minimalStake": "1000000000000000", + "minimalStake": "10000000000", "isPublic": true }, { - "payoutStart": 1704309630, + "payoutStart": 1704360948, "decreaseInterval": 60, "withdrawLockPeriod": 1, "claimLockPeriod": 1, "initialReward": "100000000000000000000", "rewardDecrease": "100000000000000000000", - "minimalStake": "1000000000000000", + "minimalStake": "10000000000", "isPublic": false, "whitelistedUsers": [ "0x901F2d23823730fb7F2356920e0E273EFdCdFe17",