function transfer(address, uint256) public pure override returns (bool) {
revert("GT: transfer is prohibited");
}
function canCloseProposal(uint _proposalId)
...
if (numberOfMembers == proposalVoteTally[_proposalId].voters
|| dateUpdate.add(_closingTime) <= now)
return 1;
tokenInstance.lockForMemberVote(msg.sender, tokenHoldingTime);
// This could re-enter, though we can assume the governance token is not malicious.
uint256 voterStake = token.balanceOfAt(_voter, vote_.snapshotBlock);
VoterState state = vote_.voters[_voter];
// If the voter had previously voted, then we decrease the count.
if (state == VoterState.Yea) {
vote_.yea = vote_.yea.sub(voterStake);
} else if (state == VoterState.Nay) {
vote_.nay = vote_.nay.sub(voterStake);
}
function vote(
uint256 _voteId,
bool _supports,
bool _executesIfDecided
) external voteExists(_voteId)
for (uint256 i = 0; i < signers.length; i++) {
share += balanceOf(signers[i]);
}
if (share * 100 < totalSupply() * quorum) {
return false;
}
require(!_hasDuplicate(signers), "DAO: signatures are not unique.");
function getTxHash
...
return
keccak256(abi.encode(
address(this),
_target,
_data,
_value,
_nonce,
_timestamp,
block.chainid
));
}
require(!executedTx[txHash], "DAO: voting already executed.");
function _castVote...
...
require(state(proposalId) == ProposalState.Active, "Governance::_castVote: voting is closed.");
require(receipt.hasVoted == false, "Governance::_castVote: voter already voted.");
function submitVote(uint _proposalId, uint _solutionChosen) external {
...
require(allProposalData[_proposalId].propStatus == uint(Governance.ProposalStatus.VotingStarted), "Not allowed");
function _submitVote(uint _proposalId, uint _solution) internal {
...
require(memberProposalVote[msg.sender][_proposalId] == 0, "Not allowed");
...
memberProposalVote[msg.sender][_proposalId] = totalVotes;
function newVote(bytes _executionScript, string _metadata) external auth(CREATE_VOTES_ROLE) returns (uint256 voteId)
emit StartVote(voteId, msg.sender, _metadata);
function propose(
string calldata _title,
string calldata _metadata,
uint256 _votingPeriod,
address _target,
uint256 _value,
bytes memory _data
)
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description
)
function lockForMemberVote(
address _of,
uint _days
) public onlyOperator {
if (_days.add(now) > isLockedForMV[_of])
isLockedForMV[_of] = _days.add(now);
}
assert ERC20(self.token).transferFrom(_addr, self, _value)
...
assert ERC20(self.token).transfer(msg.sender, value)
function _isVoteOpen(Vote storage vote_) internal view returns (bool) {
return getTimestamp64() < vote_.startDate.add(voteTime) && !vote_.executed;
}
uint32 public constant VOTING_DURATION = 3 days;
...
require(
_timestamp + VOTING_DURATION >= block.timestamp,
"DAO: voting is over."
);
uint256 public voteDelay = 604800;
...
modifier hasVoted(address voter) {
uint256 time = block.timestamp - lastVote[voter];
require(time > voteDelay, "You voted in the last 7 days.");
_;
}
function canCloseProposal(uint _proposalId)
...
if (numberOfMembers == proposalVoteTally[_proposalId].voters
|| dateUpdate.add(_closingTime) <= now)
return 1;
function vote(
uint256 _voteId,
bool _supports,
bool _executesIfDecided
) external voteExists(_voteId)
for (uint256 i = 0; i < _tokenCnt; i++) {
_totalVoteWeight = _totalVoteWeight + _weights[i];
}
IBribe(bribes[gauges[_token]])._withdraw(...);
...
IBribe(bribes[_gauge])._deposit(uint256(_tokenWeight), _owner);
function vote(uint256 _proposalId, bool _support)
function _setVoteTally(uint _proposalId, uint _solution, uint mrSequence) internal {
...
tokenInstance.lockForMemberVote(msg.sender, tokenHoldingTime);
function delegateVote(address _add) external isMemberAndcheckPause checkPendingRewards {
revert("Delegations are not allowed.");
if (allVotesByMember[msg.sender].length > 0) {
require((allVotes[allVotesByMember[msg.sender][allVotesByMember[msg.sender].length - 1]].dateAdd).add(tokenHoldingTime) < now);
}
function submitVote(uint _proposalId, uint _solutionChosen)
function castVote(uint256 proposalId, bool support)