Merge remote-tracking branch 'origin/master' into lash/demurrage-task

This commit is contained in:
nolash 2021-07-07 09:58:57 +02:00
commit 644b9ec4ec
3 changed files with 25 additions and 14 deletions

View File

@ -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 sarafu-faucet~=0.0.4a1
cic-eth~=0.11.1a3 cic-eth==0.12.0a2
eth-erc20~=0.0.10a3
erc20-demurrage-token==0.0.2a3 erc20-demurrage-token==0.0.2a3

View File

@ -2,10 +2,18 @@
set -a set -a
default_token=giftable_erc20_token
CIC_DEFAULT_TOKEN_SYMBOL=${CIC_DEFAULT_TOKEN_SYMBOL:-GFT} CIC_DEFAULT_TOKEN_SYMBOL=${CIC_DEFAULT_TOKEN_SYMBOL:-GFT}
TOKEN_SYMBOL=${CIC_DEFAULT_TOKEN_SYMBOL} 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 cat <<EOF
external token settings: external token settings:
token_type: $TOKEN_TYPE
token_symbol: $TOKEN_SYMBOL token_symbol: $TOKEN_SYMBOL
token_name: $TOKEN_NAME token_name: $TOKEN_NAME
token_decimals: $TOKEN_DECIMALS 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 >&2 echo using static gas price $DEV_ETH_GAS_PRICE
fi 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:" echo "environment:"
printenv printenv
echo \n echo \n
@ -72,15 +75,20 @@ if [[ -n "${ETH_PROVIDER}" ]]; then
./wait-for-it.sh "${ETH_PROVIDER_HOST}:${ETH_PROVIDER_PORT}" ./wait-for-it.sh "${ETH_PROVIDER_HOST}:${ETH_PROVIDER_PORT}"
fi fi
if [ $TOKEN_SYMBOL == 'GFT' ]; then if [ $TOKEN_TYPE == $default_token ]; then
>&2 echo "deploying 'giftable token'" >&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 "Giftable Token" --symbol "GFT" --decimals 6 -vv` 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`
else elif [ $TOKEN_TYPE == 'erc20_demurrage_token' ]; then
>&2 echo "deploying 'redistributed demurrage token'" >&2 echo deploying token $TOKEN_TYPE
if [ -z $TOKEN_SINK_ADDRESS && ! -z $TOKEN_REDISTRIBUTION_PERIOD ]; then if [ -z $TOKEN_SINK_ADDRESS ]; then
>&2 echo -e "\033[;93mtoken sink address not set, so redistribution will be BURNED\033[;39m" if [ ! -z $TOKEN_REDISTRIBUTION_PERIOD ]; then
>&2 echo -e "\033[;93mtoken sink address not set, so redistribution will be BURNED\033[;39m"
fi
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` 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 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 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

View File

@ -73,6 +73,7 @@ services:
contract-migration: contract-migration:
build: build:
dockerfile: contract-migration/docker/Dockerfile dockerfile: contract-migration/docker/Dockerfile
# target: compile-image
args: args:
pip_index_url: ${PIP_DEFAULT_INDEX_URL:-https://pypi.org/simple} pip_index_url: ${PIP_DEFAULT_INDEX_URL:-https://pypi.org/simple}
pip_extra_args: $PIP_EXTRA_ARGS pip_extra_args: $PIP_EXTRA_ARGS
@ -110,6 +111,7 @@ services:
TOKEN_SUPPLY_LIMIT: $TOKEN_SUPPLY_LIMIT TOKEN_SUPPLY_LIMIT: $TOKEN_SUPPLY_LIMIT
TOKEN_DEMURRAGE_LEVEL: ${TOKEN_DEMURRAGE_LEVEL:-196454828847045000000000000000000} TOKEN_DEMURRAGE_LEVEL: ${TOKEN_DEMURRAGE_LEVEL:-196454828847045000000000000000000}
TOKEN_SINK_ADDRESS: $TOKEN_SINK_ADDRESS TOKEN_SINK_ADDRESS: $TOKEN_SINK_ADDRESS
TOKEN_TYPE: ${TOKEN_TYPE:-default}
#CONFINI_DIR: ${CONFINI_DIR:-/tmp/cic/config} #CONFINI_DIR: ${CONFINI_DIR:-/tmp/cic/config}
command: ["./run_job.sh"] command: ["./run_job.sh"]
#command: ["./reset.sh"] #command: ["./reset.sh"]