Abehjati/use-cw-1-for-contracts (#240)

* Bump version of cw packages from 0.16.0 to 1.0.0

* Fix build

* Update wormhole details

* Update js packages

* Update dockers, configs, to use cosmwasm 2 in tilt

* Update wormhole and pyth addresses everywhere

The migration file is probably not necessary for us.
To be deleted later.

* Update gh action name
This commit is contained in:
Ali Behjati 2022-07-20 19:05:01 +04:30 committed by GitHub
parent 59ac319305
commit 07bf9dbee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 2626 additions and 736 deletions

View File

@ -1,4 +1,4 @@
name: Pyth Terra Contract
name: Pyth CosmWasm Contract
on:
pull_request:

View File

@ -1,13 +1,13 @@
# This is a multi-stage docker file, first stage builds contracts
# And the second one creates node.js environment to deploy them
FROM cosmwasm/workspace-optimizer:0.12.1@sha256:1508cf7545f4b656ecafa34e29c1acf200cdab47fced85c2bc076c0c158b1338 AS builder
FROM cosmwasm/workspace-optimizer:0.12.6@sha256:e6565a5e87c830ef3e8775a9035006b38ad0aaf0a96319158c802457b1dd1d08 AS builder
COPY cosmwasm/Cargo.lock /code/
COPY cosmwasm/Cargo.toml /code/
COPY cosmwasm/contracts /code/contracts
COPY cosmwasm/packages /code/packages
COPY third_party/pyth/p2w-sdk/rust /third_party/pyth/p2w-sdk/rust
RUN optimize_workspace.sh
RUN --mount=type=cache,target=/code/target,id=cosmwasm_target --mount=type=cache,target=/usr/local/cargo/registry optimize_workspace.sh
# Contract deployment stage
FROM node:16-buster-slim@sha256:93c9fc3550f5f7d159f282027228e90e3a7f8bf38544758024f005e82607f546

922
cosmwasm/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -14,8 +14,8 @@ backtraces = ["cosmwasm-std/backtraces"]
library = []
[dependencies]
cosmwasm-std = { version = "0.16.0" }
cosmwasm-storage = { version = "0.16.0" }
cosmwasm-std = { version = "1.0.0" }
cosmwasm-storage = { version = "1.0.0" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
serde_derive = { version = "1.0.103"}
@ -33,5 +33,5 @@ solana-program = "=1.8.16"
pyth-sdk = "0.4.2"
[dev-dependencies]
cosmwasm-vm = { version = "0.16.0", default-features = false }
cosmwasm-vm = { version = "1.0.0", default-features = false }
serde_json = "1.0"

View File

@ -252,7 +252,7 @@ mod test {
use super::*;
fn setup_test() -> (OwnedDeps<MockStorage, MockApi, MockQuerier>, Env) {
(mock_dependencies(&[]), mock_env())
(mock_dependencies(), mock_env())
}
fn create_zero_vaa() -> ParsedVAA {

View File

@ -15,8 +15,8 @@ backtraces = ["cosmwasm-std/backtraces"]
library = []
[dependencies]
cosmwasm-std = { version = "0.16.0" }
cosmwasm-storage = { version = "0.16.0" }
cosmwasm-std = { version = "1.0.0" }
cosmwasm-storage = { version = "1.0.0" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.20" }
@ -28,5 +28,5 @@ hex = "0.4.2"
lazy_static = "1.4.0"
[dev-dependencies]
cosmwasm-vm = { version = "0.16.0", default-features = false }
cosmwasm-vm = { version = "1.0.0", default-features = false }
serde_json = "1.0"

View File

@ -43,8 +43,12 @@ impl ByteUtils for &[u8] {
(self.get_u128_be(index), self.get_u128_be(index + 128 / 8))
}
fn get_address(&self, index: usize) -> CanonicalAddr {
// 32 bytes are reserved for addresses, but only the last 20 bytes are taken by the actual address
CanonicalAddr::from(&self[index + 32 - 20..index + 32])
// 32 bytes are reserved for addresses, but wasmd uses both 32 and 20 bytes
// https://github.com/CosmWasm/wasmd/blob/ac92fdcf37388cc8dc24535f301f64395f8fb3da/x/wasm/types/types.go#L325
if self.get_u128_be(index) >> 32 == 0 {
return CanonicalAddr::from(&self[index + 12..index + 32])
}
return CanonicalAddr::from(&self[index..index + 32])
}
fn get_bytes32(&self, index: usize) -> &[u8] {
&self[index..index + 32]
@ -67,7 +71,7 @@ pub fn extend_address_to_32(addr: &CanonicalAddr) -> Vec<u8> {
}
pub fn extend_address_to_32_array(addr: &CanonicalAddr) -> [u8; 32] {
let mut v: Vec<u8> = vec![0; 12];
let mut v: Vec<u8> = vec![0; 32 - addr.len()];
v.extend(addr.as_slice());
let mut result: [u8; 32] = [0; 32];
result.copy_from_slice(&v);

View File

@ -1,3 +1,3 @@
FROM terramoney/localterra-core:bombay@sha256:0f93576ae0716f835b2adbd5ac550ef90063b536e99c4dd682b6dd905927f261
FROM terramoney/localterra-core:2.0.1@sha256:73faa857d32b869b6bd3bf062351bd47ca5440d758dc07d5481424b9a9bdaede
ADD config /root/.terra/config
COPY config /root/.terra/config

View File

@ -8,11 +8,11 @@
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of any denomination
# specified in this config (e.g. 0.25token1;0.0001token2).
minimum-gas-prices = "0.01133uluna,0.15uusd,0.104938usdr,169.77ukrw,428.571umnt,0.125ueur,0.98ucny,16.37ujpy,0.11ugbp,10.88uinr,0.19ucad,0.14uchf,0.19uaud,0.2usgd,4.62uthb,1.25usek"
minimum-gas-prices = "0.15uluna"
# default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals
# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node)
# everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals
# everything: all saved states will be deleted, storing only the current and previous state; pruning at 10 block intervals
# custom: allow pruning options to be manually specified through 'pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval'
pruning = "default"
@ -44,7 +44,7 @@ halt-time = 0
# It has no bearing on application state pruning which is determined by the
# "pruning-*" configurations.
#
# Note: Tendermint block pruning is dependant on this parameter in conjunction
# Note: Tendermint block pruning is dependant on this parameter in conunction
# with the unbonding (safety threshold) period, state pruning and state sync
# snapshot parameters to determine the correct minimum value of
# ResponseCommit.RetainHeight.
@ -60,6 +60,10 @@ inter-block-cache = true
# ["message.sender", "message.recipient"]
index-events = []
# IavlCacheSize set the size of the iavl tree cache.
# Default cache size is 50mb.
iavl-cache-size = 781250
###############################################################################
### Telemetry Configuration ###
###############################################################################
@ -116,7 +120,7 @@ max-open-connections = 1000
rpc-read-timeout = 10
# RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds).
rpc-write-timeout = 30
rpc-write-timeout = 0
# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes).
rpc-max-body-bytes = 1000000
@ -192,15 +196,8 @@ snapshot-interval = 0
snapshot-keep-recent = 2
[wasm]
# The maximum gas amount can be spent for contract query.
# The contract query will invoke contract execution vm,
# so we need to restrict the max usage to prevent DoS attack
contract-query-gas-limit = "3000000"
# The flag to specify whether print contract logs or not
contract-debug-mode = "false"
# The WASM VM memory cache size in MiB not bytes
contract-memory-cache-size = "500"
contract-logging-whitelist = "*"
# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries
query_gas_limit = 300000
# This is the number of wasm vm instances we keep cached in memory for speed-up
# Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally
lru_size = 0

View File

@ -12,7 +12,7 @@
# TCP or UNIX socket address of the ABCI application,
# or the name of an ABCI application compiled in with the Tendermint binary
proxy_app = "tcp://127.0.0.1:26656"
proxy_app = "tcp://127.0.0.1:26658"
# A custom human readable name for this node
moniker = "localterra"
@ -47,7 +47,7 @@ db_backend = "goleveldb"
db_dir = "data"
# Output level for logging, including package level options
log_level = "debug"
log_level = "info"
# Output format: 'plain' (colored text) or 'json'
log_format = "plain"
@ -136,14 +136,41 @@ max_subscription_clients = 100
# the estimated # maximum number of broadcast_tx_commit calls per block.
max_subscriptions_per_client = 5
# Experimental parameter to specify the maximum number of events a node will
# buffer, per subscription, before returning an error and closing the
# subscription. Must be set to at least 100, but higher values will accommodate
# higher event throughput rates (and will use more memory).
experimental_subscription_buffer_size = 200
# Experimental parameter to specify the maximum number of RPC responses that
# can be buffered per WebSocket client. If clients cannot read from the
# WebSocket endpoint fast enough, they will be disconnected, so increasing this
# parameter may reduce the chances of them being disconnected (but will cause
# the node to use more memory).
#
# Must be at least the same as "experimental_subscription_buffer_size",
# otherwise connections could be dropped unnecessarily. This value should
# ideally be somewhat higher than "experimental_subscription_buffer_size" to
# accommodate non-subscription-related RPC responses.
experimental_websocket_write_buffer_size = 200
# If a WebSocket client cannot read fast enough, at present we may
# silently drop events instead of generating an error or disconnecting the
# client.
#
# Enabling this experimental parameter will cause the WebSocket connection to
# be closed instead if it cannot read fast enough, allowing for greater
# predictability in subscription behaviour.
experimental_close_on_slow_client = false
# How long to wait for a tx to be committed during /broadcast_tx_commit.
# WARNING: Using a value larger than 10s will result in increasing the
# global HTTP write timeout, which applies to all connections and endpoints.
# See https://github.com/tendermint/tendermint/issues/3435
timeout_broadcast_tx_commit = "10s"
timeout_broadcast_tx_commit = "30s"
# Maximum size of request body, in bytes
max_body_bytes = 4194304
max_body_bytes = 1000000
# Maximum size of request header, in bytes
max_header_bytes = 1048576
@ -172,12 +199,13 @@ pprof_laddr = "localhost:6060"
[p2p]
# Address to listen for incoming connections
laddr = "tcp://0.0.0.0:26660"
laddr = "tcp://0.0.0.0:26656"
# Address to advertise to peers for them to dial
# If empty, will use the same port as the laddr,
# and will introspect on the listener or use UPnP
# to figure out the address.
# to figure out the address. ip and port are required
# example: 159.89.10.97:26656
external_address = ""
# Comma separated list of seed nodes to connect to
@ -302,6 +330,13 @@ discovery_time = "15s"
# Will create a new, randomly named directory within, and remove it when done.
temp_dir = ""
# The timeout duration before re-requesting a chunk, possibly from a different
# peer (default: 1 minute).
chunk_request_timeout = "10s"
# The number of concurrent chunk fetchers to run (default: 1).
chunk_fetchers = "4"
#######################################################
### Fast Sync Configuration Connections ###
#######################################################

View File

@ -1,5 +1,5 @@
{
"genesis_time": "2021-05-26T10:02:06.396784Z",
"genesis_time": "2022-05-16T04:54:32.922225Z",
"chain_id": "localterra",
"initial_height": "1",
"consensus_params": {
@ -14,9 +14,7 @@
"max_bytes": "1048576"
},
"validator": {
"pub_key_types": [
"ed25519"
]
"pub_key_types": ["ed25519"]
},
"version": {}
},
@ -122,299 +120,107 @@
{
"address": "terra199vw7724lzkwz6lf2hsx04lrxfkz09tg8dlp6r",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra18wlvftxzj6zt0xugy2lr9nxzu402690ltaf4ss",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra1fmcjjt6yc9wqup2r06urnrd928jhrde6gcld6n",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra1dcegyrekltswvyy0xy69ydgxn9x8x32zdtapd8",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra1333veey879eeqcff8j3gfcgwt8cfrg9mq20v6f",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra1e8ryd9ezefuucd4mje33zdms9m2s90m57878v9",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra17tv2hvwpg0ukqgd2y5ct2w54fyan7z0zxrm2f9",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra1757tkx08n0cqrw7p86ny9lnxsqeth0wgp0em95",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
},
{
"address": "terra1lkccuqgj6sjwjn8gsa9xlklqv4pmrqg9dx2fxc",
"coins": [
{
"denom": "ueur",
"amount": "10000000000000000"
},
{
"denom": "ukrw",
"amount": "1000000000000000000"
},
{
"denom": "uluna",
"amount": "1000000000000000"
},
{
"denom": "usdr",
"amount": "10000000000000000"
},
{
"denom": "uusd",
"amount": "10000000000000000"
}
]
}
],
"supply": [
{
"denom": "ueur",
"amount": "110000000000000000"
},
{
"denom": "ukrw",
"amount": "11000000000000000000"
},
{
"denom": "uluna",
"amount": "11000000000000000"
},
{
"denom": "usdr",
"amount": "110000000000000000"
},
{
"denom": "uusd",
"amount": "110000000000000000"
}
],
"denom_metadata": []
@ -548,10 +354,7 @@
"clients_consensus": [],
"clients_metadata": [],
"params": {
"allowed_clients": [
"06-solomachine",
"07-tendermint"
]
"allowed_clients": ["06-solomachine", "07-tendermint"]
},
"create_localhost": false,
"next_client_sequence": "0"
@ -572,13 +375,6 @@
"next_channel_sequence": "0"
}
},
"market": {
"params": {
"base_pool": "7000000000000.000000000000000000",
"pool_recovery_period": "200",
"min_stability_spread": "0.005000000000000000"
}
},
"mint": {
"minter": {
"inflation": "0.130000000000000000",
@ -586,48 +382,13 @@
},
"params": {
"mint_denom": "uluna",
"inflation_rate_change": "0.000000000000000000",
"inflation_rate_change": "0.130000000000000000",
"inflation_max": "0.200000000000000000",
"inflation_min": "0.070000000000000000",
"goal_bonded": "0.670000000000000000",
"blocks_per_year": "6311520"
}
},
"oracle": {
"params": {
"vote_period": "5",
"vote_threshold": "0.500000000000000000",
"reward_band": "0.020000000000000000",
"reward_distribution_window": "5256000",
"whitelist": [
{
"name": "ukrw",
"tobin_tax": "0.002500000000000000"
},
{
"name": "usdr",
"tobin_tax": "0.002500000000000000"
},
{
"name": "uusd",
"tobin_tax": "0.002500000000000000"
},
{
"name": "ueur",
"tobin_tax": "0.002500000000000000"
}
],
"slash_fraction": "0.000100000000000000",
"slash_window": "100800",
"min_valid_per_window": "0.050000000000000000"
},
"feeder_delegations": [],
"exchange_rates": [],
"miss_counters": [],
"aggregate_exchange_rate_prevotes": [],
"aggregate_exchange_rate_votes": [],
"tobin_taxes": []
},
"params": null,
"slashing": {
"params": {
@ -664,51 +425,20 @@
"receive_enabled": true
}
},
"treasury": {
"params": {
"tax_policy": {
"rate_min": "0.000000000000000000",
"rate_max": "0.000000000000000000",
"cap": {
"denom": "usdr",
"amount": "0"
},
"change_rate_max": "0.000000000000000000"
},
"reward_policy": {
"rate_min": "0.000000000000000000",
"rate_max": "1.000000000000000000",
"cap": {
"denom": "unused",
"amount": "0"
},
"change_rate_max": "0.000000000000000000"
},
"seigniorage_burden_target": "0.670000000000000000",
"mining_increment": "1.070000000000000000",
"window_short": "4",
"window_long": "52",
"window_probation": "12"
},
"tax_rate": "0.001000000000000000",
"reward_weight": "0.050000000000000000",
"tax_caps": [],
"tax_proceeds": [],
"epoch_initial_issuance": [],
"epoch_states": []
},
"upgrade": {},
"vesting": null,
"wasm": {
"params": {
"max_contract_size": "614400",
"max_contract_gas": "20000000",
"max_contract_msg_size": "4096"
"code_upload_access": {
"permission": "Everybody",
"address": ""
},
"instantiate_default_permission": "Everybody"
},
"last_code_id": "0",
"last_instance_id": "0",
"codes": [],
"contracts": []
"contracts": [],
"sequences": [],
"gen_msgs": []
}
}
}

View File

@ -14,4 +14,4 @@ contract-query-gas-limit = "3000000"
# parameters for this, so we should allow node operators to set it.
lru-size = "0"
contract-logging-whitelist = "*"
contract-logging-whitelist = "*"

View File

@ -11,7 +11,7 @@ documentation = "https://docs.cosmwasm.com"
[dependencies]
cw0 = { version = "0.8.0" }
cosmwasm-std = { version = "0.16.0" }
cosmwasm-std = { version = "1.0.0" }
schemars = "0.8.6"
serde = { version = "1.0.130", default-features = false, features = ["derive"] }

View File

@ -1,8 +1,6 @@
import { LCDClient, MnemonicKey } from "@terra-money/terra.js";
import {
StdFee,
MsgInstantiateContract,
MsgExecuteContract,
MsgStoreCode,
} from "@terra-money/terra.js";
import { readFileSync, readdirSync } from "fs";
@ -110,7 +108,7 @@ const govChain = 1;
const govAddress =
"0000000000000000000000000000000000000000000000000000000000000004";
async function instantiate(contract, inst_msg) {
async function instantiate(contract, inst_msg, label) {
var address;
await wallet
.createAndSignTx({
@ -119,14 +117,16 @@ async function instantiate(contract, inst_msg) {
wallet.key.accAddress,
wallet.key.accAddress,
codeIds[contract],
inst_msg
inst_msg,
undefined,
label
),
],
memo: "",
})
.then((tx) => terra.tx.broadcast(tx))
.then((rs) => {
address = /"contract_address","value":"([^"]+)/gm.exec(rs.raw_log)[1];
address = /"_contract_address","value":"([^"]+)/gm.exec(rs.raw_log)[1];
});
console.log(`Instantiated ${contract} at ${address} (${convert_terra_address_to_hex(address)})`);
return address;
@ -152,7 +152,7 @@ addresses["wormhole.wasm"] = await instantiate("wormhole.wasm", {
],
expiration_time: 0,
},
});
}, "wormhole");
const pythEmitterAddress =
"71f8dcb863d176e2c420ad6610cf687359612b6fb392e0642b0ca6b1f186aa3b";
@ -164,7 +164,7 @@ addresses["pyth_bridge.wasm"] = await instantiate("pyth_bridge.wasm", {
"base64"
),
pyth_emitter_chain: pythChain,
});
}, "pyth");
// Terra addresses are "human-readable", but for cross-chain registrations, we
// want the "canonical" version

View File

@ -59,7 +59,7 @@ async function main() {
msgs: [
new MsgMigrateContract(
wallet.key.accAddress,
"terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5",
"terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au",
codeIds["wormhole.wasm"],
{
"action": ""
@ -77,7 +77,7 @@ async function main() {
msgs: [
new MsgMigrateContract(
wallet.key.accAddress,
"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4",
"terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6",
codeIds["token_bridge.wasm"],
{
"action": ""
@ -96,8 +96,8 @@ async function main() {
msgs: [
new MsgUpdateContractAdmin(
wallet.key.accAddress,
"terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5",
"terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5"
"terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au",
"terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au"
),
],
memo: "",
@ -131,7 +131,7 @@ async function main() {
msgs: [
new MsgExecuteContract(
wallet.key.accAddress,
"terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5",
"terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au",
{
submit_v_a_a: {
vaa: Buffer.from(guardianUpgradeVAA, "hex").toString(
@ -157,7 +157,7 @@ async function main() {
msgs: [
new MsgExecuteContract(
wallet.key.accAddress,
"terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5",
"terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au",
{
submit_v_a_a: {
vaa: Buffer.from(upgradeVAA, "hex").toString(
@ -179,8 +179,8 @@ async function main() {
msgs: [
new MsgUpdateContractAdmin(
wallet.key.accAddress,
"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4",
"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4"
"terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6",
"terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6"
),
],
memo: "",
@ -197,7 +197,7 @@ async function main() {
msgs: [
new MsgExecuteContract(
wallet.key.accAddress,
"terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4",
"terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6",
{
submit_vaa: {
data: Buffer.from(upgradeTokenVAA, "hex").toString(

File diff suppressed because it is too large Load Diff

View File

@ -5,14 +5,14 @@
"main": "deploy.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"deploy-pyth": "node deploy-pyth-bridge.js"
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@terra-money/terra.js": "^2.0.11",
"@cosmjs/encoding": "^0.26.2",
"@terra-money/terra.js": "^3.1.3",
"dotenv": "^16.0.0",
"ethers": "^5.4.4",
"yargs": "^17.0.1"
}

View File

@ -94,7 +94,7 @@ spec:
- --terraLCD
- http://terra-terrad:1317
- --terraContract
- terra18vd8fpwxzck93qlwghaj6arh4p7c5n896xzem5
- terra14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9ssrc8au
- --solanaContract
- Bridge1p5gheXUvJ6jGWGeCsgPKgnE3YgdGKRVCMY9o
- --solanaWS

View File

@ -62,7 +62,7 @@ spec:
- name: TERRA_PRIVATE_KEY
value: notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius
- name: TERRA_PYTH_CONTRACT_ADDRESS
value: terra10pyejy66429refv3g35g2t7am0was7ya7kz2a4
value: terra1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrquka9l6
# ^^ It can change if order of terra contract creation changes or anything is added/removed in terra/tools/deploy.js
- name: TERRA_CHAIN_ID
value: localterra

View File

@ -138,7 +138,7 @@ spec:
app: terra-fcd
spec:
containers:
- image: terramoney/fcd:bombay
- image: terramoney/fcd:2.0.5
name: fcd-collector
args:
- collector
@ -168,7 +168,7 @@ spec:
value: "false"
- name: TYPEORM_ENTITIES
value: "src/orm/*Entity.ts"
- image: terramoney/fcd:bombay
- image: terramoney/fcd:2.0.5
name: fcd-api
args:
- start

View File

@ -1796,7 +1796,7 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "opentelemetry"
version = "0.16.0"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1cf9b1c4e9a6c4de793c632496fa490bdc0e1eea73f0c91394f7b6990935d22"
dependencies = [

View File

@ -14,7 +14,7 @@
"@certusone/wormhole-spydk": "^0.0.1",
"@solana/spl-token": "^0.1.8",
"@solana/web3.js": "^1.24.0",
"@terra-money/terra.js": "^3.0.4",
"@terra-money/terra.js": "^3.1.3",
"@typechain/ethers-v5": "^7.0.1",
"@types/express": "^4.17.13",
"async-mutex": "^0.3.2",
@ -44,11 +44,13 @@
}
},
"../p2w-sdk/js": {
"name": "@certusone/p2w-sdk",
"version": "0.1.0",
"license": "MIT",
"dependencies": {
"@certusone/wormhole-sdk": "0.2.1",
"@improbable-eng/grpc-web-node-http-transport": "^0.14.1"
"@improbable-eng/grpc-web-node-http-transport": "^0.14.1",
"@pythnetwork/pyth-sdk-js": "^0.1.0"
},
"devDependencies": {
"@openzeppelin/contracts": "^4.2.0",
@ -2180,13 +2182,25 @@
"react-dom": "^17.0.0"
}
},
"node_modules/@terra-money/terra.js": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-3.0.4.tgz",
"integrity": "sha512-PEYaPs0p521njZyD6a7aH6KrXRKdj4+j7kboM4qGc8FS/lKPFQUgacsVSlbAK0sYX/tOhINvN7eudwRBwuJVhw==",
"node_modules/@terra-money/legacy.proto": {
"name": "@terra-money/terra.proto",
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-0.1.7.tgz",
"integrity": "sha512-NXD7f6pQCulvo6+mv6MAPzhOkUzRjgYVuHZE/apih+lVnPG5hDBU0rRYnOGGofwvKT5/jQoOENnFn/gioWWnyQ==",
"dependencies": {
"@terra-money/terra.proto": "^0.1.7",
"axios": "^0.24.0",
"google-protobuf": "^3.17.3",
"long": "^4.0.0",
"protobufjs": "~6.11.2"
}
},
"node_modules/@terra-money/terra.js": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-3.1.3.tgz",
"integrity": "sha512-80HU5WXrqf3hZTo2GRhIycH17A+SkLD6afbu8MynMDGGD/A861F3zVv6NQ/Z7PWQGHxgddZEK/A0UQ2uK/xfHg==",
"dependencies": {
"@terra-money/legacy.proto": "npm:@terra-money/terra.proto@^0.1.7",
"@terra-money/terra.proto": "~2.0.0",
"axios": "^0.26.1",
"bech32": "^2.0.0",
"bip32": "^2.0.6",
"bip39": "^3.0.3",
@ -2203,6 +2217,25 @@
"node": ">=14"
}
},
"node_modules/@terra-money/terra.js/node_modules/@terra-money/terra.proto": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-2.0.0.tgz",
"integrity": "sha512-ZjyFOFUzrGn8IwzGIgr1OJFcPSsQoz/XAfoSKThJx+OjJA7CLhdcz51+5h7ehNfb+qB9wr7aNME0h24wu9D4SQ==",
"dependencies": {
"@improbable-eng/grpc-web": "^0.14.1",
"google-protobuf": "^3.17.3",
"long": "^4.0.0",
"protobufjs": "~6.11.2"
}
},
"node_modules/@terra-money/terra.js/node_modules/axios": {
"version": "0.26.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz",
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
"dependencies": {
"follow-redirects": "^1.14.8"
}
},
"node_modules/@terra-money/terra.proto": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-0.1.7.tgz",
@ -4226,9 +4259,9 @@
"integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
},
"node_modules/follow-redirects": {
"version": "1.14.5",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
"integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==",
"version": "1.15.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
"integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==",
"funding": [
{
"type": "individual",
@ -8360,6 +8393,7 @@
"@certusone/wormhole-sdk": "0.2.1",
"@improbable-eng/grpc-web-node-http-transport": "^0.14.1",
"@openzeppelin/contracts": "^4.2.0",
"@pythnetwork/pyth-sdk-js": "^0.1.0",
"@typechain/ethers-v5": "^7.1.2",
"@types/long": "^4.0.1",
"@types/node": "^16.6.1",
@ -9374,13 +9408,24 @@
"styled-components": "^5.0.0"
}
},
"@terra-money/terra.js": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-3.0.4.tgz",
"integrity": "sha512-PEYaPs0p521njZyD6a7aH6KrXRKdj4+j7kboM4qGc8FS/lKPFQUgacsVSlbAK0sYX/tOhINvN7eudwRBwuJVhw==",
"@terra-money/legacy.proto": {
"version": "npm:@terra-money/terra.proto@0.1.7",
"resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-0.1.7.tgz",
"integrity": "sha512-NXD7f6pQCulvo6+mv6MAPzhOkUzRjgYVuHZE/apih+lVnPG5hDBU0rRYnOGGofwvKT5/jQoOENnFn/gioWWnyQ==",
"requires": {
"@terra-money/terra.proto": "^0.1.7",
"axios": "^0.24.0",
"google-protobuf": "^3.17.3",
"long": "^4.0.0",
"protobufjs": "~6.11.2"
}
},
"@terra-money/terra.js": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/@terra-money/terra.js/-/terra.js-3.1.3.tgz",
"integrity": "sha512-80HU5WXrqf3hZTo2GRhIycH17A+SkLD6afbu8MynMDGGD/A861F3zVv6NQ/Z7PWQGHxgddZEK/A0UQ2uK/xfHg==",
"requires": {
"@terra-money/legacy.proto": "npm:@terra-money/terra.proto@^0.1.7",
"@terra-money/terra.proto": "~2.0.0",
"axios": "^0.26.1",
"bech32": "^2.0.0",
"bip32": "^2.0.6",
"bip39": "^3.0.3",
@ -9392,6 +9437,27 @@
"tmp": "^0.2.1",
"utf-8-validate": "^5.0.5",
"ws": "^7.5.5"
},
"dependencies": {
"@terra-money/terra.proto": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@terra-money/terra.proto/-/terra.proto-2.0.0.tgz",
"integrity": "sha512-ZjyFOFUzrGn8IwzGIgr1OJFcPSsQoz/XAfoSKThJx+OjJA7CLhdcz51+5h7ehNfb+qB9wr7aNME0h24wu9D4SQ==",
"requires": {
"@improbable-eng/grpc-web": "^0.14.1",
"google-protobuf": "^3.17.3",
"long": "^4.0.0",
"protobufjs": "~6.11.2"
}
},
"axios": {
"version": "0.26.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz",
"integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==",
"requires": {
"follow-redirects": "^1.14.8"
}
}
}
},
"@terra-money/terra.proto": {
@ -11081,9 +11147,9 @@
"integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
},
"follow-redirects": {
"version": "1.14.5",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz",
"integrity": "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA=="
"version": "1.15.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
"integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA=="
},
"form-data": {
"version": "3.0.1",

View File

@ -30,12 +30,12 @@
"typescript": "^4.3.5"
},
"dependencies": {
"@certusone/p2w-sdk": "file:../p2w-sdk/js",
"@certusone/wormhole-sdk": "^0.1.4",
"@certusone/wormhole-spydk": "^0.0.1",
"@certusone/p2w-sdk": "file:../p2w-sdk/js",
"@solana/spl-token": "^0.1.8",
"@solana/web3.js": "^1.24.0",
"@terra-money/terra.js": "^3.0.4",
"@terra-money/terra.js": "^3.1.3",
"@typechain/ethers-v5": "^7.0.1",
"@types/express": "^4.17.13",
"async-mutex": "^0.3.2",