diff --git a/ethereum/contracts/Implementation.sol b/ethereum/contracts/Implementation.sol index 915f6c108..659989a9a 100644 --- a/ethereum/contracts/Implementation.sol +++ b/ethereum/contracts/Implementation.sol @@ -32,31 +32,6 @@ contract Implementation is Governance { function initialize() initializer public virtual { // this function needs to be exposed for an upgrade to pass - uint256 evmChainId; - uint16 chain = chainId(); - - // Wormhole chain ids explicitly enumerated - if (chain == 2) { evmChainId = 1; // ethereum - } else if (chain == 4) { evmChainId = 56; // bsc - } else if (chain == 5) { evmChainId = 137; // polygon - } else if (chain == 6) { evmChainId = 43114; // avalanche - } else if (chain == 7) { evmChainId = 42262; // oasis - } else if (chain == 9) { evmChainId = 1313161554; // aurora - } else if (chain == 10) { evmChainId = 250; // fantom - } else if (chain == 11) { evmChainId = 686; // karura - } else if (chain == 12) { evmChainId = 787; // acala - } else if (chain == 13) { evmChainId = 8217; // klaytn - } else if (chain == 14) { evmChainId = 42220; // celo - } else if (chain == 16) { evmChainId = 1284; // moonbeam - } else if (chain == 17) { evmChainId = 245022934; // neon - } else if (chain == 23) { evmChainId = 42161; // arbitrum - } else if (chain == 24) { evmChainId = 10; // optimism - } else if (chain == 25) { evmChainId = 100; // gnosis - } else { - revert("Unknown chain id."); - } - - setEvmChainId(evmChainId); } modifier initializer() { diff --git a/ethereum/contracts/bridge/BridgeImplementation.sol b/ethereum/contracts/bridge/BridgeImplementation.sol index ccc6f34b3..379ed623a 100644 --- a/ethereum/contracts/bridge/BridgeImplementation.sol +++ b/ethereum/contracts/bridge/BridgeImplementation.sol @@ -17,28 +17,6 @@ contract BridgeImplementation is Bridge { function initialize() initializer public virtual { // this function needs to be exposed for an upgrade to pass - address tokenContract; - uint256 chain = chainId(); - - // A previous upgrade - // (https://github.com/wormhole-foundation/wormhole/commit/cb161db5e01970cc92d80fc679e506db054f8368) - // set the token contract implementations for a number of chains, - // excluding arbitrum and optimism, both of which were deployed with - // that `initialize` contract, meaning there's a potential for a - // temporary DoS. - // - // Performing this upgrade closes that DoS window. - // - // *insert rant about implicit variable initialisation* - if (chain == 23) { // arbitrum - tokenContract = 0x53B56de645B9de6e5a40acE047D1c74E8B42Eccb; - } else if (chain == 24) { // optimism - tokenContract = 0xb91e3638F82A1fACb28690b37e3aAE45d2c33808; - } else { - revert("Chain not handled."); - } - - setTokenImplementation(tokenContract); } modifier initializer() { diff --git a/ethereum/contracts/nft/NFTBridgeImplementation.sol b/ethereum/contracts/nft/NFTBridgeImplementation.sol index c979e09b2..b00c3eb6e 100644 --- a/ethereum/contracts/nft/NFTBridgeImplementation.sol +++ b/ethereum/contracts/nft/NFTBridgeImplementation.sol @@ -17,31 +17,6 @@ contract NFTBridgeImplementation is NFTBridge { function initialize() initializer public virtual { // this function needs to be exposed for an upgrade to pass - uint256 evmChainId; - uint16 chain = chainId(); - - // Wormhole chain ids explicitly enumerated - if (chain == 2) { evmChainId = 1; // ethereum - } else if (chain == 4) { evmChainId = 56; // bsc - } else if (chain == 5) { evmChainId = 137; // polygon - } else if (chain == 6) { evmChainId = 43114; // avalanche - } else if (chain == 7) { evmChainId = 42262; // oasis - } else if (chain == 9) { evmChainId = 1313161554; // aurora - } else if (chain == 10) { evmChainId = 250; // fantom - } else if (chain == 11) { evmChainId = 686; // karura - } else if (chain == 12) { evmChainId = 787; // acala - } else if (chain == 13) { evmChainId = 8217; // klaytn - } else if (chain == 14) { evmChainId = 42220; // celo - } else if (chain == 16) { evmChainId = 1284; // moonbeam - } else if (chain == 17) { evmChainId = 245022934; // neon - } else if (chain == 23) { evmChainId = 42161; // arbitrum - } else if (chain == 24) { evmChainId = 10; // optimism - } else if (chain == 25) { evmChainId = 100; // gnosis - } else { - revert("Unknown chain id."); - } - - setEvmChainId(evmChainId); } modifier initializer() {