From 3948d5aa406bad97a8b6378c013da0732cc70975 Mon Sep 17 00:00:00 2001 From: nolash Date: Thu, 14 Oct 2021 17:18:49 +0200 Subject: [PATCH] Add custodial initialization --- apps/contract-migration/2_deploy_contract_instance.sh | 8 +++++--- apps/contract-migration/3_deploy_token.sh | 1 + apps/contract-migration/config/config.ini | 8 +++++++- apps/contract-migration/requirements.txt | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/apps/contract-migration/2_deploy_contract_instance.sh b/apps/contract-migration/2_deploy_contract_instance.sh index 43ea8031..2bef44da 100644 --- a/apps/contract-migration/2_deploy_contract_instance.sh +++ b/apps/contract-migration/2_deploy_contract_instance.sh @@ -19,13 +19,15 @@ if [ ! -z $DEV_ETH_GAS_PRICE ]; then fi - # Deploy contract registry contract >&2 echo -e "\033[;96mDeploy contract registry contract\033[;39m" CIC_REGISTRY_ADDRESS=`okota-contract-registry-deploy $fee_price_arg -i $CHAIN_SPEC -y $WALLET_KEY_FILE --identifier AccountRegistry --identifier TokenRegistry --identifier AddressDeclarator --identifier Faucet --identifier TransferAuthorization --identifier ContractRegistry --identifier DefaultToken --address-declarator $DEV_ADDRESS_DECLARATOR -p $RPC_PROVIDER $DEV_DEBUG_FLAG -s -u -w` + >&2 echo -e "\033[;96mAdd contract registry record to itself\033[;39m" -eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER $DEV_DEBUG_FLAG --identifier ContractRegistry $CIC_REGISTRY_ADDRESS +r=`eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER $DEV_DEBUG_FLAG --identifier ContractRegistry $CIC_REGISTRY_ADDRESS` +add_pending_tx_hash $r + >&2 echo -e "\033[;96mAdd address declarator record to contract registry\033[;39m" r=`eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER $DEV_DEBUG_FLAG --identifier AddressDeclarator $DEV_ADDRESS_DECLARATOR` @@ -36,12 +38,12 @@ add_pending_tx_hash $r >&2 echo -e "\033[;96mDeploy transfer authorization contract\033[;39m" DEV_TRANSFER_AUTHORIZATION_ADDRESS=`erc20-transfer-auth-deploy $gas_price_arg -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -w $DEV_DEBUG_FLAG` + >&2 echo -e "\033[;96mAdd transfer authorization record to contract registry\033[;39m" r=`eth-contract-registry-set $fee_price_arg -s -u -w -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER $DEV_DEBUG_FLAG --identifier TransferAuthorization $DEV_TRANSFER_AUTHORIZATION_ADDRESS` add_pending_tx_hash $r - # Deploy token index contract >&2 echo -e "\033[;96mDeploy token symbol index contract\033[;39m" DEV_TOKEN_INDEX_ADDRESS=`okota-token-index-deploy -s -u $fee_price_arg -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER -w $DEV_DEBUG_FLAG --address-declarator $DEV_ADDRESS_DECLARATOR` diff --git a/apps/contract-migration/3_deploy_token.sh b/apps/contract-migration/3_deploy_token.sh index dc0cc33c..6140072a 100644 --- a/apps/contract-migration/3_deploy_token.sh +++ b/apps/contract-migration/3_deploy_token.sh @@ -85,6 +85,7 @@ function deploy_minter_faucet() { } +TOKEN_TYPE=${TOKEN_TYPE:-giftable_erc20_token} deploy_token_${TOKEN_TYPE} if [ -z "$have_default_token" ]; then diff --git a/apps/contract-migration/config/config.ini b/apps/contract-migration/config/config.ini index 6947c472..3dcec117 100644 --- a/apps/contract-migration/config/config.ini +++ b/apps/contract-migration/config/config.ini @@ -2,11 +2,17 @@ eth_account_contract_deployer = token_mint_amount = 10000000000000000000000000000000000 faucet_amount = 0 -#gas_amount = 100000000000000000000000 +gas_amount = 100000000000000000000000 eth_gas_price = data_dir = address_declarator = declarator_description = 0x546869732069732074686520434943206e6574776f726b000000000000000000 +[chain] +spec = + +[rpc] +provider = + [cic] registry_address = diff --git a/apps/contract-migration/requirements.txt b/apps/contract-migration/requirements.txt index 8f446a6c..a92cf0b4 100644 --- a/apps/contract-migration/requirements.txt +++ b/apps/contract-migration/requirements.txt @@ -1,6 +1,6 @@ cic-eth[tools]==0.12.4a8 -chainlib-eth>=0.0.9rc1,<0.1.0 -chainlib==0.0.9rc1,<0.1.0 +chainlib-eth>=0.0.9rc4,<0.0.10 +chainlib==0.0.9rc1,<0.0.10 eth-erc20>=0.1.2a3,<0.2.0 erc20-demurrage-token>=0.0.5a2,<0.1.0 #eth-accounts-index>=0.1.2a2,<0.2.0