ContributionReward¶
A scheme for proposing and rewarding contributions to an organization
Execution cost: less than 21923 gas
Deployment cost: less than 1485400 gas
Combined cost: less than 1507323 gas
Constructor¶
Events¶
NewContributionProposal(address,bytes32,address,bytes32,int256,uint256[5],address,address)¶
Execution cost: No bound available
Params:
- _avatar of type
address
- _proposalId of type
bytes32
- _intVoteInterface of type
address
- _contributionDescription of type
bytes32
- _reputationChange of type
int256
- _rewards of type
uint256[5]
- _externalToken of type
address
- _beneficiary of type
address
OwnershipTransferred(address,address)¶
Execution cost: No bound available
Params:
- previousOwner of type
address
- newOwner of type
address
ProposalExecuted(address,bytes32,int256)¶
Execution cost: No bound available
Params:
- _avatar of type
address
- _proposalId of type
bytes32
- _param of type
int256
RedeemEther(address,bytes32,address,uint256)¶
Execution cost: No bound available
Params:
- _avatar of type
address
- _proposalId of type
bytes32
- _beneficiary of type
address
- _amount of type
uint256
RedeemExternalToken(address,bytes32,address,uint256)¶
Execution cost: No bound available
Params:
- _avatar of type
address
- _proposalId of type
bytes32
- _beneficiary of type
address
- _amount of type
uint256
RedeemNativeToken(address,bytes32,address,uint256)¶
Execution cost: No bound available
Params:
- _avatar of type
address
- _proposalId of type
bytes32
- _beneficiary of type
address
- _amount of type
uint256
RedeemReputation(address,bytes32,address,int256)¶
Execution cost: No bound available
Params:
- _avatar of type
address
- _proposalId of type
bytes32
- _beneficiary of type
address
- _amount of type
int256
Methods¶
getParametersHash(uint256,bytes32,address)¶
return a hash of the given parameters
Execution cost: less than 755 gas
Attributes: constant
Params:
-
_orgNativeTokenFee of type
uint256
the fee for submitting a contribution in organizations native token
-
_voteApproveParams of type
bytes32
parameters for the voting machine used to approve a contribution
-
_intVote of type
address
the voting machine used to approve a contribution
Returns:
a hash of the parameters
- output_0 of type
bytes32
hashedParameters()¶
Execution cost: less than 788 gas
Attributes: constant
Returns:
- output_0 of type
bytes32
getPeriodsToPay(bytes32,address,uint256)¶
getPeriodsToPay return the periods left to be paid for reputation,nativeToken,ether or externalToken. The function ignore the reward amount to be paid (which can be zero).
Execution cost: No bound available
Attributes: constant
Params:
-
_proposalId of type
bytes32
the ID of the voting in the voting machine
-
_avatar of type
address
address of the controller
-
_redeemType of type
uint256
- the type of the reward : 0 - reputation 1 - nativeTokenReward 2 - Ether 3 - ExternalToken
Returns:
periods left to be paid.
- output_0 of type
uint256
getRedeemedPeriods(bytes32,address,uint256)¶
getRedeemedPeriods return the already redeemed periods for reputation, nativeToken, ether or externalToken.
Execution cost: less than 989 gas
Attributes: constant
Params:
-
_proposalId of type
bytes32
the ID of the voting in the voting machine
-
_avatar of type
address
address of the controller
-
_redeemType of type
uint256
- the type of the reward : 0 - reputation 1 - nativeTokenReward 2 - Ether 3 - ExternalToken
Returns:
redeemed period.
- output_0 of type
uint256
execute(bytes32,address,int256)¶
execution of proposals, can only be called by the voting machine in which the vote is held.
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the ID of the voting in the voting machine
-
_avatar of type
address
address of the controller
-
_param of type
int256
a parameter of the voting result, 1 yes and 2 is no.
Returns:
- output_0 of type
bool
redeemEther(bytes32,address)¶
RedeemEther reward for proposal
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the ID of the voting in the voting machine
-
_avatar of type
address
address of the controller
Returns:
result boolean for success indication.
- output_0 of type
bool
parameters(bytes32)¶
Execution cost: less than 1148 gas
Attributes: constant
Params:
- param_0 of type
bytes32
Returns:
- orgNativeTokenFee of type
uint256
- voteApproveParams of type
bytes32
- intVote of type
address
owner()¶
Execution cost: less than 721 gas
Attributes: constant
Returns:
- output_0 of type
address
organizationsProposals(address,bytes32)¶
Execution cost: less than 2981 gas
Attributes: constant
Params:
- param_0 of type
address
- param_1 of type
bytes32
Returns:
- contributionDescriptionHash of type
bytes32
- nativeTokenReward of type
uint256
- reputationChange of type
int256
- ethReward of type
uint256
- externalToken of type
address
- externalTokenReward of type
uint256
- beneficiary of type
address
- periodLength of type
uint256
- numberOfPeriods of type
uint256
- executionTime of type
uint256
proposeContributionReward(address,bytes32,int256,uint256[5],address,address)¶
Submit a proposal for a reward for a contribution:
Execution cost: No bound available
Params:
-
_avatar of type
address
Avatar of the organization that the contribution was made for
-
_contributionDescriptionHash of type
bytes32
A hash of the contribution's description
-
_reputationChange of type
int256
- Amount of reputation change requested .Can be negative.
-
_rewards of type
uint256[5]
rewards array: rewards[0] - Amount of tokens requested per period rewards[1] - Amount of ETH requested per period rewards[2] - Amount of external tokens requested per period rewards[3] - Period length rewards[4] - Number of periods
-
_externalToken of type
address
Address of external token, if reward is requested there
-
_beneficiary of type
address
Who gets the rewards
Returns:
- output_0 of type
bytes32
redeem(bytes32,address,bool[4])¶
redeem rewards for proposal
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the ID of the voting in the voting machine
-
_avatar of type
address
address of the controller
-
_whatToRedeem of type
bool[4]
whatToRedeem array: whatToRedeem[0] - reputation whatToRedeem[1] - nativeTokenReward whatToRedeem[2] - Ether whatToRedeem[3] - ExternalToken
Returns:
result boolean array for each redeem type.
- result of type
bool[4]
redeemExternalToken(bytes32,address)¶
RedeemNativeToken reward for proposal
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the ID of the voting in the voting machine
-
_avatar of type
address
address of the controller
Returns:
result boolean for success indication.
- output_0 of type
bool
redeemNativeToken(bytes32,address)¶
RedeemNativeToken reward for proposal
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the ID of the voting in the voting machine
-
_avatar of type
address
address of the controller
Returns:
result boolean for success indication.
- output_0 of type
bool
redeemReputation(bytes32,address)¶
RedeemReputation reward for proposal
Execution cost: No bound available
Params:
-
_proposalId of type
bytes32
the ID of the voting in the voting machine
-
_avatar of type
address
address of the controller
Returns:
result boolean for success indication.
- output_0 of type
bool
setParameters(uint256,bytes32,address)¶
hash the parameters, save them if necessary, and return the hash value
Execution cost: less than 61154 gas
Params:
- _orgNativeTokenFee of type
uint256
- _voteApproveParams of type
bytes32
- _intVote of type
address
Returns:
- output_0 of type
bytes32
transferOwnership(address)¶
Allows the current owner to transfer control of the contract to a newOwner.
Execution cost: less than 23137 gas
Params:
-
newOwner of type
address
The address to transfer ownership to.
updateParameters(bytes32)¶
Execution cost: less than 20572 gas
Params:
- _hashedParameters of type
bytes32