Skip to content

Commit

Permalink
fixed token bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanProgrammer committed Jan 4, 2024
1 parent 5cdf017 commit 3be7247
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion contracts/Distribution.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
}

/**********************************************************************************************/
Expand Down
4 changes: 2 additions & 2 deletions contracts/L1Sender.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
5 changes: 2 additions & 3 deletions deploy/2_token.migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Distribution__factory,
ERC1967Proxy__factory,
L1Sender__factory,
L2MessageReceiver__factory,
LZEndpointMock__factory,
StETHMock__factory,
WStETHMock__factory,
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions deploy/data/config_sepolia.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 3be7247

Please sign in to comment.