From 35e00b1dab7a4862c6350d90ccfabe33bf5e70ee Mon Sep 17 00:00:00 2001 From: nolash Date: Thu, 22 Apr 2021 11:55:41 +0200 Subject: [PATCH] Simplify token type selector in contract migration scripts --- apps/contract-migration/reset.sh | 9 ++++----- apps/contract-migration/seed_cic_eth.sh | 4 ++-- docker-compose.yml | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/contract-migration/reset.sh b/apps/contract-migration/reset.sh index bbdeaa3b..57011010 100755 --- a/apps/contract-migration/reset.sh +++ b/apps/contract-migration/reset.sh @@ -3,7 +3,7 @@ set -a CIC_CHAIN_SPEC=${CIC_CHAIN_SPEC:-evm:bloxberg:8995} -DEV_TOKEN_TYPE=${DEV_TOKEN_TYPE:-giftable} +DEV_TOKEN_TYPE=${DEV_TOKEN_TYPE:-GFT} DEV_ETH_ACCOUNT_RESERVE_MINTER=${DEV_ETH_ACCOUNT_RESERVE_MINTER:-$DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER} DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER=${DEV_ETH_ACCOUNT_RESERVE_MINTER:-$DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER} DEV_RESERVE_AMOUNT=${DEV_ETH_RESERVE_AMOUNT:-""10000000000000000000000000000000000} @@ -19,9 +19,8 @@ if [ ! -z $DEV_ETH_GAS_PRICE ]; then >&2 echo using static gas price $DEV_ETH_GAS_PRICE fi -if [[ $DEV_TOKEN_TYPE != 'giftable' && $DEV_TOKEN_TYPE != 'sarafu' ]]; then - echo $DEV_TOKEN_TYPE - >&2 echo DEV_TOKEN_TYPE must be one of [giftable,sarafu] +if [[ $DEV_TOKEN_TYPE != 'GFT' && $DEV_TOKEN_TYPE != 'SRF' ]]; then + >&2 echo DEV_TOKEN_TYPE must be one of [GFT,SRF], but was $DEV_TOKEN_TYPE exit 1 fi @@ -61,7 +60,7 @@ if [[ -n "${ETH_PROVIDER}" ]]; then ./wait-for-it.sh "${ETH_PROVIDER_HOST}:${ETH_PROVIDER_PORT}" fi - if [ $DEV_TOKEN_TYPE == 'giftable' ]; then + if [ $DEV_TOKEN_TYPE == 'GFT' ]; then >&2 echo "deploying 'giftable token'" DEV_RESERVE_ADDRESS=`giftable-token-deploy $gas_price_arg -p $ETH_PROVIDER -y $DEV_ETH_KEYSTORE_FILE -i $CIC_CHAIN_SPEC -vv -w --name "Giftable Token" --symbol "GFT" --decimals 6 -vv` else diff --git a/apps/contract-migration/seed_cic_eth.sh b/apps/contract-migration/seed_cic_eth.sh index 84d1258c..5df672ad 100755 --- a/apps/contract-migration/seed_cic_eth.sh +++ b/apps/contract-migration/seed_cic_eth.sh @@ -33,11 +33,11 @@ set -a # get required addresses from registries DEV_TOKEN_INDEX_ADDRESS=`eth-contract-registry-list -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -r $CIC_REGISTRY_ADDRESS -f brief TokenRegistry` DEV_ACCOUNT_INDEX_ADDRESS=`eth-contract-registry-list -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -r $CIC_REGISTRY_ADDRESS -f brief AccountRegistry` -DEV_RESERVE_ADDRESS=`eth-token-index-list -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -a $DEV_TOKEN_INDEX_ADDRESS -f brief SRF` +DEV_RESERVE_ADDRESS=`eth-token-index-list -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -a $DEV_TOKEN_INDEX_ADDRESS -f brief $DEV_TOKEN_TYPE` cat <&2 echo "create account for gas gifter" diff --git a/docker-compose.yml b/docker-compose.yml index 69a9c318..71681073 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -104,7 +104,7 @@ services: DEV_PIP_EXTRA_INDEX_URL: ${DEV_PIP_EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net:8433} RUN_MASK: ${RUN_MASK:-0} # bit flags; 1: contract migrations 2: seed data DEV_FAUCET_AMOUNT: ${DEV_FAUCET_AMOUNT:-0} - DEV_TOKEN_TYPE: ${DEV_TOKEN_TYPE:-giftable} + DEV_TOKEN_TYPE: ${DEV_TOKEN_TYPE:-GFT} DEV_SARAFU_DEMURRAGE_LEVEL: ${DEV_SARAFU_DEMURRAGE_LEVEL:-196454828847045000000000000000000} DEV_ETH_GAS_PRICE: ${DEV_ETH_GAS_PRICE:-1} command: ["./run_job.sh"]