Skip to content

Commit

Permalink
ci: add recipe to migrate contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
kerber0x committed Feb 7, 2024
1 parent 321cd0e commit 23847d3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
6 changes: 5 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,8 @@ deploy CHAIN ARTIFACT='all':

# Stores the contracts to the specified chain.
store CHAIN ARTIFACT='all':
scripts/deployment/deploy_liquidity_hub.sh -c {{CHAIN}} -s {{ARTIFACT}}
scripts/deployment/deploy_liquidity_hub.sh -c {{CHAIN}} -s {{ARTIFACT}}

# Migrates the contracts to the specified chain.
migrate CHAIN ARTIFACT='all':
scripts/deployment/migrate_liquidity_hub.sh -c {{CHAIN}} -m {{ARTIFACT}}
4 changes: 2 additions & 2 deletions scripts/deployment/deploy_env/base_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ local | juno | juno-testnet | terra | terra-testnet | archway-testnet | comdex |
chihuahua | migaloo | migaloo-testnet)
if [ -n "$ZSH_VERSION" ]; then
# Using an array for TXFLAG
TXFLAG=(--node $RPC --chain-id $CHAIN_ID --gas-prices 1$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag)
TXFLAG=(--node $RPC --chain-id $CHAIN_ID --gas-prices 1$DENOM --gas auto --gas-adjustment 1.4 -y -b $b_flag --output $output_flag)
else
# Using a string for TXFLAG
TXFLAG="--node $RPC --chain-id $CHAIN_ID --gas-prices 1$DENOM --gas auto --gas-adjustment 1.2 -y -b $b_flag --output $output_flag"
TXFLAG="--node $RPC --chain-id $CHAIN_ID --gas-prices 1$DENOM --gas auto --gas-adjustment 1.4 -y -b $b_flag --output $output_flag"
fi
;;

Expand Down
16 changes: 15 additions & 1 deletion scripts/deployment/migrate_liquidity_hub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -e

deployment_script_dir=$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)
project_root_path=$(realpath "$0" | sed 's|\(.*\)/.*|\1|' | cd ../ | pwd)
tx_delay=8
tx_delay=14

# Displays tool usage
function display_usage() {
Expand All @@ -20,6 +20,11 @@ function migrate_fee_collector() {
migrate_artifact $project_root_path/artifacts/fee_collector.wasm $migrate_msg
}

function migrate_fee_distributor() {
migrate_msg='{}'
migrate_artifact $project_root_path/artifacts/fee_distributor.wasm $migrate_msg
}

function migrate_pool_factory() {
migrate_msg='{}'
migrate_artifact $project_root_path/artifacts/terraswap_factory.wasm $migrate_msg
Expand Down Expand Up @@ -62,6 +67,11 @@ function migrate_vault_router() {
migrate_artifact $project_root_path/artifacts/vault_router.wasm "$migrate_msg"
}

function migrate_whale_lair() {
migrate_msg='{}'
migrate_artifact $project_root_path/artifacts/whale_lair.wasm "$migrate_msg"
}

function migrate_vaults() {
echo -e "\nMigrating Vaults on $CHAIN_ID..."

Expand All @@ -86,6 +96,7 @@ function migrate_vaults() {

function migrate_pool_network() {
migrate_fee_collector
migrate_fee_distributor
migrate_pool_factory
migrate_pool_router
migrate_pools
Expand Down Expand Up @@ -168,6 +179,9 @@ function migrate() {
vault-router)
migrate_vault_router
;;
whale-lair)
migrate_whale_lair
;;
*) # migrate all
migrate_liquidity_hub
;;
Expand Down

0 comments on commit 23847d3

Please sign in to comment.