From 018412607bd1e3b818de101ea9efc346aecdb774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Martin-L=C3=A8gene?= <robert@bc.pert> Date: Mon, 10 Sep 2018 20:19:05 -0300 Subject: [PATCH] Renaming Gas Well to Distillery --- bin/GasAdmin.sh | 87 ------------------------- bin/{GasAdmin.js => MasterDistiller.js} | 0 src/Distillery.sol | 2 +- 3 files changed, 1 insertion(+), 88 deletions(-) delete mode 100755 bin/GasAdmin.sh rename bin/{GasAdmin.js => MasterDistiller.js} (100%) diff --git a/bin/GasAdmin.sh b/bin/GasAdmin.sh deleted file mode 100755 index bf24c32..0000000 --- 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 0b7ca9d..21feb1d 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; -- GitLab