refactor: Improve cic-cache
This commit is contained in:
@@ -41,17 +41,17 @@ add_pending_tx_hash $r
|
||||
|
||||
|
||||
# Deploy transfer authorization contact
|
||||
advance_nonce
|
||||
debug_rpc
|
||||
>&2 echo -e "\033[;96mDeploy transfer authorization contract\033[;39m"
|
||||
DEV_TRANSFER_AUTHORIZATION_ADDRESS=`erc20-transfer-auth-deploy --nonce $nonce -w $gas_price_arg -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER $DEV_DEBUG_FLAG`
|
||||
|
||||
|
||||
>&2 echo -e "\033[;96mAdd transfer authorization record to contract registry\033[;39m"
|
||||
advance_nonce
|
||||
debug_rpc
|
||||
r=`eth-contract-registry-set $DEV_WAIT_FLAG $fee_price_arg --nonce $nonce -s -u -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
|
||||
#advance_nonce
|
||||
#debug_rpc
|
||||
#>&2 echo -e "\033[;96mDeploy transfer authorization contract\033[;39m"
|
||||
#DEV_TRANSFER_AUTHORIZATION_ADDRESS=`erc20-transfer-auth-deploy --nonce $nonce -w $gas_price_arg -y $WALLET_KEY_FILE -i $CHAIN_SPEC -p $RPC_PROVIDER $DEV_DEBUG_FLAG`
|
||||
#
|
||||
#
|
||||
#>&2 echo -e "\033[;96mAdd transfer authorization record to contract registry\033[;39m"
|
||||
#advance_nonce
|
||||
#debug_rpc
|
||||
#r=`eth-contract-registry-set $DEV_WAIT_FLAG $fee_price_arg --nonce $nonce -s -u -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
|
||||
@@ -66,6 +66,13 @@ debug_rpc
|
||||
r=`eth-contract-registry-set $DEV_WAIT_FLAG $fee_price_arg --nonce $nonce -s -u -y $WALLET_KEY_FILE -e $CIC_REGISTRY_ADDRESS -i $CHAIN_SPEC -p $RPC_PROVIDER $DEV_DEBUG_FLAG --identifier TokenRegistry $DEV_TOKEN_INDEX_ADDRESS`
|
||||
add_pending_tx_hash $r
|
||||
|
||||
# Assign writer for token index
|
||||
>&2 echo -e "\033[;96mEnable token index writer $DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER to write to accounts index contract at $DEV_TOKEN_INDEX_ADDRESS\033[;39m"
|
||||
advance_nonce
|
||||
debug_rpc
|
||||
r=`eth-accounts-index-writer -s -u -i $CHAIN_SPEC -p $RPC_PROVIDER --nonce $nonce --fee-limit 1000000 -e $DEV_TOKEN_INDEX_ADDRESS $DEV_DEBUG_FLAG $DEV_ETH_ACCOUNT_CONTRACT_DEPLOYER`
|
||||
add_pending_tx_hash $r
|
||||
|
||||
check_wait 2
|
||||
|
||||
echo -e "\033[;96mWriting env_reset file\033[;39m"
|
||||
|
||||
@@ -61,7 +61,7 @@ function deploy_token_erc20_demurrage_token() {
|
||||
_deploy_token_defaults "DET" "Demurrage Token"
|
||||
advance_nonce
|
||||
debug_rpc
|
||||
TOKEN_ADDRESS=`erc20-demurrage-token-deploy --nonce $nonce $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CHAIN_SPEC --name "$TOKEN_NAME" --symbol $TOKEN_SYMBOL $DEV_DEBUG_FLAG -ww -s`
|
||||
TOKEN_ADDRESS=`erc20-demurrage-token-deploy --nonce $nonce $fee_price_arg -p $RPC_PROVIDER -y $WALLET_KEY_FILE -i $CHAIN_SPEC --name "$TOKEN_NAME" --symbol $TOKEN_SYMBOL --decimals $TOKEN_DECIMALS $DEV_DEBUG_FLAG -ww -s`
|
||||
}
|
||||
|
||||
function deploy_accounts_index() {
|
||||
|
||||
@@ -26,16 +26,7 @@ ARG pip_trusted_host=pypi.org
|
||||
RUN pip install --index-url $PIP_INDEX_URL \
|
||||
--pre \
|
||||
--extra-index-url $EXTRA_PIP_INDEX_URL $EXTRA_PIP_ARGS \
|
||||
-r requirements.txt
|
||||
|
||||
COPY override_requirements.txt .
|
||||
|
||||
RUN pip install --index-url $PIP_INDEX_URL \
|
||||
--pre \
|
||||
--extra-index-url $EXTRA_PIP_INDEX_URL $EXTRA_PIP_ARGS \
|
||||
--force-reinstall \
|
||||
--no-cache \
|
||||
-r override_requirements.txt
|
||||
-r requirements.txt
|
||||
|
||||
RUN pip freeze
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
chainlib-eth==0.0.10a15
|
||||
@@ -1,13 +1,12 @@
|
||||
cic-eth[tools]==0.12.5a2
|
||||
chainlib-eth>=0.0.10a17,<0.1.0
|
||||
eth-erc20>=0.1.2a3,<0.2.0
|
||||
erc20-demurrage-token>=0.0.5a2,<0.1.0
|
||||
eth-address-index>=0.2.4a1,<0.3.0
|
||||
cic-eth-registry>=0.6.1a6,<0.7.0
|
||||
erc20-transfer-authorization>=0.3.5a2,<0.4.0
|
||||
erc20-faucet>=0.3.2a2,<0.4.0
|
||||
sarafu-faucet>=0.0.7a2,<0.1.0
|
||||
confini>=0.4.2rc3,<1.0.0
|
||||
eth-token-index>=0.2.4a1,<=0.3.0
|
||||
okota>=0.2.4a15,<0.3.0
|
||||
cic-types~=0.2.1a2
|
||||
cic-eth[tools]==0.12.7
|
||||
cic-types~=0.2.1a8
|
||||
chainlib-eth~=0.0.15
|
||||
eth-erc20~=0.1.5
|
||||
erc20-demurrage-token~=0.0.7
|
||||
eth-address-index~=0.2.4
|
||||
cic-eth-registry~=0.6.5
|
||||
erc20-faucet==0.3.2
|
||||
sarafu-faucet==0.0.7
|
||||
confini~=0.5.3
|
||||
eth-token-index==0.2.4
|
||||
okota==0.2.5a1
|
||||
|
||||
@@ -18,6 +18,7 @@ from eth_address_declarator.declarator import AddressDeclarator
|
||||
from funga.eth.signer import EIP155Signer
|
||||
from funga.eth.keystore.dict import DictKeystore
|
||||
from hexathon import add_0x, strip_0x
|
||||
from okota.token_index.index import to_identifier
|
||||
|
||||
# local imports
|
||||
|
||||
@@ -109,6 +110,7 @@ if __name__ == '__main__':
|
||||
identifier = bytes.fromhex(hashed_token_proof)
|
||||
token_immutable_proof_writer = MetadataRequestsHandler(cic_type=MetadataPointer.NONE, identifier=identifier)
|
||||
write_metadata(token_immutable_proof_writer, token_proof_data)
|
||||
logg.debug(f'Writing hashed proof: {hashed_token_proof}')
|
||||
write_to_declarator(contract_address=args.address_declarator,
|
||||
contract_wrapper=contract_wrapper,
|
||||
proof=hashed_token_proof,
|
||||
@@ -116,12 +118,11 @@ if __name__ == '__main__':
|
||||
signer_address=args.signer_address,
|
||||
token_address=args.e)
|
||||
|
||||
hashed_token_proof = hash_proof(args.token_symbol.encode('utf-8'))
|
||||
identifier = bytes.fromhex(hashed_token_proof)
|
||||
token_immutable_proof_writer = MetadataRequestsHandler(cic_type=MetadataPointer.NONE, identifier=identifier)
|
||||
hashed_token_proof = to_identifier(args.token_symbol)
|
||||
logg.debug(f'Writing hashed proof: {hashed_token_proof}')
|
||||
write_to_declarator(contract_address=args.address_declarator,
|
||||
contract_wrapper=contract_wrapper,
|
||||
proof=identifier,
|
||||
proof=hashed_token_proof,
|
||||
rpc=rpc,
|
||||
signer_address=args.signer_address,
|
||||
token_address=args.e)
|
||||
|
||||
Reference in New Issue
Block a user