Add demurrage poker script

This commit is contained in:
nolash 2021-12-21 14:19:26 +00:00
parent c5efa56885
commit 6562d37a30
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -0,0 +1,18 @@
#!/bin/bash
default_token_address=`eth-contract-registry-list --raw -e $CIC_REGISTRY_ADDRESS DefaultToken`
export TOKEN_ADDRESSES=${TOKEN_ADDRESSES:-$default_token_address}
IFS="," read -r -a token_addresses <<< $TOKEN_ADDRESSES
export RPC_VERIFY=1
for token_address in ${token_addresses[@]}; do
>&2 echo checking token address $token_address
t=`eth-encode --signature demurrageTimestamp -e $token_address --notx`
v=`eth-encode --signature demurrageAmount -e $token_address --notx`
>&2 echo last demurrage apply call for $token_address was value $v at $t
if [ "$?" -eq 0 ]; then
h=`eth-encode --signature changePeriod -i $CHAIN_SPEC -y $WALLET_KEY_FILE -e $token_address --fee-limit 8000000 -s -ww`
>&2 echo applied demurrage on $token_address tx hash $h
fi
done