Skip to content

Commit

Permalink
Fix deploy naming & remove Terra (#126)
Browse files Browse the repository at this point in the history
* update deploy script configs to look for skip_go_... instead of skip_api_... artifacts

* change drop swap adapter name to skip_go_... instead of skip_api_...

* remove terra from deploy script

terra-sdk is now deprecated and not receiving updates, however it
requires a proto version < 4.0.0, while other packages are requiring a
proto verison > 4.0.0

* add back in terra wallet generation but make imports conditional

terra will still fail if you try and deploy it since the modules its
importing are not defined in the requirements file

* update cargo lock

* comment out terra deps instead of remove

* update drop tests to import skip_go instead of skip_api
  • Loading branch information
mattac21 authored Aug 7, 2024
1 parent bdf0d8b commit ed8e626
Show file tree
Hide file tree
Showing 15 changed files with 151 additions and 144 deletions.
189 changes: 98 additions & 91 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion contracts/adapters/swap/drop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "skip-api-swap-adapter-drop"
name = "skip-go-swap-adapter-drop"
version = { workspace = true }
rust-version = { workspace = true }
authors = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions contracts/adapters/swap/drop/tests/test_execute_swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use cosmwasm_std::{
};
// use lido_satellite::msg::ExecuteMsg as LidoSatelliteExecuteMsg;
use skip::swap::ExecuteMsg;
use skip_api_swap_adapter_drop::{
use skip_go_swap_adapter_drop::{
error::{ContractError, ContractResult},
state::{
DROP_CORE_CONTRACT_ADDRESS, ENTRY_POINT_CONTRACT_ADDRESS, FACTORY_BONDED_DENOM,
Expand Down Expand Up @@ -138,7 +138,7 @@ fn test_execute_swap(params: Params) -> ContractResult<()> {
FACTORY_BONDED_DENOM.save(deps.as_mut().storage, &String::from("factory/uatom"))?;

// Call execute_swap with the given test parameters
let res = skip_api_swap_adapter_drop::contract::execute(
let res = skip_go_swap_adapter_drop::contract::execute(
deps.as_mut(),
env,
info,
Expand Down
4 changes: 2 additions & 2 deletions contracts/adapters/swap/drop/tests/test_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use cosmwasm_std::{
};
// use lido_satellite::msg::ExecuteMsg as LidoSatelliteExecuteMsg;
use skip::{asset::Asset, swap::QueryMsg};
use skip_api_swap_adapter_drop::{
use skip_go_swap_adapter_drop::{
error::ContractResult,
state::{DROP_CORE_CONTRACT_ADDRESS, FACTORY_BONDED_DENOM, IBC_REMOTE_DENOM},
};
Expand Down Expand Up @@ -180,7 +180,7 @@ fn test_queries(params: Params) -> ContractResult<()> {
FACTORY_BONDED_DENOM.save(deps.as_mut().storage, &String::from("factory/uatom"))?;

// Call execute_swap with the given test parameters
let res = skip_api_swap_adapter_drop::contract::query(deps.as_ref(), env, params.query.clone())
let res = skip_go_swap_adapter_drop::contract::query(deps.as_ref(), env, params.query.clone())
.unwrap();

assert_eq!(res, params.response);
Expand Down
6 changes: 3 additions & 3 deletions scripts/configs/archway.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ DENOM = "aarch"
GAS_PRICE = 196000000000

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_ibc_hooks-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_ibc_hooks-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
Expand All @@ -30,4 +30,4 @@ ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"
[[swap_venues]]
name = "archway-hallswap"
hallswap_contract_address = "archway1tjg47350zpgskprjmcm6chuytnx3q893mru8fqg8jakkw2cjwt5s2unkar"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_hallswap-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_hallswap-aarch64.wasm"
8 changes: 4 additions & 4 deletions scripts/configs/chihuahua.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ DENOM = "uhuahua"
GAS_PRICE = 1

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_ibc_hooks-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_ibc_hooks-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
Expand All @@ -29,9 +29,9 @@ ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"

[[swap_venues]]
name = "chihuahua-white-whale"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_white_whale-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_white_whale-aarch64.wasm"

[[swap_venues]]
name = "chihuahua-hallswap"
hallswap_contract_address = "chihuahua1w029h820yzthj3kqfvv6dzd6h84ys26uxg6x0zd3zmc93kutqe9qrwgsn7"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_hallswap-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_hallswap-aarch64.wasm"
10 changes: 5 additions & 5 deletions scripts/configs/migaloo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ DENOM = "uwhale"
GAS_PRICE = 1

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_ibc_hooks-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_ibc_hooks-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
Expand All @@ -29,13 +29,13 @@ ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"

[[swap_venues]]
name = "migaloo-white-whale"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_white_whale-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_white_whale-aarch64.wasm"

[[swap_venues]]
name = "migaloo-hallswap"
hallswap_contract_address = "migaloo10l2nactp2af8uw3xupgmmpsng85fngguk5jj0qy57vc3lfllan9sarp6hf"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_hallswap-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_hallswap-aarch64.wasm"

# [[testnet_swap_venues]]
# name = "testnet-migaloo-white-whale"
# swap_adapter_path = "../artifacts/skip_api_swap_adapter_white_whale-aarch64.wasm"
# swap_adapter_path = "../artifacts/skip_go_swap_adapter_white_whale-aarch64.wasm"
14 changes: 7 additions & 7 deletions scripts/configs/neutron.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ DENOM = "untrn"
GAS_PRICE = 0.075

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_neutron_transfer-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_neutron_transfer-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
Expand All @@ -28,23 +28,23 @@ ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"

[[swap_venues]]
name = "neutron-astroport"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_astroport-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_astroport-aarch64.wasm"

[[swap_venues]]
name = "neutron-lido-satellite"
lido_satellite_contract_address = "neutron1ug740qrkquxzrk2hh29qrlx3sktkfml3je7juusc2te7xmvsscns0n2wry"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_lido_satellite-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_lido_satellite-aarch64.wasm"

[[swap_venues]]
name = "neutron-hallswap"
hallswap_contract_address = "neutron12k4hr2ecm3c8mjjsn6dc9c043xv8p7v4795qt9g2dwp4nmmlgxdqvz2ujp"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_hallswap-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_hallswap-aarch64.wasm"

[[testnet_swap_venues]]
name = "testnet-neutron-astroport"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_astroport-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_astroport-aarch64.wasm"

[[testnet_swap_venues]]
name = "testnet-neutron-lido-satellite"
lido_satellite_contract_address = "neutron1xdtwh5jr4zjx8g3zh29jud75c666wua7tsmum3ajm6ylf782etfs60dj2h"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_lido_satellite-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_lido_satellite-aarch64.wasm"
6 changes: 3 additions & 3 deletions scripts/configs/oraichain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ DENOM = "orai"
GAS_PRICE = 0.003

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_ibc_hooks-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_ibc_hooks-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
Expand All @@ -30,4 +30,4 @@ ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"
[[swap_venues]]
name = "orai-hallswap"
hallswap_contract_address = "orai1wl3kn5lx6mf67pqmlefus7ge9wj57e3jyp39mzrhwa4hs00q6e9sp3044z"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_hallswap-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_hallswap-aarch64.wasm"
8 changes: 4 additions & 4 deletions scripts/configs/osmosis.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ DENOM = "uosmo"
GAS_PRICE = 0.01

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_ibc_hooks-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_ibc_hooks-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
Expand All @@ -31,8 +31,8 @@ PERMISSIONED_UPLOADER_ADDRESS = "osmo1raa4kyx5ypz75qqk3566c6slx2mw3qzsu6rymw"

[[swap_venues]]
name = "osmosis-poolmanager"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_osmosis_poolmanager-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_osmosis_poolmanager-aarch64.wasm"

[[testnet_swap_venues]]
name = "testnet-osmosis-poolmanager"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_osmosis_poolmanager-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_osmosis_poolmanager-aarch64.wasm"
8 changes: 4 additions & 4 deletions scripts/configs/persistence.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ DENOM = "uxprt"
GAS_PRICE = 0.025

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_ibc_hooks-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_ibc_hooks-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
Expand All @@ -30,10 +30,10 @@ ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"
name = "persistence-dexter"
dexter_vault_contract_address = "persistence1k8re7jwz6rnnwrktnejdwkwnncte7ek7gt29gvnl3sdrg9mtnqkstujtpg"
dexter_router_contract_address = "persistence132xmxm33vwjlur2pszl4hu9r32lqmqagvunnuc5hq4htps7rr3kqsf4dsk"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_dexter-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_dexter-aarch64.wasm"

[[testnet_swap_venues]]
name = "testnet-persistence-dexter"
dexter_vault_contract_address = "persistence1hrpna9v7vs3stzyd4z3xf00676kf78zpe2u5ksvljswn2vnjp3ys64pna7"
dexter_router_contract_address = "persistence1f6jlx7d9y408tlzue7r2qcf79plp549n30yzqjajjud8vm7m4vds8udaex"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_dexter-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_dexter-aarch64.wasm"
12 changes: 6 additions & 6 deletions scripts/configs/sei.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ DENOM = "usei"
GAS_PRICE = 0.1

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_ibc_hooks-aarch64.wasm"
PLACEHOLDER_CONTRACT_PATH = "../artifacts/skip_api_placeholder-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_ibc_hooks-aarch64.wasm"
PLACEHOLDER_CONTRACT_PATH = "../artifacts/skip_go_placeholder-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
# NOTE: SEI DOES NOT HAVE INSTANTIATE2, SO THIS IS UNUSED
Expand All @@ -33,13 +33,13 @@ NO_INSTANTIATE2 = true

[[swap_venues]]
name = "sei-astroport"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_astroport-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_astroport-aarch64.wasm"

[[swap_venues]]
name = "sei-hallswap"
hallswap_contract_address = "sei1w5t009q9zr8ky8v84sx9n4r9m6ss9ge7xfkuc6xrh479fjg4qmysrqk4lq"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_hallswap-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_hallswap-aarch64.wasm"

[[testnet_swap_venues]]
name = "testnet-sei-astroport"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_astroport-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_astroport-aarch64.wasm"
14 changes: 7 additions & 7 deletions scripts/configs/terra.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ DENOM = "uluna"
GAS_PRICE = 0.015

# Contract Paths
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_api_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_api_ibc_adapter_ibc_hooks-aarch64.wasm"
ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_go_entry_point-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_go_ibc_adapter_ibc_hooks-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
Expand All @@ -29,21 +29,21 @@ ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"

[[swap_venues]]
name = "terra-astroport"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_astroport-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_astroport-aarch64.wasm"

[[swap_venues]]
name = "terra-white-whale"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_white_whale-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_white_whale-aarch64.wasm"

[[swap_venues]]
name = "terra-hallswap"
hallswap_contract_address = "terra1e3nqr8vwu32pzgasraud9avpwdd8phmqgre5kpwlytgedj2emkkq3l67hy"
swap_adapter_path = "../artifacts/skip_api_swap_adapter_hallswap-aarch64.wasm"
swap_adapter_path = "../artifacts/skip_go_swap_adapter_hallswap-aarch64.wasm"

# [[testnet_swap_venues]]
# name = "testnet-terra-astroport"
# swap_adapter_path = "../artifacts/skip_api_swap_adapter_astroport-aarch64.wasm"
# swap_adapter_path = "../artifacts/skip_go_swap_adapter_astroport-aarch64.wasm"

# [[testnet_swap_venues]]
# name = "testnet-terra-white-whale"
# swap_adapter_path = "../artifacts/skip_api_swap_adapter_white_whale-aarch64.wasm"
# swap_adapter_path = "../artifacts/skip_go_swap_adapter_white_whale-aarch64.wasm"
6 changes: 3 additions & 3 deletions scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
)
from cosmpy.common.utils import json_encode
from cosmpy.protos.cosmos.authz.v1beta1.tx_pb2 import MsgExec
from terra_sdk.client.lcd import LCDClient
from terra_sdk.key.mnemonic import MnemonicKey

CHAIN = sys.argv[1]
NETWORK = sys.argv[2]
Expand Down Expand Up @@ -360,6 +358,8 @@ def create_tx(
def create_wallet(client) -> LocalWallet:
""" Create a wallet from a mnemonic and return it"""
if CHAIN == "terra":
from terra_sdk.client.lcd import LCDClient
from terra_sdk.key.mnemonic import MnemonicKey
mk = MnemonicKey(mnemonic=MNEMONIC)
terra = LCDClient(REST_URL, CHAIN_ID)
terra_wallet = terra.wallet(mk)
Expand Down Expand Up @@ -641,4 +641,4 @@ def get_attribute_value(resp, event_type, attr_key):


if __name__ == "__main__":
main()
main()
4 changes: 2 additions & 2 deletions scripts/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ safe-pysha3==1.0.4
six==1.16.0
sniffio==1.3.0
stack-data==0.6.2
terra-proto==4.0.2
terra-sdk==4.0.0
# terra-proto==4.0.2
# terra-sdk==4.0.0
toml==0.10.2
toolz==0.12.0
tornado==6.3.2
Expand Down

0 comments on commit ed8e626

Please sign in to comment.