diff --git a/scripts/bootstrap/.env.example b/scripts/bootstrap/.env.example index 98bca7c3..ad143850 100644 --- a/scripts/bootstrap/.env.example +++ b/scripts/bootstrap/.env.example @@ -41,8 +41,6 @@ CHILD_BRIDGE_PAUSER= CHILD_BRIDGE_UNPAUSER= ## The address to be assigned with ADAPTOR_MANAGER_ROLE in child bridge. CHILD_BRIDGE_ADAPTOR_MANAGER= -## The address to be assigned with TREASURY_MANAGER_ROLE in child bridge. -CHILD_BRIDGE_TREASURY_MANAGER= ## The address to be assigned with DEFAULT_ADMIN_ROLE in child adaptor. CHILD_ADAPTOR_DEFAULT_ADMIN= ## The address to be assigned with BRIDGE_MANAGER_ROLE in child adaptor. diff --git a/scripts/bootstrap/6_imx_burning.js b/scripts/bootstrap/6_imx_burning.js index 1bbecf60..817b02df 100644 --- a/scripts/bootstrap/6_imx_burning.js +++ b/scripts/bootstrap/6_imx_burning.js @@ -51,14 +51,16 @@ async function run() { console.log("Burn IMX in..."); await helper.waitForConfirmation(); + let childBridgeObj = JSON.parse(fs.readFileSync('../../out/ChildERC20Bridge.sol/ChildERC20Bridge.json', 'utf8')); + let childBridge = new ethers.Contract(childBridgeAddr, childBridgeObj.abi, childProvider); + console.log("Transfer " + imxDepositLimit + " IMX to child bridge..."); let [priorityFee, maxFee] = await helper.getFee(adminWallet); - let resp = await adminWallet.sendTransaction({ - to: childBridgeAddr, + let resp = await childBridge.connect(adminWallet).treasuryDeposit({ value: ethers.utils.parseEther(imxDepositLimit), maxPriorityFeePerGas: priorityFee, maxFeePerGas: maxFee, - }); + }) await helper.waitForReceipt(resp.hash, childProvider); adminBal = await childProvider.getBalance(adminAddr); bridgeBal = await childProvider.getBalance(childBridgeAddr); diff --git a/scripts/bootstrap/README.md b/scripts/bootstrap/README.md index 80e364ff..190aacf4 100644 --- a/scripts/bootstrap/README.md +++ b/scripts/bootstrap/README.md @@ -66,8 +66,6 @@ CHILD_BRIDGE_PAUSER= CHILD_BRIDGE_UNPAUSER= ## The address to be assigned with ADAPTOR_MANAGER_ROLE in child bridge. CHILD_BRIDGE_ADAPTOR_MANAGER= -## The address to be assigned with TREASURY_MANAGER_ROLE in child bridge. -CHILD_BRIDGE_TREASURY_MANAGER= ## The address to be assigned with DEFAULT_ADMIN_ROLE in child adaptor. CHILD_ADAPTOR_DEFAULT_ADMIN= ## The address to be assigned with BRIDGE_MANAGER_ROLE in child adaptor. diff --git a/scripts/deploy/.env.example b/scripts/deploy/.env.example index db5187ee..dd94dd60 100644 --- a/scripts/deploy/.env.example +++ b/scripts/deploy/.env.example @@ -31,8 +31,6 @@ CHILD_BRIDGE_PAUSER= CHILD_BRIDGE_UNPAUSER= ## The address to be assigned with ADAPTOR_MANAGER_ROLE in child bridge. CHILD_BRIDGE_ADAPTOR_MANAGER= -## The address to be assigned with TREASURY_MANAGER_ROLE in child bridge. -CHILD_BRIDGE_TREASURY_MANAGER= ## The address to be assigned with DEFAULT_ADMIN_ROLE in child adaptor. CHILD_ADAPTOR_DEFAULT_ADMIN= ## The address to be assigned with BRIDGE_MANAGER_ROLE in child adaptor. diff --git a/scripts/deploy/child_initialisation.js b/scripts/deploy/child_initialisation.js index 01ea2b40..f2d418bf 100644 --- a/scripts/deploy/child_initialisation.js +++ b/scripts/deploy/child_initialisation.js @@ -15,7 +15,6 @@ exports.initialiseChildContracts = async () => { let childBridgePauser = helper.requireEnv("CHILD_BRIDGE_PAUSER"); let childBridgeUnpauser = helper.requireEnv("CHILD_BRIDGE_UNPAUSER"); let childBridgeAdaptorManager = helper.requireEnv("CHILD_BRIDGE_ADAPTOR_MANAGER"); - let childBridgeTreasuryManager = helper.requireEnv("CHILD_BRIDGE_TREASURY_MANAGER"); let childAdaptorDefaultAdmin = helper.requireEnv("CHILD_ADAPTOR_DEFAULT_ADMIN"); let childAdaptorBridgeManager = helper.requireEnv("CHILD_ADAPTOR_BRIDGE_MANAGER"); let childAdaptorGasServiceManager = helper.requireEnv("CHILD_ADAPTOR_GAS_SERVICE_MANAGER"); @@ -62,7 +61,8 @@ exports.initialiseChildContracts = async () => { pauser: childBridgePauser, unpauser: childBridgeUnpauser, adaptorManager: childBridgeAdaptorManager, - treasuryManager: childBridgeTreasuryManager, + initialDepositor: adminEOAAddr, + treasuryManager: multisigAddr, }, childAdaptorAddr, ethers.utils.getAddress(rootAdaptorAddr), @@ -70,8 +70,6 @@ exports.initialiseChildContracts = async () => { rootChainName, rootIMXAddr, childWIMXAddr, - multisigAddr, - adminEOAAddr, { maxPriorityFeePerGas: priorityFee, maxFeePerGas: maxFee, diff --git a/scripts/localdev/.env.local b/scripts/localdev/.env.local index 534017c6..e4572792 100644 --- a/scripts/localdev/.env.local +++ b/scripts/localdev/.env.local @@ -41,8 +41,6 @@ CHILD_BRIDGE_PAUSER=0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc CHILD_BRIDGE_UNPAUSER=0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc ## The address to be assigned with ADAPTOR_MANAGER_ROLE in child bridge. CHILD_BRIDGE_ADAPTOR_MANAGER=0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc -## The address to be assigned with TREASURY_MANAGER_ROLE in child bridge. -CHILD_BRIDGE_TREASURY_MANAGER=0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc ## The address to be assigned with DEFAULT_ADMIN_ROLE in child adaptor. CHILD_ADAPTOR_DEFAULT_ADMIN=0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc ## The address to be assigned with BRIDGE_MANAGER_ROLE in child adaptor. diff --git a/src/child/ChildERC20Bridge.sol b/src/child/ChildERC20Bridge.sol index a368adad..cb4ed464 100644 --- a/src/child/ChildERC20Bridge.sol +++ b/src/child/ChildERC20Bridge.sol @@ -67,10 +67,6 @@ contract ChildERC20Bridge is BridgeRoles, IChildERC20BridgeErrors, IChildERC20Br address public childETHToken; /// @dev The address of the wrapped IMX token on L2. address public wIMXToken; - /// @dev The address of the multisig contract on L2. - address public multisigContract; - /// @dev The address that will perform the initial depositing of IMX on L2. - address public initialDepositor; /** * @notice Initialization function for ChildERC20Bridge. @@ -90,15 +86,13 @@ contract ChildERC20Bridge is BridgeRoles, IChildERC20BridgeErrors, IChildERC20Br address newChildTokenTemplate, string memory newRootChain, address newRootIMXToken, - address newWIMXToken, - address newMultisigContract, - address newInitialDepositor + address newWIMXToken ) public initializer { if ( newBridgeAdaptor == address(0) || newChildTokenTemplate == address(0) || newRootIMXToken == address(0) || newRoles.defaultAdmin == address(0) || newRoles.pauser == address(0) || newRoles.unpauser == address(0) || newRoles.adaptorManager == address(0) || newRoles.treasuryManager == address(0) - || newWIMXToken == address(0) || newMultisigContract == address(0) || newInitialDepositor == address(0) + || newWIMXToken == address(0) ) { revert ZeroAddress(); } @@ -118,6 +112,7 @@ contract ChildERC20Bridge is BridgeRoles, IChildERC20BridgeErrors, IChildERC20Br _grantRole(PAUSER_ROLE, newRoles.pauser); _grantRole(UNPAUSER_ROLE, newRoles.unpauser); _grantRole(ADAPTOR_MANAGER_ROLE, newRoles.adaptorManager); + _grantRole(TREASURY_MANAGER_ROLE, newRoles.initialDepositor); _grantRole(TREASURY_MANAGER_ROLE, newRoles.treasuryManager); rootERC20BridgeAdaptor = newRootERC20BridgeAdaptor; @@ -126,8 +121,6 @@ contract ChildERC20Bridge is BridgeRoles, IChildERC20BridgeErrors, IChildERC20Br rootChain = newRootChain; rootIMXToken = newRootIMXToken; wIMXToken = newWIMXToken; - multisigContract = newMultisigContract; - initialDepositor = newInitialDepositor; // NOTE: how will this behave in an updgrade scenario? // e.g. this clone may already be deployed and we could deploy to the same address if the salt is the same. @@ -148,7 +141,7 @@ contract ChildERC20Bridge is BridgeRoles, IChildERC20BridgeErrors, IChildERC20Br */ receive() external payable whenNotPaused { // Revert if sender is not the WIMX token address - if (_msgSender() != wIMXToken && _msgSender() != multisigContract && _msgSender() != initialDepositor) { + if (msg.sender != wIMXToken) { revert NonPermittedNativeTransfer(); } } diff --git a/src/interfaces/child/IChildERC20Bridge.sol b/src/interfaces/child/IChildERC20Bridge.sol index 2971f857..612fbdc7 100644 --- a/src/interfaces/child/IChildERC20Bridge.sol +++ b/src/interfaces/child/IChildERC20Bridge.sol @@ -22,6 +22,7 @@ interface IChildERC20Bridge { address pauser; // The address which will inherit `PAUSER_ROLE`. address unpauser; // The address which will inherit `UNPAUSER_ROLE`. address adaptorManager; // The address which will inherit `ADAPTOR_MANAGER_ROLE`. + address initialDepositor; // The address which will inherit `TREASURY_MANAGER_ROLE`. address treasuryManager; // The address which will inherit `TREASURY_MANAGER_ROLE`. } diff --git a/test/integration/child/ChildAxelarBridge.t.sol b/test/integration/child/ChildAxelarBridge.t.sol index 66a46155..4dcc88b4 100644 --- a/test/integration/child/ChildAxelarBridge.t.sol +++ b/test/integration/child/ChildAxelarBridge.t.sol @@ -23,8 +23,6 @@ contract ChildERC20BridgeIntegrationTest is Test, IChildERC20BridgeEvents, IChil address constant IMX_TOKEN_ADDRESS = address(0xccc); address constant WIMX_TOKEN_ADDRESS = address(0xabc); address constant NATIVE_ETH = address(0xeee); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20Bridge public childERC20Bridge; ChildERC20 public childERC20; @@ -46,6 +44,7 @@ contract ChildERC20BridgeIntegrationTest is Test, IChildERC20BridgeEvents, IChil pauser: address(this), unpauser: address(this), adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childERC20Bridge.initialize( @@ -55,9 +54,7 @@ contract ChildERC20BridgeIntegrationTest is Test, IChildERC20BridgeEvents, IChil address(childERC20), ROOT_CHAIN_NAME, IMX_TOKEN_ADDRESS, - WIMX_TOKEN_ADDRESS, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + WIMX_TOKEN_ADDRESS ); IChildAxelarBridgeAdaptor.InitializationRoles memory adaptorRoles = IChildAxelarBridgeAdaptor diff --git a/test/unit/child/ChildERC20Bridge.t.sol b/test/unit/child/ChildERC20Bridge.t.sol index 50aa762a..b82e16f5 100644 --- a/test/unit/child/ChildERC20Bridge.t.sol +++ b/test/unit/child/ChildERC20Bridge.t.sol @@ -21,20 +21,20 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B address constant ROOT_IMX_TOKEN = address(0xccc); address constant CHILD_WIMX_TOKEN = address(0xabc); address constant NATIVE_ETH = address(0xeee); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20 public rootToken; address public childETHToken; ChildERC20Bridge public childBridge; address treasuryManager = makeAddr("treasuryManager"); + address initialDepositor = makeAddr("initialDepositor"); IChildERC20Bridge.InitializationRoles roles = IChildERC20Bridge.InitializationRoles({ defaultAdmin: address(this), pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: initialDepositor, treasuryManager: treasuryManager }); @@ -54,9 +54,7 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - CHILD_WIMX_TOKEN, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + CHILD_WIMX_TOKEN ); } @@ -170,9 +168,7 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - CHILD_WIMX_TOKEN, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + CHILD_WIMX_TOKEN ); } @@ -180,117 +176,47 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B ChildERC20Bridge bridge = new ChildERC20Bridge(); roles.defaultAdmin = address(0); vm.expectRevert(ZeroAddress.selector); - bridge.initialize( - roles, - address(1), - ROOT_BRIDGE_ADAPTOR, - address(1), - ROOT_CHAIN_NAME, - address(1), - address(1), - address(1), - address(1) - ); + bridge.initialize(roles, address(1), ROOT_BRIDGE_ADAPTOR, address(1), ROOT_CHAIN_NAME, address(1), address(1)); } function test_RevertIf_InitializeWithAZeroAddressPauser() public { ChildERC20Bridge bridge = new ChildERC20Bridge(); roles.pauser = address(0); vm.expectRevert(ZeroAddress.selector); - bridge.initialize( - roles, - address(1), - ROOT_BRIDGE_ADAPTOR, - address(1), - ROOT_CHAIN_NAME, - address(1), - address(1), - address(1), - address(1) - ); + bridge.initialize(roles, address(1), ROOT_BRIDGE_ADAPTOR, address(1), ROOT_CHAIN_NAME, address(1), address(1)); } function test_RevertIf_InitializeWithAZeroAddressUnpauser() public { ChildERC20Bridge bridge = new ChildERC20Bridge(); roles.unpauser = address(0); vm.expectRevert(ZeroAddress.selector); - bridge.initialize( - roles, - address(1), - ROOT_BRIDGE_ADAPTOR, - address(1), - ROOT_CHAIN_NAME, - address(1), - address(1), - address(1), - address(1) - ); + bridge.initialize(roles, address(1), ROOT_BRIDGE_ADAPTOR, address(1), ROOT_CHAIN_NAME, address(1), address(1)); } function test_RevertIf_InitializeWithAZeroAddressAdapter() public { ChildERC20Bridge bridge = new ChildERC20Bridge(); roles.adaptorManager = address(0); vm.expectRevert(ZeroAddress.selector); - bridge.initialize( - roles, - address(0), - ROOT_BRIDGE_ADAPTOR, - address(1), - ROOT_CHAIN_NAME, - address(1), - address(1), - address(1), - address(1) - ); + bridge.initialize(roles, address(0), ROOT_BRIDGE_ADAPTOR, address(1), ROOT_CHAIN_NAME, address(1), address(1)); } function test_RevertIf_InitializeWithAZeroAddressTreasuryManager() public { ChildERC20Bridge bridge = new ChildERC20Bridge(); roles.treasuryManager = address(0); vm.expectRevert(ZeroAddress.selector); - bridge.initialize( - roles, - address(1), - ROOT_BRIDGE_ADAPTOR, - address(1), - ROOT_CHAIN_NAME, - address(1), - address(1), - address(1), - address(1) - ); + bridge.initialize(roles, address(1), ROOT_BRIDGE_ADAPTOR, address(1), ROOT_CHAIN_NAME, address(1), address(1)); } function test_RevertIf_InitializeWithAZeroAddressChildTemplate() public { ChildERC20Bridge bridge = new ChildERC20Bridge(); vm.expectRevert(ZeroAddress.selector); - bridge.initialize( - roles, - address(1), - ROOT_BRIDGE_ADAPTOR, - address(0), - ROOT_CHAIN_NAME, - address(1), - address(1), - address(1), - address(1) - ); + bridge.initialize(roles, address(1), ROOT_BRIDGE_ADAPTOR, address(0), ROOT_CHAIN_NAME, address(1), address(1)); } function test_RevertIf_InitializeWithAZeroAddressIMXToken() public { ChildERC20Bridge bridge = new ChildERC20Bridge(); vm.expectRevert(ZeroAddress.selector); - bridge.initialize( - roles, - address(1), - ROOT_BRIDGE_ADAPTOR, - address(1), - ROOT_CHAIN_NAME, - address(0), - address(1), - address(1), - address(1) - ); + bridge.initialize(roles, address(1), ROOT_BRIDGE_ADAPTOR, address(1), ROOT_CHAIN_NAME, address(0), address(1)); } function test_RevertIf_InitializeWithAZeroAddressAll() public { @@ -301,32 +227,14 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B roles.unpauser = address(0); roles.adaptorManager = address(0); roles.treasuryManager = address(0); - bridge.initialize( - roles, - address(0), - ROOT_BRIDGE_ADAPTOR, - address(0), - ROOT_CHAIN_NAME, - address(0), - address(0), - address(0), - address(0) - ); + bridge.initialize(roles, address(0), ROOT_BRIDGE_ADAPTOR, address(0), ROOT_CHAIN_NAME, address(0), address(0)); } function test_RevertIf_InitializeWithAnEmptyBridgeAdaptorString() public { ChildERC20Bridge bridge = new ChildERC20Bridge(); vm.expectRevert(InvalidRootERC20BridgeAdaptor.selector); bridge.initialize( - roles, - address(this), - "", - address(childTokenTemplate), - ROOT_CHAIN_NAME, - ROOT_IMX_TOKEN, - CHILD_WIMX_TOKEN, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + roles, address(this), "", address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, CHILD_WIMX_TOKEN ); } @@ -334,15 +242,7 @@ contract ChildERC20BridgeUnitTest is Test, IChildERC20BridgeEvents, IChildERC20B ChildERC20Bridge bridge = new ChildERC20Bridge(); vm.expectRevert(InvalidRootChain.selector); bridge.initialize( - roles, - address(this), - ROOT_BRIDGE_ADAPTOR, - address(childTokenTemplate), - "", - ROOT_IMX_TOKEN, - CHILD_WIMX_TOKEN, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + roles, address(this), ROOT_BRIDGE_ADAPTOR, address(childTokenTemplate), "", ROOT_IMX_TOKEN, CHILD_WIMX_TOKEN ); } diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol index 6bdf9a08..8480a46d 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdraw.t.sol @@ -20,8 +20,6 @@ contract ChildERC20BridgeWithdrawUnitTest is Test, IChildERC20BridgeEvents, IChi address constant ROOT_IMX_TOKEN = address(0xccc); address constant NATIVE_ETH = address(0xeee); address constant WIMX_TOKEN_ADDRESS = address(0xabc); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20 public rootToken; ChildERC20 public childToken; @@ -43,6 +41,7 @@ contract ChildERC20BridgeWithdrawUnitTest is Test, IChildERC20BridgeEvents, IChi pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge = new ChildERC20Bridge(); @@ -53,9 +52,7 @@ contract ChildERC20BridgeWithdrawUnitTest is Test, IChildERC20BridgeEvents, IChi address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - WIMX_TOKEN_ADDRESS, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + WIMX_TOKEN_ADDRESS ); bytes memory mapTokenData = diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawETH.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawETH.t.sol index 71ad3c8d..9bf8e6e6 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawETH.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawETH.t.sol @@ -20,8 +20,6 @@ contract ChildERC20BridgeWithdrawETHUnitTest is Test, IChildERC20BridgeEvents, I address constant ROOT_IMX_TOKEN = address(0xccc); address constant NATIVE_ETH = address(0xeee); address constant WIMX_TOKEN_ADDRESS = address(0xabc); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20 public childETHToken; ChildERC20Bridge public childBridge; @@ -38,6 +36,7 @@ contract ChildERC20BridgeWithdrawETHUnitTest is Test, IChildERC20BridgeEvents, I pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge.initialize( @@ -47,9 +46,7 @@ contract ChildERC20BridgeWithdrawETHUnitTest is Test, IChildERC20BridgeEvents, I address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - WIMX_TOKEN_ADDRESS, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + WIMX_TOKEN_ADDRESS ); childETHToken = ChildERC20(childBridge.childETHToken()); diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawETHTo.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawETHTo.t.sol index 8bb302b0..0bf1dedb 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawETHTo.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawETHTo.t.sol @@ -23,8 +23,6 @@ contract ChildERC20BridgeWithdrawETHToUnitTest is Test, IChildERC20BridgeEvents, address constant ROOT_IMX_TOKEN = address(0xccc); address constant NATIVE_ETH = address(0xeee); address constant WIMX_TOKEN_ADDRESS = address(0xabc); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20 public rootToken; ChildERC20 public childToken; @@ -47,6 +45,7 @@ contract ChildERC20BridgeWithdrawETHToUnitTest is Test, IChildERC20BridgeEvents, pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge.initialize( @@ -56,9 +55,7 @@ contract ChildERC20BridgeWithdrawETHToUnitTest is Test, IChildERC20BridgeEvents, address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - WIMX_TOKEN_ADDRESS, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + WIMX_TOKEN_ADDRESS ); bytes memory mapTokenData = diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMX.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMX.t.sol index 9c2c4d15..f315ab73 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMX.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMX.t.sol @@ -19,8 +19,6 @@ contract ChildERC20BridgeWithdrawIMXUnitTest is Test, IChildERC20BridgeEvents, I string constant ROOT_CHAIN_NAME = "test"; address constant ROOT_IMX_TOKEN = address(0xccc); address constant WIMX_TOKEN_ADDRESS = address(0xabc); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20Bridge public childBridge; MockAdaptor public mockAdaptor; @@ -37,6 +35,7 @@ contract ChildERC20BridgeWithdrawIMXUnitTest is Test, IChildERC20BridgeEvents, I pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge.initialize( @@ -46,9 +45,7 @@ contract ChildERC20BridgeWithdrawIMXUnitTest is Test, IChildERC20BridgeEvents, I address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - WIMX_TOKEN_ADDRESS, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + WIMX_TOKEN_ADDRESS ); } diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMXTo.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMXTo.t.sol index 547e8874..e0452839 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMXTo.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawIMXTo.t.sol @@ -20,8 +20,6 @@ contract ChildERC20BridgeWithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, address constant ROOT_IMX_TOKEN = address(0xccc); address constant WIMX_TOKEN_ADDRESS = address(0xabc); address constant NATIVE_ETH = address(0xeee); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20 public rootToken; ChildERC20 public childToken; @@ -41,6 +39,7 @@ contract ChildERC20BridgeWithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge.initialize( @@ -50,9 +49,7 @@ contract ChildERC20BridgeWithdrawIMXToUnitTest is Test, IChildERC20BridgeEvents, address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - WIMX_TOKEN_ADDRESS, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + WIMX_TOKEN_ADDRESS ); } diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol index ef025bbd..107d97da 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawTo.t.sol @@ -20,8 +20,6 @@ contract ChildERC20BridgeWithdrawToUnitTest is Test, IChildERC20BridgeEvents, IC address constant ROOT_IMX_TOKEN = address(0xccc); address constant WIMX_TOKEN_ADDRESS = address(0xabc); address constant NATIVE_ETH = address(0xeee); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20 public rootToken; ChildERC20 public childToken; @@ -43,6 +41,7 @@ contract ChildERC20BridgeWithdrawToUnitTest is Test, IChildERC20BridgeEvents, IC pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge = new ChildERC20Bridge(); @@ -53,9 +52,7 @@ contract ChildERC20BridgeWithdrawToUnitTest is Test, IChildERC20BridgeEvents, IC address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - WIMX_TOKEN_ADDRESS, - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + WIMX_TOKEN_ADDRESS ); bytes memory mapTokenData = diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMX.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMX.t.sol index d5527b16..d2f57bc2 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMX.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMX.t.sol @@ -19,8 +19,6 @@ contract ChildERC20BridgeWithdrawWIMXUnitTest is Test, IChildERC20BridgeEvents, string public ROOT_BRIDGE_ADAPTOR = Strings.toHexString(address(4)); string constant ROOT_CHAIN_NAME = "test"; address constant ROOT_IMX_TOKEN = address(0xccc); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20Bridge public childBridge; MockAdaptor public mockAdaptor; @@ -41,6 +39,7 @@ contract ChildERC20BridgeWithdrawWIMXUnitTest is Test, IChildERC20BridgeEvents, pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge.initialize( @@ -50,9 +49,7 @@ contract ChildERC20BridgeWithdrawWIMXUnitTest is Test, IChildERC20BridgeEvents, address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - address(wIMXToken), - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + address(wIMXToken) ); } diff --git a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMXTo.t.sol b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMXTo.t.sol index ed881903..c529f968 100644 --- a/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMXTo.t.sol +++ b/test/unit/child/withdrawals/ChildERC20BridgeWithdrawWIMXTo.t.sol @@ -21,8 +21,6 @@ contract ChildERC20BridgeWithdrawWIMXToUnitTest is Test, IChildERC20BridgeEvents string constant ROOT_CHAIN_NAME = "test"; address constant ROOT_IMX_TOKEN = address(0xccc); address constant WIMX_TOKEN_ADDRESS = address(0xabc); - address constant MULTISIG_ADDRESS = address(0xbbbb); - address constant INITIAL_DEPOSITOR = address(0xcccc); ChildERC20 public childTokenTemplate; ChildERC20Bridge public childBridge; MockAdaptor public mockAdaptor; @@ -43,6 +41,7 @@ contract ChildERC20BridgeWithdrawWIMXToUnitTest is Test, IChildERC20BridgeEvents pauser: pauser, unpauser: unpauser, adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge.initialize( @@ -52,9 +51,7 @@ contract ChildERC20BridgeWithdrawWIMXToUnitTest is Test, IChildERC20BridgeEvents address(childTokenTemplate), ROOT_CHAIN_NAME, ROOT_IMX_TOKEN, - address(wIMXToken), - MULTISIG_ADDRESS, - INITIAL_DEPOSITOR + address(wIMXToken) ); } diff --git a/test/utils.t.sol b/test/utils.t.sol index 2735901c..a9ea53f0 100644 --- a/test/utils.t.sol +++ b/test/utils.t.sol @@ -58,8 +58,6 @@ contract Utils is Test { string memory rootAdaptor = Strings.toHexString(address(99999)); rootIMX = address(555555); rootToken = address(44444); - address multisigContract = address(0xbbbb); - address initialDepositor = address(0xcccc); address childWIMX = address(0xabc); deployCodeTo("WIMX.sol", childWIMX); @@ -75,18 +73,11 @@ contract Utils is Test { pauser: address(this), unpauser: address(this), adaptorManager: address(this), + initialDepositor: address(this), treasuryManager: address(this) }); childBridge.initialize( - roles, - address(childBridgeAdaptor), - rootAdaptor, - address(childTokenTemplate), - "ROOT", - rootIMX, - childWIMX, - multisigContract, - initialDepositor + roles, address(childBridgeAdaptor), rootAdaptor, address(childTokenTemplate), "ROOT", rootIMX, childWIMX ); IChildAxelarBridgeAdaptor.InitializationRoles memory adaptorRoles = IChildAxelarBridgeAdaptor