diff --git a/scripts/deploy_scripts/.env.instantiate.example b/scripts/deploy_scripts/.env.instantiate.example index 92fa3152..722e8e43 100644 --- a/scripts/deploy_scripts/.env.instantiate.example +++ b/scripts/deploy_scripts/.env.instantiate.example @@ -20,6 +20,9 @@ TIMEOUT_LOCAL=1209600 # 14 days TIMEOUT_REMOTE=1209600 +PUPPETEER_TYPE="puppeteer" +LSM_SHARE_PROVIDER_ENABLED="true" + INITIAL_VALIDATORS='[{"valoper_address":"cosmosvaloper1...","weight":10},{"valoper_address":"cosmosvaloper1...","weight":10}]' NEUTRON_SIDE_PORT_ID="transfer" @@ -45,7 +48,6 @@ factory_code_id= core_code_id= token_code_id= distribution_code_id= -staker_code_id= validators_set_code_id= puppeteer_code_id= rewards_manager_code_id= @@ -53,4 +55,6 @@ strategy_code_id= withdrawal_manager_code_id= withdrawal_voucher_code_id= pump_code_id= -splitter_code_id= \ No newline at end of file +splitter_code_id= +lsm_share_bond_provider_code_id= +native_bond_provider_code_id= \ No newline at end of file diff --git a/scripts/deploy_scripts/instantiate.bash b/scripts/deploy_scripts/instantiate.bash index 6b52b02c..93711cfe 100755 --- a/scripts/deploy_scripts/instantiate.bash +++ b/scripts/deploy_scripts/instantiate.bash @@ -9,6 +9,9 @@ KEYRING_BACKEND="${KEYRING_BACKEND:-test}" DEPLOY_WALLET="${DEPLOY_WALLET:-demowallet1}" MIN_NTRN_REQUIRED="${MIN_NTRN_REQUIRED:-10}" +PUPPETEER_TYPE="${PUPPETEER_TYPE:-puppeteer}" +LSM_SHARE_PROVIDER_ENABLED="${LSM_SHARE_PROVIDER_ENABLED:-true}" + TARGET_SDK_VERSION="${TARGET_SDK_VERSION:?Variable should be explicitly specified}" TARGET_BASE_DENOM="${TARGET_BASE_DENOM:?Variable should be explicitly specified}" NEUTRON_SIDE_TRANSFER_CHANNEL_ID="${NEUTRON_SIDE_TRANSFER_CHANNEL_ID:?Variable should be explicitly specified}" @@ -84,25 +87,26 @@ main() { factory_admin_execute "$factory_address" "$msg" 250000untrn echo "[OK] Add Native bond provider to the Core contract" - update_msg='{ - "add_bond_provider":{ - "bond_provider_address": "'"$lsm_share_bond_provider_address"'" - } - }' - - msg='{ - "wasm":{ - "execute":{ - "contract_addr":"'"$core_address"'", - "msg":"'"$(echo -n "$update_msg" | jq -c '.' | base64 | tr -d "\n")"'", - "funds": [] + if [ "$LSM_SHARE_PROVIDER_ENABLED" == "true" ]; then + update_msg='{ + "add_bond_provider":{ + "bond_provider_address": "'"$lsm_share_bond_provider_address"'" } - } - }' - - factory_admin_execute "$factory_address" "$msg" 250000untrn - echo "[OK] Add LSM share bond provider to the Core contract" + }' + + msg='{ + "wasm":{ + "execute":{ + "contract_addr":"'"$core_address"'", + "msg":"'"$(echo -n "$update_msg" | jq -c '.' | base64 | tr -d "\n")"'", + "funds": [] + } + } + }' + factory_admin_execute "$factory_address" "$msg" 250000untrn + echo "[OK] Add LSM share bond provider to the Core contract" + fi REWARDS_ADDRESS=${REWARDS_ADDRESS:-$rewards_pump_ica_address} update_msg='{ @@ -167,6 +171,7 @@ main() { echo "[chains.packet_filter]" echo "list = [" echo " ['$puppeteer_ica_port', '$puppeteer_ica_channel']," + echo " ['$rewards_pump_ica_port', '$rewards_pump_ica_channel']," echo " ['$pump_ica_port', '$pump_ica_channel']," echo "]" echo @@ -175,6 +180,7 @@ main() { echo "[chains.packet_filter]" echo "list = [" echo " ['icahost', '$puppeteer_counterparty_channel_id']," + echo " ['icahost', '$rewards_pump_counterparty_channel_id']," echo " ['icahost', '$pump_counterparty_channel_id']," echo "]" diff --git a/scripts/deploy_scripts/upload_contracts.bash b/scripts/deploy_scripts/upload_contracts.bash index 55c4ee1f..436ec401 100755 --- a/scripts/deploy_scripts/upload_contracts.bash +++ b/scripts/deploy_scripts/upload_contracts.bash @@ -9,6 +9,8 @@ DEPLOY_WALLET="${DEPLOY_WALLET:-demowallet1}" MIN_NTRN_REQUIRED="${MIN_NTRN_REQUIRED:-10}" ARTIFACTS_DIR="${ARTIFACTS_DIR:-../../artifacts}" +PUPPETEER_TYPE="${PUPPETEER_TYPE:-puppeteer}" + source ./utils.bash echo "DEPLOY_WALLET: $DEPLOY_WALLET" @@ -22,6 +24,7 @@ main() { pre_deploy_check_balance deploy_wasm_code + deploy_puppeteer_code echo echo "CONTRACTS UPLOAD SUCCEDED" diff --git a/scripts/deploy_scripts/utils.bash b/scripts/deploy_scripts/utils.bash index d92a4d19..74b65815 100644 --- a/scripts/deploy_scripts/utils.bash +++ b/scripts/deploy_scripts/utils.bash @@ -87,13 +87,20 @@ top_up_address() { } deploy_wasm_code() { - for contract in factory core distribution puppeteer rewards_manager strategy token validators_set withdrawal_manager withdrawal_voucher pump splitter lsm_share_bond_provider native_bond_provider; do + for contract in factory core distribution rewards_manager strategy token validators_set withdrawal_manager withdrawal_voucher pump splitter lsm_share_bond_provider native_bond_provider; do store_code "$contract" code_id="${contract}_code_id" printf '[OK] %-24s code ID: %s\n' "$contract" "${!code_id}" done } +deploy_puppeteer_code() { + store_code "$PUPPETEER_TYPE" + code_id="${PUPPETEER_TYPE}_code_id" + puppeteer_code_id="${!code_id}" + printf '[OK] puppeteer code ID: %s\n' "${puppeteer_code_id}" +} + pre_deploy_check_balance() { deploy_wallet="$(neutrond keys show "$DEPLOY_WALLET" \ --home "$NEUTRON_HOME" \