diff --git a/target_chains/cosmwasm/tools/README.md b/target_chains/cosmwasm/tools/README.md new file mode 100644 index 00000000..74d3f465 --- /dev/null +++ b/target_chains/cosmwasm/tools/README.md @@ -0,0 +1,26 @@ +# How to add a new chain for deployment + +1. Add the chain name to `ChainId` enum in `chains-manager/chains.ts` +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). +3. Add the contract configs to `CHAINS_CONTRACT_CONFIG` in `configs.ts` +4. Add the ChainId either to `getChainIdsForStableDeployment` or `getChainIdsForEdgeDeployment` functions in `helper.ts` +5. If the wormhole contract is not deployed on the target chain run the following command: + +``` +ts-node src/wormhole-stub.ts --mnemonic "" --deploy +``` + +6. Deploy the pyth contract: + +``` +ts-node src/instantiate-pyth.ts --contract-version --mnemonic "" --deploy +``` + +7. Test the new contract: + +``` +ts-node src/test.ts --mnemonic "" --deploy +``` + +8. Commit the new json files to the repo +9. Update documentation repos and add the new contract address diff --git a/target_chains/cosmwasm/tools/src/chains-manager/chains.ts b/target_chains/cosmwasm/tools/src/chains-manager/chains.ts index c8f2a723..a86fc2a7 100644 --- a/target_chains/cosmwasm/tools/src/chains-manager/chains.ts +++ b/target_chains/cosmwasm/tools/src/chains-manager/chains.ts @@ -24,6 +24,7 @@ export enum ChainId { INJECTIVE = "injective", OSMOSIS = "osmosis", SEI_PACIFIC_1 = "sei_pacific_1", + NEUTRON = "neutron", } export const ChainIds = Object.values(ChainId); @@ -129,6 +130,14 @@ export const CHAINS_NETWORK_CONFIG: Record = { prefix: "sei", gasPrice: "0.025usei", }, + [ChainId.NEUTRON]: { + chainId: ChainId.NEUTRON, + chainType: ChainType.COSMWASM, + executorEndpoint: "https://rpc-kralum.neutron-1.neutron.org", + querierEndpoint: "https://rpc-kralum.neutron-1.neutron.org", + prefix: "neutron", + gasPrice: "0.025untrn", + }, }; /** diff --git a/target_chains/cosmwasm/tools/src/configs.ts b/target_chains/cosmwasm/tools/src/configs.ts index 7b385f60..482ab89d 100644 --- a/target_chains/cosmwasm/tools/src/configs.ts +++ b/target_chains/cosmwasm/tools/src/configs.ts @@ -56,6 +56,11 @@ export const CHAINS_CONTRACT_CONFIG: Record = { pythArtifactZipName: "cosmwasm", wormholeChainId: CHAINS.sei_pacific_1, }, + [ChainId.NEUTRON]: { + feeDenom: "untrn", + pythArtifactZipName: "cosmwasm", + wormholeChainId: CHAINS.neutron, + }, }; function getPythSources(deploymentType: DeploymentType) { diff --git a/target_chains/cosmwasm/tools/src/helper.ts b/target_chains/cosmwasm/tools/src/helper.ts index c86e19c0..115d31e4 100644 --- a/target_chains/cosmwasm/tools/src/helper.ts +++ b/target_chains/cosmwasm/tools/src/helper.ts @@ -15,6 +15,7 @@ export function getChainIdsForStableDeployment(): ChainId[] { ChainId.NEUTRON_TESTNET_PION_1, ChainId.JUNO_TESTNET, ChainId.SEI_PACIFIC_1, + ChainId.NEUTRON, ]; } diff --git a/target_chains/cosmwasm/tools/store/stable/instantiate-pyth/neutron-1.2.0.json b/target_chains/cosmwasm/tools/store/stable/instantiate-pyth/neutron-1.2.0.json new file mode 100644 index 00000000..f09419b1 --- /dev/null +++ b/target_chains/cosmwasm/tools/store/stable/instantiate-pyth/neutron-1.2.0.json @@ -0,0 +1,22 @@ +{ + "deploy-pyth-code": { + "status": "fulfilled", + "result": { + "codeId": 67, + "txHash": "8324A0429E8460E0F58F214E17D07ADCD689236A95B433F721E8757D7F8038E6" + } + }, + "instantiate-contract": { + "status": "fulfilled", + "result": { + "contractAddr": "neutron1m2emc93m9gpwgsrsf2vylv9xvgqh654630v7dfrhrkmr5slly53spg85wv", + "txHash": "12D99EBE9E9C3772EB321FC313C0741C792DD3FFF39D86093F4AF441E50A9821" + } + }, + "set-own-admin": { + "status": "fulfilled", + "result": { + "txHash": "0A8FE81BB3253FD4233990F27087FDCF0642E5C5631FEA034369503AAE48F737" + } + } +} diff --git a/target_chains/cosmwasm/tools/store/stable/test-contracts/neutron-1.2.0.json b/target_chains/cosmwasm/tools/store/stable/test-contracts/neutron-1.2.0.json new file mode 100644 index 00000000..f5ece348 --- /dev/null +++ b/target_chains/cosmwasm/tools/store/stable/test-contracts/neutron-1.2.0.json @@ -0,0 +1,28 @@ +{ + "push-price-update": { + "status": "fulfilled", + "result": { + "txHash": "7EB152F2171A6AA3EEC3DB3183C8B756337D9A38105A234D75A79BDF1EDAB163" + } + }, + "fetch-price-feed-update": { + "status": "fulfilled", + "result": { + "price_feed": { + "id": "e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43", + "price": { + "price": "3080340250000", + "conf": "613359448", + "expo": -8, + "publish_time": 1688123199 + }, + "ema_price": { + "price": "3079387100000", + "conf": "795037770", + "expo": -8, + "publish_time": 1688123199 + } + } + } + } +} diff --git a/target_chains/cosmwasm/wormhole-stub/stable/neutron-2.14.9.json b/target_chains/cosmwasm/wormhole-stub/stable/neutron-2.14.9.json new file mode 100644 index 00000000..9c47324b --- /dev/null +++ b/target_chains/cosmwasm/wormhole-stub/stable/neutron-2.14.9.json @@ -0,0 +1,40 @@ +{ + "deploy-wormhole-code": { + "status": "fulfilled", + "result": { + "codeId": 66, + "txHash": "E8B5D4BD00FC78526D77903CB2792CA797ECBBF06E88AE07EADF033640DD3FA3" + } + }, + "instantiate-contract": { + "status": "fulfilled", + "result": { + "contractAddr": "neutron178ruq7gf6gk3uus5n8xztj5tsrt5xwxfelw88mc9egfw5d99ktksnk5rsh", + "txHash": "401BC50543E670CEFECE12A13A1A86EF15EB73E72B73FD616ECA0692109FF890" + } + }, + "set-own-admin": { + "status": "fulfilled", + "result": { + "txHash": "63C866FA2F09B351C4DBC3C3E5CC0EE8A0E4F572D68AEE032EE51805B4A9878C" + } + }, + "GUARDIAN_SET_UPGRADE_1_VAA": { + "status": "fulfilled", + "result": { + "txHash": "340C5F8F560ABD59AB5B8401D137BE150A10CC04BD42133F2A454E0716B6A181" + } + }, + "GUARDIAN_SET_UPGRADE_2_VAA": { + "status": "fulfilled", + "result": { + "txHash": "31F239C4A411C97FD108FE53E72BFC55CC259AEB2AB846C2A96F3F80DEBBF7CE" + } + }, + "GUARDIAN_SET_UPGRADE_3_VAA": { + "status": "fulfilled", + "result": { + "txHash": "A7F5BB426E0DB86FC189E7075AA8A5B8C5EC807ECA59E94C117F604F0E19B6FA" + } + } +}