Skip to content

Commit

Permalink
Deploy scroll to testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Oct 10, 2023
1 parent c19e6b9 commit 1a539b5
Show file tree
Hide file tree
Showing 11 changed files with 184 additions and 94 deletions.
2 changes: 2 additions & 0 deletions devnet/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ spec:
- ws://eth-devnet:8545
- --baseRPC
- ws://eth-devnet:8545
- --scrollRPC
- ws://eth-devnet:8545
# - --wormchainURL
# - wormchain:9090
# - --accountantKeyPath
Expand Down
16 changes: 16 additions & 0 deletions ethereum/.env.scroll.testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Scroll Sepolia testnet env
# Rename to .env to use with truffle migrations

# Wormhole Core Migrations
INIT_SIGNERS=["0x13947Bd48b18E53fdAeEe77F3473391aC727C638"]
INIT_CHAIN_ID=34
INIT_GOV_CHAIN_ID=0x1
INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
INIT_EVM_CHAIN_ID=534351

# Bridge Migrations
BRIDGE_INIT_CHAIN_ID=34
BRIDGE_INIT_GOV_CHAIN_ID=0x1
BRIDGE_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
BRIDGE_INIT_WETH=0x5300000000000000000000000000000000000004
BRIDGE_INIT_FINALITY=1
9 changes: 9 additions & 0 deletions ethereum/truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,15 @@ module.exports = {
},
network_id: 84531,
},
scroll_testnet: {
provider: () => {
return new HDWalletProvider(
process.env.MNEMONIC,
"https://sepolia-rpc.scroll.io"
);
},
network_id: 534351,
},
rootstock: {
provider: () => {
return new HDWalletProvider(
Expand Down
1 change: 1 addition & 0 deletions node/cmd/guardiand/adminnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func runListNodes(cmd *cobra.Command, args []string) {
{"Neon", vaa.ChainIDNeon},
{"Base", vaa.ChainIDBase},
{"Sei", vaa.ChainIDSei},
{"Scroll", vaa.ChainIDScroll},
{"Wormchain", vaa.ChainIDWormchain},
{"Sepolia", vaa.ChainIDSepolia},
}
Expand Down
23 changes: 23 additions & 0 deletions node/cmd/guardiand/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ var (
baseRPC *string
baseContract *string

scrollRPC *string
scrollContract *string

sepoliaRPC *string
sepoliaContract *string

Expand Down Expand Up @@ -336,6 +339,9 @@ func init() {
optimismRPC = NodeCmd.Flags().String("optimismRPC", "", "Optimism RPC URL")
optimismContract = NodeCmd.Flags().String("optimismContract", "", "Optimism contract address")

scrollRPC = NodeCmd.Flags().String("scrollRPC", "", "Scroll RPC URL")
scrollContract = NodeCmd.Flags().String("scrollContract", "", "Scroll contract address")

baseRPC = NodeCmd.Flags().String("baseRPC", "", "Base RPC URL")
baseContract = NodeCmd.Flags().String("baseContract", "", "Base contract address")

Expand Down Expand Up @@ -488,6 +494,7 @@ func runNode(cmd *cobra.Command, args []string) {
*optimismContract = unsafeDevModeEvmContractAddress(*optimismContract)
*baseContract = unsafeDevModeEvmContractAddress(*baseContract)
*sepoliaContract = unsafeDevModeEvmContractAddress(*sepoliaContract)
*scrollContract = unsafeDevModeEvmContractAddress(*scrollContract)
}

// Verify flags
Expand Down Expand Up @@ -621,6 +628,10 @@ func runNode(cmd *cobra.Command, args []string) {
logger.Fatal("Both --baseContract and --baseRPC must be set together or both unset")
}

if (*scrollRPC == "") != (*scrollContract == "") {
logger.Fatal("Both --scrollContract and --scrollRPC must be set together or both unset")
}

if *gatewayWS != "" {
if *gatewayLCD == "" || *gatewayContract == "" {
logger.Fatal("If --gatewayWS is specified, then --gatewayLCD and --gatewayContract must be specified")
Expand Down Expand Up @@ -861,6 +872,7 @@ func runNode(cmd *cobra.Command, args []string) {
if env == common.TestNet {
rpcMap["sepoliaRPC"] = *sepoliaRPC
}
rpcMap["scrollRPC"] = *scrollRPC
rpcMap["solanaRPC"] = *solanaRPC
rpcMap["suiRPC"] = *suiRPC
rpcMap["terraWS"] = *terraWS
Expand Down Expand Up @@ -1228,6 +1240,17 @@ func runNode(cmd *cobra.Command, args []string) {
watcherConfigs = append(watcherConfigs, wc)
}

if shouldStart(scrollRPC) {
wc := &evm.WatcherConfig{
NetworkID: "scroll",
ChainID: vaa.ChainIDScroll,
Rpc: *scrollRPC,
Contract: *scrollContract,
}

watcherConfigs = append(watcherConfigs, wc)
}

if shouldStart(terraWS) {
wc := &cosmwasm.WatcherConfig{
NetworkID: "terra",
Expand Down
193 changes: 99 additions & 94 deletions node/pkg/proto/publicrpc/v1/publicrpc.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions proto/publicrpc/v1/publicrpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ enum ChainID {
CHAIN_ID_BTC = 29;
CHAIN_ID_BASE = 30;
CHAIN_ID_SEI = 32;
// CHAIN_ID_ROOTSTOCK = 33;
CHAIN_ID_SCROLL = 34;
CHAIN_ID_SEPOLIA = 10002;
}

Expand Down
18 changes: 18 additions & 0 deletions sdk/js/src/utils/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const CHAINS = {
base: 30,
sei: 32,
rootstock: 33,
scroll: 34,
wormchain: 3104,
cosmoshub: 4000,
evmos: 4001,
Expand Down Expand Up @@ -64,6 +65,7 @@ export const EVMChainNames = [
"gnosis",
"base",
"rootstock",
"scroll",
"sepolia",
] as const;
export type EVMChainName = typeof EVMChainNames[number];
Expand Down Expand Up @@ -272,6 +274,11 @@ const MAINNET = {
token_bridge: undefined,
nft_bridge: undefined,
},
scroll: {
core: undefined,
token_bridge: undefined,
nft_bridge: undefined,
},
wormchain: {
core: "wormhole1ufs3tlq4umljk0qfe8k5ya0x6hpavn897u2cnf9k0en9jr7qarqqaqfk2j",
token_bridge:
Expand Down Expand Up @@ -468,6 +475,11 @@ const TESTNET = {
token_bridge: undefined,
nft_bridge: undefined,
},
scroll: {
core: "0x055F47F1250012C6B20c436570a76e52c17Af2D5",
token_bridge: "0x22427d90B7dA3fA4642F7025A854c7254E4e45BF",
nft_bridge: "0x47B9a1406BEe29a3001BFEB7e45aE45fFFB40c18",
},
wormchain: {
core: "wormhole16jzpxp0e8550c9aht6q9svcux30vtyyyyxv5w2l2djjra46580wsazcjwp",
token_bridge:
Expand Down Expand Up @@ -661,6 +673,11 @@ const DEVNET = {
token_bridge: undefined,
nft_bridge: undefined,
},
scroll: {
core: undefined,
token_bridge: undefined,
nft_bridge: undefined,
},
wormchain: {
core: "wormhole17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgshdnj3k",
token_bridge:
Expand Down Expand Up @@ -759,6 +776,7 @@ export const CHAIN_ID_BTC = CHAINS["btc"];
export const CHAIN_ID_BASE = CHAINS["base"];
export const CHAIN_ID_SEI = CHAINS["sei"];
export const CHAIN_ID_ROOTSTOCK = CHAINS["rootstock"];
export const CHAIN_ID_SCROLL = CHAINS["scroll"];
export const CHAIN_ID_WORMCHAIN = CHAINS["wormchain"];
export const CHAIN_ID_GATEWAY = CHAIN_ID_WORMCHAIN;
export const CHAIN_ID_COSMOSHUB = CHAINS["cosmoshub"];
Expand Down
5 changes: 5 additions & 0 deletions sdk/rust/core/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub enum Chain {
Base,
Sei,
Rootstock,
Scroll,
Wormchain,
Sepolia,

Expand Down Expand Up @@ -85,6 +86,7 @@ impl From<u16> for Chain {
30 => Chain::Base,
32 => Chain::Sei,
33 => Chain::Rootstock,
34 => Chain::Scroll,
3104 => Chain::Wormchain,
10002 => Chain::Sepolia,
c => Chain::Unknown(c),
Expand Down Expand Up @@ -127,6 +129,7 @@ impl From<Chain> for u16 {
Chain::Base => 30,
Chain::Sei => 32,
Chain::Rootstock => 33,
Chain::Scroll => 34,
Chain::Wormchain => 3104,
Chain::Sepolia => 10002,
Chain::Unknown(c) => c,
Expand Down Expand Up @@ -169,6 +172,7 @@ impl fmt::Display for Chain {
Self::Base => f.write_str("Base"),
Self::Sei => f.write_str("Sei"),
Self::Rootstock => f.write_str("Rootstock"),
Self::Scroll => f.write_str("Scroll"),
Self::Sepolia => f.write_str("Sepolia"),
Self::Wormchain => f.write_str("Wormchain"),
Self::Unknown(v) => write!(f, "Unknown({v})"),
Expand Down Expand Up @@ -217,6 +221,7 @@ impl FromStr for Chain {
"Base" | "base" | "BASE" => Ok(Chain::Base),
"Sei" | "sei" | "SEI" => Ok(Chain::Sei),
"Rootstock" | "rootstock" | "ROOTSTOCK" => Ok(Chain::Rootstock),
"Scroll" | "scroll" | "SCROLL" => Ok(Chain::Scroll),
"Sepolia" | "sepolia" | "SEPOLIA" => Ok(Chain::Sepolia),
"Wormchain" | "wormchain" | "WORMCHAIN" => Ok(Chain::Wormchain),
_ => {
Expand Down
2 changes: 2 additions & 0 deletions sdk/testnet_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var knownTestnetTokenbridgeEmitters = map[vaa.ChainID]string{
vaa.ChainIDSui: "40440411a170b4842ae7dee4f4a7b7a58bc0a98566e998850a7bb87bf5dc05b9",
vaa.ChainIDBase: "000000000000000000000000A31aa3FDb7aF7Db93d18DDA4e19F811342EDF780",
vaa.ChainIDSei: "9328673cb5de3fd99974cefbbd90fea033f4c59a572abfd7e1a4eebcc5d18157",
vaa.ChainIDScroll: "00000000000000000000000022427d90B7dA3fA4642F7025A854c7254E4e45BF",
vaa.ChainIDSepolia: "000000000000000000000000DB5492265f6038831E89f495670FF909aDe94bd9",
vaa.ChainIDWormchain: "ef5251ea1e99ae48732800ccc7b83b57881232a73eb796b63b1d86ed2ea44e27",
}
Expand All @@ -58,5 +59,6 @@ var knownTestnetNFTBridgeEmitters = map[vaa.ChainID]string{
vaa.ChainIDOptimism: "00000000000000000000000023908A62110e21C04F3A4e011d24F901F911744A",
vaa.ChainIDNeon: "00000000000000000000000023908a62110e21c04f3a4e011d24f901f911744a",
vaa.ChainIDBase: "000000000000000000000000F681d1cc5F25a3694E348e7975d7564Aa581db59",
vaa.ChainIDScroll: "00000000000000000000000047B9a1406BEe29a3001BFEB7e45aE45fFFB40c18",
vaa.ChainIDSepolia: "0000000000000000000000006a0B52ac198e4870e5F3797d5B403838a5bbFD99",
}
7 changes: 7 additions & 0 deletions sdk/vaa/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ func (c ChainID) String() string {
return "base"
case ChainIDSei:
return "sei"
case ChainIDScroll:
return "scroll"
case ChainIDSepolia:
return "sepolia"
default:
Expand Down Expand Up @@ -281,6 +283,8 @@ func ChainIDFromString(s string) (ChainID, error) {
return ChainIDBase, nil
case "sei":
return ChainIDSei, nil
case "scroll":
return ChainIDScroll, nil
case "sepolia":
return ChainIDSepolia, nil
default:
Expand Down Expand Up @@ -318,6 +322,7 @@ func GetAllNetworkIDs() []ChainID {
ChainIDBtc,
ChainIDBase,
ChainIDSei,
ChainIDScroll,
ChainIDWormchain,
ChainIDSepolia,
}
Expand Down Expand Up @@ -381,6 +386,8 @@ const (
ChainIDBase ChainID = 30
// ChainIDSei is the ChainID of Sei
ChainIDSei ChainID = 32
// ChainIDScroll is the ChainID of Scroll
ChainIDScroll ChainID = 34
//ChainIDWormchain is the ChainID of Wormchain
ChainIDWormchain ChainID = 3104
// ChainIDSepolia is the ChainID of Sepolia
Expand Down

0 comments on commit 1a539b5

Please sign in to comment.