Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • blockchain/nucleo
  • miguel/nucleo
  • Rcradiologia/nucleo
  • nelson/nucleo
4 results
Show changes
Showing
with 26543 additions and 251 deletions
[{"constant":false,"inputs":[{"name":"beneficiary","type":"address"},{"name":"topuplimit","type":"uint256"}],"name":"setEtherAllowance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"numberOfBeneficiaries","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"mayDistribute","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"idx","type":"uint256"}],"name":"atPosition","outputs":[{"name":"","type":"address"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"selfDestruct","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"distribute","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"beneficiary","type":"address"}],"name":"getEtherAllowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":true,"stateMutability":"payable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"activator","type":"address"}],"name":"distributeStartedBy","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"subject","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"setAllowance","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"subject","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"xfrAllowance","type":"event"}]
0xc3cf96af51d3c41dfbe428de75a8e5597d4d7a7b
\ No newline at end of file
0x58464f818e800bbd9e265d2b098f8a882420f508
\ No newline at end of file
0xecb6aff6e38dc58c4d9aae2f7927a282bcb77ac2
\ No newline at end of file
[Eth]
NetworkId = 47525974938
SyncMode = "fast"
NoPruning = false
DatabaseCache = 2048
[Node]
DataDir = "/home/bfa/bfa/network/node"
HTTPHost = "0.0.0.0"
HTTPCors = ["*"]
IPCPath = "geth.ipc"
HTTPPort = 8545
HTTPVirtualHosts = ["*"]
HTTPModules = ["net", "web3", "eth", "clique"]
WSHost = "0.0.0.0"
WSPort = 8546
WSModules = ["net", "web3", "eth", "clique"]
[Node.P2P]
BootstrapNodes = ["enode://7ec4dd9d5e1a2b29d6b60aa9f95677c0c3a5f9306e73d65dd3bcbfda3737a8c509b02d1eab763ce39f18cfe96423df7ee544d6c36191ec17f59ade75bc99d358@[2800:110:44:6300::aad2:2db3]:30301", "enode://7ec4dd9d5e1a2b29d6b60aa9f95677c0c3a5f9306e73d65dd3bcbfda3737a8c509b02d1eab763ce39f18cfe96423df7ee544d6c36191ec17f59ade75bc99d358@170.210.45.179:30301", "enode://82b66b13d7addcf9ffe1e4e972a105f6ccf50557161c4a0978a5d9ce595ababde609ea8a49897ae89b1d41e90551cb2e9241363238593e950ca68bd5af7c24d6@200.16.28.28:30301", "enode://59ae768ecdee632e0daceccb6f71b215392eba89230d626573f2fb4e9c0786c9a661027ab7343820ca63d96fe48ffd81ed1bf6e4d512f0ba50ec072c9efd9e4e@200.108.146.100:30301"]
BootstrapNodesV5 = ["enode://7ec4dd9d5e1a2b29d6b60aa9f95677c0c3a5f9306e73d65dd3bcbfda3737a8c509b02d1eab763ce39f18cfe96423df7ee544d6c36191ec17f59ade75bc99d358@[2800:110:44:6300::aad2:2db3]:30301", "enode://7ec4dd9d5e1a2b29d6b60aa9f95677c0c3a5f9306e73d65dd3bcbfda3737a8c509b02d1eab763ce39f18cfe96423df7ee544d6c36191ec17f59ade75bc99d358@170.210.45.179:30301", "enode://82b66b13d7addcf9ffe1e4e972a105f6ccf50557161c4a0978a5d9ce595ababde609ea8a49897ae89b1d41e90551cb2e9241363238593e950ca68bd5af7c24d6@200.16.28.28:30301", "enode://59ae768ecdee632e0daceccb6f71b215392eba89230d626573f2fb4e9c0786c9a661027ab7343820ca63d96fe48ffd81ed1bf6e4d512f0ba50ec072c9efd9e4e@200.108.146.100:30301"]
File moved
File moved
This diff is collapsed.
{
"name": "bfa",
"version": "1.0.0",
"description": "Blockchain Federal Argentina",
"dependencies": {
"big-integer": "^1.6.44",
"bignumber.js": "^9.0.0",
"request": "^2.88.0",
"require": "^2.4.20",
"web3": "^1.2.11",
"web3-eth-accounts": "^1.2.11",
"xmlhttprequest-ssl": "^1.5.5"
},
"repository": {
"type": "git",
"url": "https://gitlab.bfa.ar/blockchain/nucleo.git"
},
"author": "Robert Martin-Legene",
"license": "GPL-2.0-only"
}
// vim:filetype=javascript
pragma solidity ^0.4.24;
pragma solidity ^0.5;
contract Distillery {
address owner;
address payable owner;
struct Allowances {
address beneficiary;
address payable beneficiary;
uint topuplimit;
}
Allowances[] thelist;
......@@ -42,7 +42,7 @@ contract Distillery {
// Or returns 0 if the address is not found in thelist.
// 0 : not found
// 1 : first position
function _beneficiaryPosition( address beneficiary ) internal view returns ( uint ) {
function _beneficiaryPosition( address payable beneficiary ) internal view returns ( uint ) {
uint pos = thelist.length;
while ( pos-- > 0 )
if ( beneficiary == thelist[pos].beneficiary )
......@@ -52,7 +52,7 @@ contract Distillery {
// This function returns the "allowance" that a given address is set to.
// Using this function, you don't have to cycle through atPosition() until
// you find the address you want to know about.
function getEtherAllowance( address beneficiary ) public view returns (uint256) {
function getEtherAllowance( address payable beneficiary ) public view returns (uint256) {
uint pos = _beneficiaryPosition( beneficiary );
if ( pos == 0 )
return 0;
......@@ -60,7 +60,7 @@ contract Distillery {
}
// This admin (ownerOnly) function allows the creator of the contract to
// add/change/delete "allowances" per address.
function setEtherAllowance( address beneficiary, uint256 topuplimit ) public onlyOwner {
function setEtherAllowance( address payable beneficiary, uint256 topuplimit ) public onlyOwner {
uint pos = _beneficiaryPosition( beneficiary );
// Not found and trying to delete beneficiary? Just return immediately.
if ( pos == 0 && topuplimit == 0 )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# Majority
This contract maintains a list of accounts authorized
to control members of "the club" using a majority (n/1+1).
We call that group the "council".
For instance, could be useful for
* a list of sealers
* a board of directors
* a local chess club
* even outsourcing this kind of management from another smart contract.
There are a few functions that can be used to see the contents of the
data structures used. Usually, you probably only need to **vote()** and
to ask if some account **isCouncil()**
See the test suite for examples of how to extract information from the
different datastructures, if you feel you really need that.
## Events
### voteCast
**voteCast( address voter, address victim, bool promotion )**
Gives the address of who voted, who they voted for and if it should
be a promotion (true) or demotion (false).
A promotion means to become a member of the council.
A demotion means to be removed from the list of council members.
### adminChange
**adminChange( address admin, bool promotion )**
This event is emitted when an address has received enough votes to be
promoted or demoted and that action is taken.
## Functions
### constructor
**constructor( uint timeout )**
This function is called when the contract is getting deployed.
The deploying address automatically becomes the only council member and
needs to vote to include other's. The contract creator has no special
powers other than other council members, and as such can be voted out
and lose all control over the contract.
If you specify an integer when deploying the contract, you can change
the time it takes for a vote to time out. The timeout can not be set
lower than one hour. The default is 7 days.
### setTimeout
**setTimeout( uint timeout )**
Change the timeout (in seconds) for validity of votes cast.
Any council member can change the timeout.
The timeout can not be set lower than one hour.
### councilLength
**councilLength()**
Returns a uint telling how many entries are in the council list.
### votesLength
**votesLength()**
Returns a uint telling how many structs are in the votes array.
### isCouncil
**isCouncil( address subject )**
Returns true or false whether the given address is a member of the
council.
### mayVote
**mayVote( address voter, address victim, bool promotion )**
Returns true or false if a certain address may vote a certain vote for
a certain address.
### vote
**vote( address victim, bool promotion )**
Performs actual voting on including (true) or removing (false) an address
from the council.
If the final member of the council votes to remove itself, the contract
will self-destruct.
This diff is collapsed.
608060405262093a8060025534801561001757600080fd5b506040516111e83803806111e88339818101604052602081101561003a57600080fd5b8101908080519060200190929190505050610e10811061005c57806002819055505b6000339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050611119806100cf6000396000f3fe608060405234801561001057600080fd5b50600436106100b0576000357c010000000000000000000000000000000000000000000000000000000090048063c0165ea511610083578063c0165ea51461026a578063c58a34cc14610288578063de4f6347146102b6578063efaabd59146102d4578063f4de6da6146102f2576100b0565b80635df81330146100b557806370c56edc1461013a5780639aa360ec146101c0578063bd041c4d1461021a575b600080fd5b6100e1600480360360208110156100cb57600080fd5b810190808035906020019092919050505061034a565b604051808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001821515815260200194505050505060405180910390f35b6101a86004803603606081101561015057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506103d4565b60405180821515815260200191505060405180910390f35b610202600480360360208110156101d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105c5565b60405180821515815260200191505060405180910390f35b6102686004803603604081101561023057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610666565b005b6102726108fe565b6040518082815260200191505060405180910390f35b6102b46004803603602081101561029e57600080fd5b8101908080359060200190929190505050610904565b005b6102be610976565b6040518082815260200191505060405180910390f35b6102dc610983565b6040518082815260200191505060405180910390f35b61031e6004803603602081101561030857600080fd5b810190808035906020019092919050505061098f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6001818154811061035757fe5b90600052602060002090600402016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030160009054906101000a900460ff16905084565b6000806103e0856105c5565b905060006103ed856105c5565b9050816103ff576000925050506105be565b8080156104095750835b15610419576000925050506105be565b80158015610425575083155b15610435576000925050506105be565b600060025442039050600060018054905090505b6000818060019003925011156105b5578773ffffffffffffffffffffffffffffffffffffffff166001828154811061047d57fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614801561053b57508673ffffffffffffffffffffffffffffffffffffffff16600182815481106104f157fe5b906000526020600020906004020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b801561057557508515156001828154811061055257fe5b906000526020600020906004020160030160009054906101000a900460ff161515145b801561059e5750816001828154811061058a57fe5b906000526020600020906004020160020154115b156105b05760009450505050506105be565b610449565b60019450505050505b9392505050565b60008060008054905090505b60008180600190039250111561065b57600081815481106105ee57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610656576001915050610661565b6105d1565b60009150505b919050565b6106713383836103d4565b6106c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806110b36031913960400191505060405180910390fd5b600060025442039050600060018054905090505b60008180600190039250111561071f5781600182815481106106f857fe5b906000526020600020906004020160020154101561071a57610719816109cb565b5b6106da565b600160405180608001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff168152602001428152602001851515815250908060018154018082558091505060019003906000526020600020906004020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506040820151816002015560608201518160030160006101000a81548160ff02191690831515021790555050507f14b0f3afd5fdc1f8d3addf2dbf157d1362930a9cf8393fcadd50b05ec3e56fd8338585604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018215158152602001935050505060405180910390a16108d28484610bbb565b6000808054905014156108f8573373ffffffffffffffffffffffffffffffffffffffff16ff5b50505050565b60025481565b61090d336105c5565b610962576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180611088602b913960400191505060405180910390fd5b610e10811061097357806002819055505b50565b6000600180549050905090565b60008080549050905090565b6000818154811061099c57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060018054905090505b80826001019250821015610b2957600182815481106109f157fe5b9060005260206000209060040201600180840381548110610a0e57fe5b90600052602060002090600402016000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600282015481600201556003820160009054906101000a900460ff168160030160006101000a81548160ff0219169083151502179055509050506109d6565b6001805480610b3457fe5b6001900381819060005260206000209060040201600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560028201600090556003820160006101000a81549060ff0219169055505090555050565b6000806001600260008054905081610bcf57fe5b04019050600060018054905090505b600081806001900392501115610ca8578473ffffffffffffffffffffffffffffffffffffffff1660018281548110610c1257fe5b906000526020600020906004020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610c95575083151560018281548110610c7257fe5b906000526020600020906004020160030160009054906101000a900460ff161515145b15610ca35782806001019350505b610bde565b81831015610cb857505050610e5f565b8315610d26576000859080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610d30565b610d2f85610e63565b5b7f74e4000982957adcdc88cbfaae69f0a87d5e3a60631f7b82acffe83c0d9307b88585604051808373ffffffffffffffffffffffffffffffffffffffff16815260200182151581526020019250505060405180910390a160018054905090505b600081806001900392501115610e5b578473ffffffffffffffffffffffffffffffffffffffff1660018281548110610dc457fe5b906000526020600020906004020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610e47575083151560018281548110610e2457fe5b906000526020600020906004020160030160009054906101000a900460ff161515145b15610e5657610e55816109cb565b5b610d90565b5050505b5050565b600060018054905090505b600081806001900392501115610eff578173ffffffffffffffffffffffffffffffffffffffff1660018281548110610ea257fe5b906000526020600020906004020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610efa57610ef9816109cb565b5b610e6e565b60008054905090505b600081806001900392501115611082578173ffffffffffffffffffffffffffffffffffffffff1660008281548110610f3c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561107d5760008190506000808054905090505b808260010192508210156110355760008281548110610fad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660006001840381548110610fe857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f92565b600080548061104057fe5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055505050611084565b610f08565b505b5056fe4f6e6c7920636f756e63696c206d656d62657273206d61792075736520746869732066756e6374696f6e2e54686174207365656d7320726564756e64616e74206f72206973206f7468657277697365206e6f7420616c6c6f7765642ea264697066735822122021658f7485c7f73d8f29511e684b284f7b49ac44120efd15b54283a8d8e6c7b664736f6c63430007020033
../test/test-harness-v1.sh
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.