pyth-crosschain/terra
Ali Behjati b2becab951
Abehjati/cleanup again (#215)
* Remove unneeded and unused stuff

* removes guardian + use fixed version release of it

* Remove more stuff
2022-05-20 12:43:31 +02:00
..
contracts Abehjati/cleanup again (#215) 2022-05-20 12:43:31 +02:00
devnet sdk/js: Updated terra dependencies 2022-02-10 16:15:06 -05:00
packages/cw721 terra/nft_bridge: vendor cw721 and cw721-base (#696) 2022-01-07 16:43:53 +01:00
test fix bytes -> string, flip arg order to be less confusing 2021-07-28 16:00:44 +00:00
tools Abehjati/cleanup again (#215) 2022-05-20 12:43:31 +02:00
.dockerignore Terra contract deployment moved to a separate k8s job (#130) 2020-12-03 14:37:23 +01:00
.gitignore Merge Dev.v2 into main (#181) 2022-04-11 18:15:20 +02:00
Cargo.lock Abehjati/cleanup again (#215) 2022-05-20 12:43:31 +02:00
Cargo.toml Abehjati/cleanup again (#215) 2022-05-20 12:43:31 +02:00
Dockerfile.build Add terra build & deploy instructions 2022-02-10 15:37:19 -05:00
README.md Add terra migrate instructions 2022-02-10 15:37:19 -05:00
README.pyth.md Merge Dev.v2 into main (#181) 2022-04-11 18:15:20 +02:00
build.sh Merge Dev.v2 into main (#181) 2022-04-11 18:15:20 +02:00
rustfmt.toml Abehjati/refactor-pyth-terra-contract (#195) 2022-05-02 14:47:58 +02:00

README.md

Deploy

First build the contracts

docker build -f Dockerfile.build -o artifacts .

Then, for example, to deploy token_bridge.wasm, run in the tools directory

npm ci
node deploy_single.js --network mainnet --artifact ../artifacts/token_bridge.wasm --mnemonic "..."

which will print something along the lines of

Storing WASM: ../artifacts/token_bridge.wasm (367689 bytes)
Deploy fee:  88446uluna
Code ID:  2435

Migrate

Mainnet

Migrations on mainnet have to go through governance. Once the guardians sign the upgrade VAA, the contract can be upgraded by submitting the signed VAA to the appropriate contract. For example, to upgrade the token bridge on mainnet, in wormhole/clients/token_bridge/:

node main.js terra execute_governance_vaa <signed VAA (hex)> --rpc "https://lcd.terra.dev" --chain_id "columbus-5" --mnemonic "..." --token_bridge "terra10nmmwe8r3g99a9newtqa7a75xfgs2e8z87r2sf"

Testnet

For example, to migrate the token bridge to 37262, run in tools/:

node migrate_testnet.js --code_id 37262 --contract terra1pseddrv0yfsn76u4zxrjmtf45kdlmalswdv39a --mnemonic "..."