Skip to content

Commit

Permalink
feat(protocol): remove more timelock related code (#17018)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored May 7, 2024
1 parent b978e11 commit 88a13b6
Showing 1 changed file with 5 additions and 35 deletions.
40 changes: 5 additions & 35 deletions packages/protocol/script/SetRemoteBridgeSuites.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "../test/DeployCapability.sol";
contract SetRemoteBridgeSuites is DeployCapability {
uint256 public privateKey = vm.envUint("PRIVATE_KEY");
uint256 public securityCouncilPrivateKey = vm.envUint("SECURITY_COUNCIL_PRIVATE_KEY");
address public timelockAddress = vm.envAddress("TIMELOCK_ADDRESS");
address public addressManagerAddress = vm.envAddress("ADDRESS_MANAGER_ADDRESS");
uint256[] public remoteChainIDs = vm.envUint("REMOTE_CHAIN_IDS", ",");
address[] public remoteSignalServices = vm.envAddress("REMOTE_SIGNAL_SERVICES", ",");
Expand Down Expand Up @@ -40,42 +39,13 @@ contract SetRemoteBridgeSuites is DeployCapability {

for (uint256 i; i < remoteChainIDs.length; ++i) {
uint64 chainid = uint64(remoteChainIDs[i]);

if (securityCouncilPrivateKey == 0) {
register(addressManagerAddress, "signal_service", remoteSignalServices[i], chainid);
register(addressManagerAddress, "bridge", remoteBridges[i], chainid);
register(addressManagerAddress, "erc20_vault", remoteERC20Vaults[i], chainid);
register(addressManagerAddress, "erc721_vault", remoteERC721Vaults[i], chainid);
register(addressManagerAddress, "erc1155_vault", remoteERC1155Vaults[i], chainid);
continue;
}

registerByTimelock(
addressManagerAddress, "signal_service", remoteSignalServices[i], chainid
);
registerByTimelock(addressManagerAddress, "bridge", remoteBridges[i], chainid);
registerByTimelock(addressManagerAddress, "erc20_vault", remoteERC20Vaults[i], chainid);
registerByTimelock(
addressManagerAddress, "erc721_vault", remoteERC721Vaults[i], chainid
);
registerByTimelock(
addressManagerAddress, "erc1155_vault", remoteERC1155Vaults[i], chainid
);
register(addressManagerAddress, "signal_service", remoteSignalServices[i], chainid);
register(addressManagerAddress, "bridge", remoteBridges[i], chainid);
register(addressManagerAddress, "erc20_vault", remoteERC20Vaults[i], chainid);
register(addressManagerAddress, "erc721_vault", remoteERC721Vaults[i], chainid);
register(addressManagerAddress, "erc1155_vault", remoteERC1155Vaults[i], chainid);
}

vm.stopBroadcast();
}

function registerByTimelock(
address registerTo,
string memory name,
address addr,
uint64 chainId
)
internal
{
AddressManager(registerTo).setAddress(chainId, bytes32(bytes(name)), addr);
console2.log("> ", name, "@", registerTo);
console2.log("\t addr : ", addr);
}
}

0 comments on commit 88a13b6

Please sign in to comment.