Add explicit token type toggle in contract migration
This commit is contained in:
parent
c559bb2fee
commit
ed029a936c
@ -1,3 +1,3 @@
|
||||
#eth-contract-registry==0.5.5a3
|
||||
#erc20-demurrage-token==0.0.1b4
|
||||
#erc20-demurrage-token==0.0.2a3
|
||||
#eth-address-index==0.1.1a12
|
||||
|
@ -1,4 +1,5 @@
|
||||
cic_base[full]==0.1.3a3+build.984b5cff
|
||||
cic_base[full]==0.1.3a4+build.ce68c833
|
||||
sarafu-faucet~=0.0.4a1
|
||||
cic-eth~=0.11.1a2
|
||||
erc20-demurrage-token==0.0.2a1
|
||||
cic-eth==0.11.1a3+build.a3c49324
|
||||
eth-erc20~=0.0.10a3
|
||||
erc20-demurrage-token==0.0.2a3
|
||||
|
@ -2,10 +2,18 @@
|
||||
|
||||
set -a
|
||||
|
||||
default_token=giftable_erc20_token
|
||||
CIC_DEFAULT_TOKEN_SYMBOL=${CIC_DEFAULT_TOKEN_SYMBOL:-GFT}
|
||||
TOKEN_SYMBOL=${CIC_DEFAULT_TOKEN_SYMBOL}
|
||||
TOKEN_NAME=${TOKEN_NAME:-$TOKEN_SYMBOL}
|
||||
TOKEN_TYPE=${TOKEN_TYPE:-$default_token}
|
||||
if [ $TOKEN_TYPE == 'default' ]; then
|
||||
>&2 echo resolving "default" token to $default_token
|
||||
TOKEN_TYPE=$default_token
|
||||
fi
|
||||
cat <<EOF
|
||||
external token settings:
|
||||
token_type: $TOKEN_TYPE
|
||||
token_symbol: $TOKEN_SYMBOL
|
||||
token_name: $TOKEN_NAME
|
||||
token_decimals: $TOKEN_DECIMALS
|
||||
@ -31,11 +39,6 @@ if [ ! -z $DEV_ETH_GAS_PRICE ]; then
|
||||
>&2 echo using static gas price $DEV_ETH_GAS_PRICE
|
||||
fi
|
||||
|
||||
if [[ $TOKEN_SYMBOL != 'GFT' && $TOKEN_SYMBOL != 'SRF' ]]; then
|
||||
>&2 echo TOKEN_SYMBOL must be one of [GFT,SRF], but was $TOKEN_SYMBOL
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "environment:"
|
||||
printenv
|
||||
echo \n
|
||||
@ -72,15 +75,20 @@ if [[ -n "${ETH_PROVIDER}" ]]; then
|
||||
./wait-for-it.sh "${ETH_PROVIDER_HOST}:${ETH_PROVIDER_PORT}"
|
||||
fi
|
||||
|
||||
if [ $TOKEN_SYMBOL == '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 -ww --name "Giftable Token" --symbol "GFT" --decimals 6 -vv`
|
||||
else
|
||||
>&2 echo "deploying 'redistributed demurrage token'"
|
||||
if [ -z $TOKEN_SINK_ADDRESS && ! -z $TOKEN_REDISTRIBUTION_PERIOD ]; then
|
||||
>&2 echo -e "\033[;93mtoken sink address not set, so redistribution will be BURNED\033[;39m"
|
||||
if [ $TOKEN_TYPE == $default_token ]; then
|
||||
>&2 echo deploying default token $TOKEN_TYPE
|
||||
DEV_RESERVE_ADDRESS=`giftable-token-deploy $gas_price_arg -p $ETH_PROVIDER -y $DEV_ETH_KEYSTORE_FILE -i $CIC_CHAIN_SPEC -vv -ww --name $TOKEN_NAME --symbol $TOKEN_SYMBOL --decimals 6 -vv`
|
||||
elif [ $TOKEN_TYPE == 'erc20_demurrage_token' ]; then
|
||||
>&2 echo deploying token $TOKEN_TYPE
|
||||
if [ -z $TOKEN_SINK_ADDRESS ]; then
|
||||
if [ ! -z $TOKEN_REDISTRIBUTION_PERIOD ]; then
|
||||
>&2 echo -e "\033[;93mtoken sink address not set, so redistribution will be BURNED\033[;39m"
|
||||
fi
|
||||
fi
|
||||
DEV_RESERVE_ADDRESS=`erc20-demurrage-token-deploy $gas_price_arg -p $ETH_PROVIDER -y $DEV_ETH_KEYSTORE_FILE -i $CIC_CHAIN_SPEC -vv -ww`
|
||||
else
|
||||
>&2 echo unknown token type $TOKEN_TYPE
|
||||
exit 1
|
||||
fi
|
||||
giftable-token-gift $gas_price_arg -p $ETH_PROVIDER -y $DEV_ETH_KEYSTORE_FILE -i $CIC_CHAIN_SPEC -vv -w -a $DEV_RESERVE_ADDRESS $DEV_RESERVE_AMOUNT
|
||||
|
||||
|
@ -73,6 +73,7 @@ services:
|
||||
contract-migration:
|
||||
build:
|
||||
dockerfile: contract-migration/docker/Dockerfile
|
||||
# target: compile-image
|
||||
args:
|
||||
pip_index_url: ${PIP_DEFAULT_INDEX_URL:-https://pypi.org/simple}
|
||||
pip_extra_args: $PIP_EXTRA_ARGS
|
||||
@ -110,6 +111,7 @@ services:
|
||||
TOKEN_SUPPLY_LIMIT: $TOKEN_SUPPLY_LIMIT
|
||||
TOKEN_DEMURRAGE_LEVEL: ${TOKEN_DEMURRAGE_LEVEL:-196454828847045000000000000000000}
|
||||
TOKEN_SINK_ADDRESS: $TOKEN_SINK_ADDRESS
|
||||
TOKEN_TYPE: ${TOKEN_TYPE:-default}
|
||||
#CONFINI_DIR: ${CONFINI_DIR:-/tmp/cic/config}
|
||||
command: ["./run_job.sh"]
|
||||
#command: ["./reset.sh"]
|
||||
|
Loading…
Reference in New Issue
Block a user