From c978a651ac8af2ff46f4aad7ead55a7d9b3d611e Mon Sep 17 00:00:00 2001 From: Alex Rea Date: Thu, 26 Sep 2024 10:35:28 +0100 Subject: [PATCH] Remove overly cautious checks in claimDomainFunds --- .../colonyNetwork/ColonyNetworkDeployer.sol | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/contracts/colonyNetwork/ColonyNetworkDeployer.sol b/contracts/colonyNetwork/ColonyNetworkDeployer.sol index 2870c7f787..08d247a9f6 100644 --- a/contracts/colonyNetwork/ColonyNetworkDeployer.sol +++ b/contracts/colonyNetwork/ColonyNetworkDeployer.sol @@ -270,20 +270,12 @@ contract ColonyNetworkDeployer is ColonyNetworkStorage { // when it was created via a cross-chain call (to an as-yet unwritten function). bytes32 salt = getColonyCreationSalt(); // EtherRouter etherRouter = new EtherRouter(); - EtherRouter etherRouter = EtherRouter( - payable( - ICreateX(CREATEX_ADDRESS).deployCreate3AndInit( - salt, - type(EtherRouterCreate3).creationCode, - abi.encodeWithSignature("setOwner(address)", (address(this))), - ICreateX.Values(0, 0) - ) - ) - ); + address colonyAddress = deployEtherRouterViaCreateX(salt); - IColony colony = IColony(address(etherRouter)); + IColony colony = IColony(colonyAddress); address resolverForColonyVersion = colonyVersionResolver[_version]; // ignore-swc-107 + EtherRouter etherRouter = EtherRouter(payable(colonyAddress)); etherRouter.setResolver(resolverForColonyVersion); // ignore-swc-113 // Creating new instance of colony's authority @@ -326,4 +318,18 @@ contract ColonyNetworkDeployer is ColonyNetworkStorage { DSAuth dsauth = DSAuth(_colonyAddress); dsauth.setOwner(address(0x0)); } + + function deployEtherRouterViaCreateX(bytes32 _salt) internal returns (address) { + EtherRouter etherRouter = EtherRouter( + payable( + ICreateX(CREATEX_ADDRESS).deployCreate3AndInit( + _salt, + type(EtherRouterCreate3).creationCode, + abi.encodeWithSignature("setOwner(address)", (address(this))), + ICreateX.Values(0, 0) + ) + ) + ); + return address(etherRouter); + } }