Skip to content

Commit

Permalink
(feat) Deploy token managers to bsc.
Browse files Browse the repository at this point in the history
  • Loading branch information
rrw-zilliqa committed Dec 20, 2024
1 parent 95368e7 commit 028da62
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/zilbridge_to_xbridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Same as `zq`:
export ETHERSCAN_API_KEY=...
export BSC_RPC_URL=..
forge script script/bsc/deploy/02_deployZilbridgeTokenManagers.s.sol --rpc-url ${BSC_RPC_URL} --broadcast --chain-id 56 --verify --legacy
forge script script/bsc/deploy/03_registerLockProxy.s.sol --rpc-url ${BSC_RPC_URL} --broadcast --chain-id 56 --verify --legacy
```


Expand Down
22 changes: 22 additions & 0 deletions smart-contracts/script/bsc/deploy/03_registerLockProxy.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.20;

import {Script} from "forge-std/Script.sol";
import "forge-std/console.sol";
import {LockProxyTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockProxyTokenManagerUpgradeableV3.sol";
import {LockAndReleaseOrNativeTokenManagerUpgradeableV3} from "contracts/periphery/TokenManagerV3/LockAndReleaseOrNativeTokenManagerUpgradeableV3.sol";
import { MainnetConfig } from "script/mainnetConfig.s.sol";

contract registerLockProxy is Script, MainnetConfig {
function run() external {
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY_OWNER");
vm.startBroadcast(deployerPrivateKey);
// The lock proxy token manager needs to know where its lock proxy is.
LockProxyTokenManagerUpgradeableV3 lockProxyTokenManager = LockProxyTokenManagerUpgradeableV3(payable(bscLockProxyTokenManager));
// LockAndReleaseOrNativeTokenManagerUpgradeableV3 lockAndReleaseOrNativeTokenManager = LockAndReleaseOrNativeTokenManagerUpgradeableV3(payable(bscLockAndReleaseOrNativeTokenManagerUpgradeable));

lockProxyTokenManager.setLockProxyData(bscLockProxy, bscLockProxyProxy);
vm.stopBroadcast();
}

}
2 changes: 2 additions & 0 deletions smart-contracts/script/mainnetConfig.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ abstract contract MainnetConfig {
address public constant bscLockProxyProxy = 0xD819257C964A78A493DF93D5643E9490b54C5af2;
address public constant bscChainGatewayAddress = 0x3967f1a272Ed007e6B6471b942d655C802b42009;
address public constant bscTokenManagerMintAndBurn = 0xF391A1Ee7b3ccad9a9451D2B7460Ac646F899f23;
address public constant bscLockAndReleaseOrNativeTokenManagerUpgradeable = 0x1202078D298Ff0358A95b6fbf48Ec166dB414660;
address public constant bscLockProxyTokenManager = 0x2EE8e8D7C113Bb7c180f4755f06ed50bE53BEDe5;

address public constant polLockProxy = 0x43138036d1283413035B8eca403559737E8f7980;
address public constant polLockProxyProxy = 0x9121A67cA79B6778eAb477c5F76dF6de7C79cC4b;
Expand Down

0 comments on commit 028da62

Please sign in to comment.