AbsoluteVote¶
Execution cost: less than 1036 gas
Deployment cost: less than 1002000 gas
Combined cost: less than 1003036 gas
Events¶
CancelProposal(bytes32)¶
Execution cost: No bound available
Params:
- _proposalId of type
bytes32
CancelVoting(bytes32,address)¶
Execution cost: No bound available
Params:
- _proposalId of type
bytes32
- _voter of type
address
ExecuteProposal(bytes32,uint256,uint256)¶
Execution cost: No bound available
Params:
- _proposalId of type
bytes32
- _decision of type
uint256
- _totalReputation of type
uint256
NewProposal(bytes32,uint256,address,bytes32)¶
Execution cost: No bound available
Params:
- _proposalId of type
bytes32
- _numOfChoices of type
uint256
- _proposer of type
address
- _paramsHash of type
bytes32
RefreshReputation(bytes32,address,uint256)¶
Execution cost: No bound available
Params:
- _proposalId of type
bytes32
- _voter of type
address
- _reputation of type
uint256
VoteProposal(bytes32,address,uint256,uint256,bool)¶
Execution cost: No bound available
Params:
- _proposalId of type
bytes32
- _voter of type
address
- _vote of type
uint256
- _reputation of type
uint256
- _isOwnerVote of type
bool
Methods¶
refreshReputation(bytes32,address[])¶
refreshReputation refresh the reputation for a given voters list
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the ID of the proposal
-
_voters of type
address[]
list to be refreshed
Returns:
bool true or false
- output_0 of type
bool
parameters(bytes32)¶
Execution cost: less than 1169 gas
Attributes: constant
Params:
- param_0 of type
bytes32
Returns:
- reputationSystem of type
address
- precReq of type
uint256
- allowOwner of type
bool
execute(bytes32)¶
execute check if the proposal has been decided, and if so, execute the proposal
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the id of the proposal
Returns:
bool true - the proposal has been executed false - otherwise.
- output_0 of type
bool
isVotable(bytes32)¶
isVotable check if the proposal is votable
Execution cost: less than 878 gas
Attributes: constant
Params:
-
_proposalId of type
bytes32
the ID of the proposal
Returns:
bool true or false
- output_0 of type
bool
getNumberOfChoices(bytes32)¶
getNumberOfChoices returns the number of choices possible in this proposal
Execution cost: less than 800 gas
Attributes: constant
Params:
-
_proposalId of type
bytes32
the ID of the proposal
Returns:
uint that contains number of choices
- output_0 of type
uint256
cancelVote(bytes32)¶
Cancel the vote of the msg.sender: subtract the reputation amount from the votes and delete the voter from the proposal struct
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
id of the proposal
ownerVote(bytes32,uint256,address)¶
voting function with owner functionality (can vote on behalf of someone else)
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
id of the proposal
-
_vote of type
uint256
a value between 0 to and the proposal number of choices.
-
_voter of type
address
will be voted with that voter's address
Returns:
bool true - the proposal has been executed false - otherwise.
- output_0 of type
bool
cancelProposal(bytes32)¶
Cancel a proposal, only the owner can call this function and only if allowOwner flag is true.
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the proposal ID
Returns:
- output_0 of type
bool
isAbstainAllow()¶
isAbstainAllow returns if the voting machine allow abstain (0)
Execution cost: less than 418 gas
Attributes: constant
Returns:
bool true or false
- output_0 of type
bool
getParametersHash(address,uint256,bool)¶
hashParameters returns a hash of the given parameters
Execution cost: less than 603 gas
Attributes: constant
Params:
- _reputationSystem of type
address
- _precReq of type
uint256
- _allowOwner of type
bool
Returns:
- output_0 of type
bytes32
MAX_NUM_OF_CHOICES()¶
Execution cost: less than 456 gas
Attributes: constant
Returns:
- output_0 of type
uint256
proposals(bytes32)¶
Execution cost: less than 2232 gas
Attributes: constant
Params:
- param_0 of type
bytes32
Returns:
- owner of type
address
- avatar of type
address
- numOfChoices of type
uint256
- executable of type
address
- paramsHash of type
bytes32
- totalVotes of type
uint256
- open of type
bool
proposalsCnt()¶
Execution cost: less than 524 gas
Attributes: constant
Returns:
- output_0 of type
uint256
propose(uint256,bytes32,address,address,address)¶
register a new proposal with the given parameters. Every proposal has a unique ID which is being generated by calculating keccak256 of a incremented counter.
Execution cost: less than 150314 gas
Params:
-
_numOfChoices of type
uint256
number of voting choices
-
_paramsHash of type
bytes32
defined the parameters of the voting machine used for this proposal
-
_avatar of type
address
an address to be sent as the payload to the _executable contract.
-
_executable of type
address
This contract will be executed when vote is over.
-
param_4 of type
address
Returns:
proposal's id.
- output_0 of type
bytes32
setParameters(address,uint256,bool)¶
hash the parameters, save them if necessary, and return the hash value
Execution cost: less than 61917 gas
Params:
- _reputationSystem of type
address
- _precReq of type
uint256
- _allowOwner of type
bool
Returns:
- output_0 of type
bytes32
vote(bytes32,uint256)¶
voting function
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
id of the proposal
-
_vote of type
uint256
a value between 0 to and the proposal number of choices.
Returns:
bool true - the proposal has been executed false - otherwise.
- output_0 of type
bool
voteInfo(bytes32,address)¶
voteInfo returns the vote and the amount of reputation of the user committed to this proposal
Execution cost: less than 1230 gas
Attributes: constant
Params:
-
_proposalId of type
bytes32
the ID of the proposal
-
_voter of type
address
the address of the voter
Returns:
uint vote - the voters vote uint reputation - amount of reputation committed by _voter to _proposalId
- output_0 of type
uint256
- output_1 of type
uint256
voteStatus(bytes32,uint256)¶
voteStatus returns the reputation voted for a proposal for a specific voting choice.
Execution cost: less than 925 gas
Attributes: constant
Params:
-
_proposalId of type
bytes32
the ID of the proposal
-
_choice of type
uint256
the index in the
Returns:
voted reputation for the given choice
- output_0 of type
uint256
voteWithSpecifiedAmounts(bytes32,uint256,uint256,uint256)¶
Execution cost: No bound available
Params:
- _proposalId of type
bytes32
- _vote of type
uint256
- _rep of type
uint256
- param_3 of type
uint256
Returns:
- output_0 of type
bool