IAUT_EXT_VotingRoles_v1.sol
Functions
MAX_VOTING_DURATION
The maximum voting duration.
Returns
<none>
uint256
The maximum voting duration.
MIN_VOTING_DURATION
The minimum voting duration.
Returns
<none>
uint256
The minimum voting duration.
isVoter
Checks whether an address is a voter.
Parameters
who
address
The address to check.
Returns
<none>
bool
Whether the address is a voter.
addVoter
Adds a voter.
Parameters
who
address
The address to add.
addVoterAndUpdateThreshold
Adds a voter and updates the threshold.
Parameters
who
address
The address to add.
newThreshold
uint256
The new threshold.
removeVoter
Removes a voter.
Parameters
who
address
The address to remove.
removeVoterAndUpdateThreshold
Removes a voter and updates the threshold.
Parameters
who
address
The address to remove.
newThreshold
uint256
The new threshold.
motions
Gets the motion data.
Parameters
motionId
bytes32
The ID of the motion.
Returns
<none>
address
target The address of the contract to execute the action on.
<none>
bytes
action The action data to execute on the target contract.
<none>
uint256
startTimestamp The timestamp at which the motion starts.
<none>
uint256
endTimestamp The timestamp at which the motion ends.
<none>
uint256
requiredThreshold The required threshold of votes to pass the motion.
<none>
uint256
forVotes The number of votes in favor of the motion.
<none>
uint256
againstVotes The number of votes against the motion.
<none>
uint256
abstainVotes The number of votes abstaining from the motion.
<none>
uint256
executedAt The timestamp at which the motion was executed.
<none>
bool
executionResult The result of the execution.
<none>
bytes
executionReturnData The return data of the execution.
motionCount
Gets the number of motions.
Returns
<none>
uint256
The number of motions.
voterCount
Gets the number of voters.
Returns
<none>
uint256
The number of voters.
threshold
Gets the threshold.
Returns
<none>
uint256
The threshold.
getReceipt
Gets the receipt of a voter for a motion.
Parameters
_ID
bytes32
The ID of the motion.
voter
address
The address of the voter.
Returns
<none>
Receipt
The receipt of the voter.
voteDuration
Gets the voting duration.
Returns
<none>
uint256
The voting duration.
setThreshold
Sets the threshold.
Parameters
newThreshold
uint256
The new threshold.
setVotingDuration
Sets the voting duration.
Parameters
newVoteDuration
uint256
The new voting duration.
createMotion
Creates a motion.
Parameters
target
address
The address of the contract to execute the action on.
action
bytes
The action data to execute on the target contract.
Returns
<none>
bytes32
The ID of the created motion.
castVote
Casts a vote for a motion.
Parameters
motionId
bytes32
The ID of the motion.
support
uint8
The value that indicates wether the voter supports the motion.
executeMotion
Executes a motion.
Parameters
motionId
bytes32
The ID of the motion.
Events
VoterAdded
Event emitted when a new voter address gets added.
Parameters
who
address
The added address.
VoterRemoved
Event emitted when a voter address gets removed.
Parameters
who
address
The removed address.
ThresholdUpdated
Event emitted when the required threshold changes.
Parameters
oldThreshold
uint256
The old threshold.
newThreshold
uint256
The new threshold.
VoteDurationUpdated
Event emitted when the voting duration changes.
Parameters
oldVotingDuration
uint256
The old voting duration.
newVotingDuration
uint256
The new voting duration.
MotionCreated
Event emitted when a motion is created.
Parameters
motionId
bytes32
The motion ID.
VoteCast
Event emitted when a vote is cast for a motion.
Parameters
motionId
bytes32
The motion ID.
voter
address
The address of a voter.
support
uint8
MotionExecuted
Event emitted when a motion is executed.
Parameters
motionId
bytes32
The motion ID.
Errors
Module__VotingRoleManager__EmptyVoters
The action would leave an empty voter list.
Module__VotingRoleManager__InvalidVoterAddress
The supplied voter address is invalid.
Module__VotingRoleManager__InvalidThreshold
The threshold cannot exceed the amount of voters. or be too low to be considered safe.
Module__VotingRoleManager__InvalidVotingDuration
The supplied voting duration is invalid.
Module__VotingRoleManager__CallerNotVoter
The function can only be called by a voter.
Module__VotingRoleManager__IsAlreadyVoter
The address is already a voter.
Module__VotingRoleManager__InvalidSupport
The value given as vote is invalid.
Module__VotingRoleManager__InvalidMotionId
The supplied ID is referencing a motion that doesn't exist.
Module__VotingRoleManager__AttemptedDoubleVote
A user cannot vote twice.
Module__VotingRoleManager__MotionInVotingPhase
A motion cannot be executed if the voting duration hasn't passed.
Module__VotingRoleManager__MotionVotingPhaseClosed
A motion cannot be voted on if the duration has been exceeded.
Module__VotingRoleManager__MotionAlreadyExecuted
A motion cannot be executed twice.
Module__VotingRoleManager__ThresholdNotReached
A motion cannot be executed if it didn't reach the threshold.
Structs
Motion
A motion is a proposal to execute an action on a target contract.
Properties
target
address
The address of the contract to execute the action on.
action
bytes
The action data to execute on the target contract.
startTimestamp
uint256
The timestamp at which the motion starts.
endTimestamp
uint256
The timestamp at which the motion ends.
requiredThreshold
uint256
The required threshold of votes to pass the motion.
forVotes
uint256
The number of votes in favor of the motion.
againstVotes
uint256
The number of votes against the motion.
abstainVotes
uint256
The number of votes abstaining from the motion.
receipts
mapping(address => Receipt)
The receipts of votes for the motion address => Receipt
executedAt
uint256
The timestamp at which the motion was executed.
executionResult
bool
The result of the execution.
executionReturnData
bytes
The return data of the execution.
Receipt
A receipt is a vote cast for a motion.
Properties
hasVoted
bool
Whether the voter has already voted.
support
uint8
The value that indicates wether the voter supports the motion.
Last updated