Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nucleo
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blockchain
nucleo
Commits
01841260
Commit
01841260
authored
6 years ago
by
Robert Martin-Lègene
Browse files
Options
Downloads
Patches
Plain Diff
Renaming Gas Well to Distillery
parent
0d0e988e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/GasAdmin.sh
+0
-87
0 additions, 87 deletions
bin/GasAdmin.sh
bin/MasterDistiller.js
+0
-0
0 additions, 0 deletions
bin/MasterDistiller.js
src/Distillery.sol
+1
-1
1 addition, 1 deletion
src/Distillery.sol
with
1 addition
and
88 deletions
bin/GasAdmin.sh
deleted
100755 → 0
+
0
−
87
View file @
0d0e988e
#!/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 )
This diff is collapsed.
Click to expand it.
bin/
G
as
Admin
.js
→
bin/
M
as
terDistiller
.js
+
0
−
0
View file @
01841260
File moved
This diff is collapsed.
Click to expand it.
src/Distillery.sol
+
1
−
1
View file @
01841260
// vim:filetype=javascript
pragma
solidity
^
0.4
.
24
;
contract
GasWell
{
contract
Distillery
{
address
owner
;
struct
Allowances
{
address
beneficiary
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment