From bb2c3a43cf1dcf3cb72853a83f2bd914f7b8cb98 Mon Sep 17 00:00:00 2001 From: Nikhil Suri Date: Wed, 3 Jan 2024 07:59:58 -0800 Subject: [PATCH] Add Wormhole Chain IDs and license comments atop files --- src/Base.sol | 1 + src/CCTPAndTokenBase.sol | 1 + src/CCTPBase.sol | 1 + src/Chains.sol | 48 ++++++++++++++++++++++++++++++++++++++ src/TokenBase.sol | 1 + src/Utils.sol | 1 + src/WormholeRelayerSDK.sol | 2 ++ 7 files changed, 55 insertions(+) create mode 100644 src/Chains.sol diff --git a/src/Base.sol b/src/Base.sol index d54481a..1815f9b 100644 --- a/src/Base.sol +++ b/src/Base.sol @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.13; import "./interfaces/IWormholeReceiver.sol"; diff --git a/src/CCTPAndTokenBase.sol b/src/CCTPAndTokenBase.sol index 9b51f76..989ad38 100644 --- a/src/CCTPAndTokenBase.sol +++ b/src/CCTPAndTokenBase.sol @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.13; import "./interfaces/IWormholeReceiver.sol"; diff --git a/src/CCTPBase.sol b/src/CCTPBase.sol index 19f8b9a..4fe7271 100644 --- a/src/CCTPBase.sol +++ b/src/CCTPBase.sol @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.13; import "./interfaces/IWormholeReceiver.sol"; diff --git a/src/Chains.sol b/src/Chains.sol new file mode 100644 index 0000000..6347711 --- /dev/null +++ b/src/Chains.sol @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: Apache 2 +pragma solidity ^0.8.13; + +// In the wormhole wire format, 0 indicates that a message is for any destination chain +uint16 constant CHAIN_ID_UNSET = 0; +uint16 constant CHAIN_ID_SOLANA = 1; +uint16 constant CHAIN_ID_ETHEREUM = 2; +uint16 constant CHAIN_ID_TERRA = 3; +uint16 constant CHAIN_ID_BSC = 4; +uint16 constant CHAIN_ID_POLYGON = 5; +uint16 constant CHAIN_ID_AVALANCHE = 6; +uint16 constant CHAIN_ID_OASIS = 7; +uint16 constant CHAIN_ID_ALGORAND = 8; +uint16 constant CHAIN_ID_AURORA = 9; +uint16 constant CHAIN_ID_FANTOM = 10; +uint16 constant CHAIN_ID_KARURA = 11; +uint16 constant CHAIN_ID_ACALA = 12; +uint16 constant CHAIN_ID_KLAYTN = 13; +uint16 constant CHAIN_ID_CELO = 14; +uint16 constant CHAIN_ID_NEAR = 15; +uint16 constant CHAIN_ID_MOONBEAM = 16; +uint16 constant CHAIN_ID_NEON = 17; +uint16 constant CHAIN_ID_TERRA2 = 18; +uint16 constant CHAIN_ID_INJECTIVE = 19; +uint16 constant CHAIN_ID_OSMOSIS = 20; +uint16 constant CHAIN_ID_SUI = 21; +uint16 constant CHAIN_ID_APTOS = 22; +uint16 constant CHAIN_ID_ARBITRUM = 23; +uint16 constant CHAIN_ID_OPTIMISM = 24; +uint16 constant CHAIN_ID_GNOSIS = 25; +uint16 constant CHAIN_ID_PYTHNET = 26; +uint16 constant CHAIN_ID_XPLA = 28; +uint16 constant CHAIN_ID_BTC = 29; +uint16 constant CHAIN_ID_BASE = 30; +uint16 constant CHAIN_ID_SEI = 32; +uint16 constant CHAIN_ID_ROOTSTOCK = 33; +uint16 constant CHAIN_ID_SCROLL = 34; +uint16 constant CHAIN_ID_MANTLE = 35; +uint16 constant CHAIN_ID_WORMCHAIN = 3104; +uint16 constant CHAIN_ID_COSMOSHUB = 4000; +uint16 constant CHAIN_ID_EVMOS = 4001; +uint16 constant CHAIN_ID_KUJIRA = 4002; +uint16 constant CHAIN_ID_NEUTRON = 4003; +uint16 constant CHAIN_ID_CELESTIA = 4004; +uint16 constant CHAIN_ID_SEPOLIA = 10002; +uint16 constant CHAIN_ID_ARBITRUM_SEPOLIA = 10003; +uint16 constant CHAIN_ID_BASE_SEPOLIA = 10004; +uint16 constant CHAIN_ID_OPTIMISM_SEPOLIA = 10005; diff --git a/src/TokenBase.sol b/src/TokenBase.sol index 0e20e64..6e96c49 100644 --- a/src/TokenBase.sol +++ b/src/TokenBase.sol @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.13; import "./interfaces/IWormholeReceiver.sol"; diff --git a/src/Utils.sol b/src/Utils.sol index 4106e78..1f93441 100644 --- a/src/Utils.sol +++ b/src/Utils.sol @@ -1,4 +1,5 @@ +// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.13; import "./interfaces/IWormholeRelayer.sol"; diff --git a/src/WormholeRelayerSDK.sol b/src/WormholeRelayerSDK.sol index 511cf01..78d4ccd 100644 --- a/src/WormholeRelayerSDK.sol +++ b/src/WormholeRelayerSDK.sol @@ -1,7 +1,9 @@ +// SPDX-License-Identifier: Apache 2 pragma solidity ^0.8.13; import "./interfaces/IWormholeReceiver.sol"; import "./interfaces/IWormholeRelayer.sol"; +import "./Chains.sol"; import "./Utils.sol"; import {Base} from "./Base.sol"; import {TokenBase, TokenReceiver, TokenSender} from "./TokenBase.sol";