diff --git a/bin/GasAdmin.sh b/bin/GasAdmin.sh deleted file mode 100755 index bf24c32a84cd632aae916f4dacb4a210103e63a5..0000000000000000000000000000000000000000 --- a/bin/GasAdmin.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -if [ -z "${BFAHOME}" ]; then echo "\$BFAHOME not set. Did you source bfa/bin/env ?" >&2; exit 1; fi -source ${BFAHOME}/bin/libbfa.sh || exit 1 - -# get number of accounts -# get limit of every account -# allow scroll up/down to select an account -# press enter to edit an account's limit -# press ins to add an account -# press del to delete an account (set limit = 0) -# press Q to quit. - -js=$( mktemp ) -out=$( mktemp ) -cleanup $js $out -yes | head -1000 - -function admin -{ - while : - do - ( - echo var contract = $( contract GasWell ) - echo "var pos = contract.numberOfBeneficiaries.call();" - echo "while (pos-- > 0) { var r=contract.atPosition(pos); console.log(r[0]+':'+r[1]);}" - ) > $js -cat $js - geth_attach < $js > $out -cat $out - readarray -t < $out - # Delete last entry, because that's the "return value from our call to geth". - unset MAPFILE[$(( ${#MAPFILE[*]} - 1 ))] - if [ ${#MAPFILE[*]} -gt 0 ] - then - printf "%5s %-42s %10s\n" Index "Account address" Value - echo '' - for key in ${!MAPFILE[*]} - do - val=${MAPFILE[$key]} - printf "%5d %-42s %10s\n" $key ${val%:*} ${val#*:} - done - echo - echo '["+"=New entry, Q=quit, index number]' - read -p "Change which one of these: " - else - echo "No accounts found." - REPLY="+" - fi - if [ "${REPLY^^}" = "Q" -o -z "${REPLY}" ] - then - return - elif [ "${REPLY}" = "+" ] - then - read -p "Enter new account address: " acct - if [ ${#acct} -eq 40 -a "${acct:0:2}" != "0x" ] - then - acct="0x${acct}" - fi - amount=0 - elif [ "${REPLY}" != '+' ]; REPLY=$( echo ${REPLY} | sed 's/[^0-9]//' ); [ -n "${REPLY}" ] - then - if [ ${#MAPFILE[*]} -gt "${REPLY}" ] - then - amount=${MAPFILE[${REPLY}]} - acct=${amount%:*} - amount=${amount#*:} - fi - else - return - fi - echo '["DEL"=delete]' - read -i "${amount}" -p "Set value for account ${acct}: " amount - if [ "${amount^^:0:3}" = "DEL" ] - then - amount=0 - fi - contractSendTx GasWell setEtherAllowance \"$acct\" ${amount} | geth_attach - done -} - -admin - -#void setEtherAllowance( address, uint256 ) -#uint256 numberOfBeneficiaries( ) -#void distribute( ) -#uint256 getEtherAllowance( address ) diff --git a/bin/GasAdmin.js b/bin/MasterDistiller.js similarity index 100% rename from bin/GasAdmin.js rename to bin/MasterDistiller.js diff --git a/src/Distillery.sol b/src/Distillery.sol index 0b7ca9d984162e9cc3d551761994fec12c972266..21feb1da24fd32bd89fb9f69bc367ce97422f0bb 100644 --- a/src/Distillery.sol +++ b/src/Distillery.sol @@ -1,7 +1,7 @@ // vim:filetype=javascript pragma solidity ^0.4.24; -contract GasWell { +contract Distillery { address owner; struct Allowances { address beneficiary;