Skip to content

Commit

Permalink
Merge pull request #27 from immutable/SMR-1815-WIMX-withdraw
Browse files Browse the repository at this point in the history
Smr 1815 wimx withdraw
  • Loading branch information
tsnewnami authored Nov 14, 2023
2 parents 0b523d4 + 68d1b32 commit 5a46b04
Show file tree
Hide file tree
Showing 25 changed files with 1,111 additions and 165 deletions.
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ROOT_PRIVATE_KEY=
ROOT_GATEWAY_ADDRESS=
ROOT_GAS_SERVICE_ADDRESS=
ROOT_CHAIN_NAME=
CHILD_CHAIN_NAME=
CHILD_WIMX_ADDRESS=
ROOT_IMX_ADDRESS=
ROOT_WETH_ADDRESS=
INITIAL_IMX_CUMULATIVE_DEPOSIT_LIMIT= # 0 for unlimited
Expand Down
13 changes: 2 additions & 11 deletions script/DeployChildContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,14 @@ contract DeployChildContracts is Script {
vm.createSelectFork(childRpcUrl);
vm.startBroadcast(deployerPrivateKey);

WIMX wrappedIMX = new WIMX();

ProxyAdmin proxyAdmin = new ProxyAdmin();

ChildERC20 childTokenTemplate = new ChildERC20();
childTokenTemplate.initialize(address(123), "TEMPLATE", "TPT", 18);

IChildERC20Bridge.InitializationRoles memory roles = IChildERC20Bridge.InitializationRoles({
defaultAdmin: address(0x1111),
pauser: address(0x2222),
unpauser: address(0x3333),
variableManager: address(0x4444),
adaptorManager: address(0x5555)
});

ChildERC20Bridge childERC20BridgeImplementation = new ChildERC20Bridge();
childERC20BridgeImplementation.initialize(roles, address(1), "0x123", address(1), "root", address(1));

TransparentUpgradeableProxy childERC20BridgeProxy = new TransparentUpgradeableProxy(
address(childERC20BridgeImplementation),
Expand All @@ -54,8 +47,6 @@ contract DeployChildContracts is Script {
""
);

WIMX wrappedIMX = new WIMX();

vm.stopBroadcast();

console2.log("====CHILD ADDRESSES====");
Expand Down
7 changes: 5 additions & 2 deletions script/InitializeChildContracts.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct InitializeChildContractsParams {
address rootERC20BridgeAdaptor;
string rootChainName;
address rootIMXToken;
address wIMXToken;
string childRpcUrl;
uint256 deployerPrivateKey;
address childGasService;
Expand All @@ -30,12 +31,13 @@ contract InitializeChildContracts is Script {
childAdminAddress: vm.envAddress("CHILD_ADMIN_ADDRESS"),
childPauserAddress: vm.envAddress("CHILD_PAUSER_ADDRESS"),
childUnpauserAddress: vm.envAddress("CHILD_UNPAUSER_ADDRESS"),
childERC20Bridge: ChildERC20Bridge(vm.envAddress("CHILD_ERC20_BRIDGE")),
childERC20Bridge: ChildERC20Bridge(payable(vm.envAddress("CHILD_ERC20_BRIDGE"))),
childAxelarBridgeAdaptor: ChildAxelarBridgeAdaptor(vm.envAddress("CHILD_BRIDGE_ADAPTOR")),
childTokenTemplate: vm.envAddress("CHILDCHAIN_CHILD_TOKEN_TEMPLATE"),
rootERC20BridgeAdaptor: vm.envAddress("ROOT_BRIDGE_ADAPTOR"),
rootChainName: vm.envString("ROOT_CHAIN_NAME"),
rootIMXToken: vm.envAddress("ROOT_IMX_ADDRESS"),
wIMXToken: vm.envAddress("CHILD_WIMX_ADDRESS"),
childRpcUrl: vm.envString("CHILD_RPC_URL"),
deployerPrivateKey: vm.envUint("CHILD_PRIVATE_KEY"),
childGasService: vm.envAddress("CHILD_GAS_SERVICE_ADDRESS")
Expand Down Expand Up @@ -65,7 +67,8 @@ contract InitializeChildContracts is Script {
rootBridgeAdaptorString,
params.childTokenTemplate,
params.rootChainName,
params.rootIMXToken
params.rootIMXToken,
params.wIMXToken
);

params.childAxelarBridgeAdaptor.initialize(
Expand Down
Loading

0 comments on commit 5a46b04

Please sign in to comment.