Skip to content

Commit e5fd5a9

Browse files
authored
[target_chains] Add deployment information for neutron mainnet (#930)
* Deploy pyth cosmwasm 1.2.0 contract to neutron mainnet
1 parent 5e44fa4 commit e5fd5a9

File tree

7 files changed

+131
-0
lines changed

7 files changed

+131
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# How to add a new chain for deployment
2+
3+
1. Add the chain name to `ChainId` enum in `chains-manager/chains.ts`
4+
2. Add the network configs to `CHAINS_NETWORK_CONFIG` in `chains-manager/chains.ts`. You can lookup for rpc endpoints in [this repo](https://github.com/cosmos/chain-registry). The `gasPrice` is the `average_gas_price` of the chain + the chain token `denom` (Available in chain-registry `chain.json` file).
5+
3. Add the contract configs to `CHAINS_CONTRACT_CONFIG` in `configs.ts`
6+
4. Add the ChainId either to `getChainIdsForStableDeployment` or `getChainIdsForEdgeDeployment` functions in `helper.ts`
7+
5. If the wormhole contract is not deployed on the target chain run the following command:
8+
9+
```
10+
ts-node src/wormhole-stub.ts --mnemonic "<YOUR_MNEMONIC>" --deploy <stable or edge>
11+
```
12+
13+
6. Deploy the pyth contract:
14+
15+
```
16+
ts-node src/instantiate-pyth.ts --contract-version <X.Y.Z> --mnemonic "<YOUR_MNEMONIC>" --deploy <stable or edge>
17+
```
18+
19+
7. Test the new contract:
20+
21+
```
22+
ts-node src/test.ts --mnemonic "<YOUR_MNEMONIC>" --deploy <stable or edge>
23+
```
24+
25+
8. Commit the new json files to the repo
26+
9. Update documentation repos and add the new contract address

target_chains/cosmwasm/tools/src/chains-manager/chains.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export enum ChainId {
2424
INJECTIVE = "injective",
2525
OSMOSIS = "osmosis",
2626
SEI_PACIFIC_1 = "sei_pacific_1",
27+
NEUTRON = "neutron",
2728
}
2829

2930
export const ChainIds = Object.values(ChainId);
@@ -129,6 +130,14 @@ export const CHAINS_NETWORK_CONFIG: Record<ChainId, ChainNetworkConfig> = {
129130
prefix: "sei",
130131
gasPrice: "0.025usei",
131132
},
133+
[ChainId.NEUTRON]: {
134+
chainId: ChainId.NEUTRON,
135+
chainType: ChainType.COSMWASM,
136+
executorEndpoint: "https://rpc-kralum.neutron-1.neutron.org",
137+
querierEndpoint: "https://rpc-kralum.neutron-1.neutron.org",
138+
prefix: "neutron",
139+
gasPrice: "0.025untrn",
140+
},
132141
};
133142

134143
/**

target_chains/cosmwasm/tools/src/configs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export const CHAINS_CONTRACT_CONFIG: Record<ChainId, ChainContractConfig> = {
5656
pythArtifactZipName: "cosmwasm",
5757
wormholeChainId: CHAINS.sei_pacific_1,
5858
},
59+
[ChainId.NEUTRON]: {
60+
feeDenom: "untrn",
61+
pythArtifactZipName: "cosmwasm",
62+
wormholeChainId: CHAINS.neutron,
63+
},
5964
};
6065

6166
function getPythSources(deploymentType: DeploymentType) {

target_chains/cosmwasm/tools/src/helper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export function getChainIdsForStableDeployment(): ChainId[] {
1515
ChainId.NEUTRON_TESTNET_PION_1,
1616
ChainId.JUNO_TESTNET,
1717
ChainId.SEI_PACIFIC_1,
18+
ChainId.NEUTRON,
1819
];
1920
}
2021

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"deploy-pyth-code": {
3+
"status": "fulfilled",
4+
"result": {
5+
"codeId": 67,
6+
"txHash": "8324A0429E8460E0F58F214E17D07ADCD689236A95B433F721E8757D7F8038E6"
7+
}
8+
},
9+
"instantiate-contract": {
10+
"status": "fulfilled",
11+
"result": {
12+
"contractAddr": "neutron1m2emc93m9gpwgsrsf2vylv9xvgqh654630v7dfrhrkmr5slly53spg85wv",
13+
"txHash": "12D99EBE9E9C3772EB321FC313C0741C792DD3FFF39D86093F4AF441E50A9821"
14+
}
15+
},
16+
"set-own-admin": {
17+
"status": "fulfilled",
18+
"result": {
19+
"txHash": "0A8FE81BB3253FD4233990F27087FDCF0642E5C5631FEA034369503AAE48F737"
20+
}
21+
}
22+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"push-price-update": {
3+
"status": "fulfilled",
4+
"result": {
5+
"txHash": "7EB152F2171A6AA3EEC3DB3183C8B756337D9A38105A234D75A79BDF1EDAB163"
6+
}
7+
},
8+
"fetch-price-feed-update": {
9+
"status": "fulfilled",
10+
"result": {
11+
"price_feed": {
12+
"id": "e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43",
13+
"price": {
14+
"price": "3080340250000",
15+
"conf": "613359448",
16+
"expo": -8,
17+
"publish_time": 1688123199
18+
},
19+
"ema_price": {
20+
"price": "3079387100000",
21+
"conf": "795037770",
22+
"expo": -8,
23+
"publish_time": 1688123199
24+
}
25+
}
26+
}
27+
}
28+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"deploy-wormhole-code": {
3+
"status": "fulfilled",
4+
"result": {
5+
"codeId": 66,
6+
"txHash": "E8B5D4BD00FC78526D77903CB2792CA797ECBBF06E88AE07EADF033640DD3FA3"
7+
}
8+
},
9+
"instantiate-contract": {
10+
"status": "fulfilled",
11+
"result": {
12+
"contractAddr": "neutron178ruq7gf6gk3uus5n8xztj5tsrt5xwxfelw88mc9egfw5d99ktksnk5rsh",
13+
"txHash": "401BC50543E670CEFECE12A13A1A86EF15EB73E72B73FD616ECA0692109FF890"
14+
}
15+
},
16+
"set-own-admin": {
17+
"status": "fulfilled",
18+
"result": {
19+
"txHash": "63C866FA2F09B351C4DBC3C3E5CC0EE8A0E4F572D68AEE032EE51805B4A9878C"
20+
}
21+
},
22+
"GUARDIAN_SET_UPGRADE_1_VAA": {
23+
"status": "fulfilled",
24+
"result": {
25+
"txHash": "340C5F8F560ABD59AB5B8401D137BE150A10CC04BD42133F2A454E0716B6A181"
26+
}
27+
},
28+
"GUARDIAN_SET_UPGRADE_2_VAA": {
29+
"status": "fulfilled",
30+
"result": {
31+
"txHash": "31F239C4A411C97FD108FE53E72BFC55CC259AEB2AB846C2A96F3F80DEBBF7CE"
32+
}
33+
},
34+
"GUARDIAN_SET_UPGRADE_3_VAA": {
35+
"status": "fulfilled",
36+
"result": {
37+
"txHash": "A7F5BB426E0DB86FC189E7075AA8A5B8C5EC807ECA59E94C117F604F0E19B6FA"
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)