Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smr 1815 wimx withdraw #27

Merged
merged 16 commits into from
Nov 14, 2023
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
Loading