Skip to content

Commit

Permalink
feat: add non-delegable flag feature
Browse files Browse the repository at this point in the history
Signed-off-by: 0xRaccoon <[email protected]>
  • Loading branch information
0xRaccoon committed Dec 28, 2023
1 parent 5a3bbf8 commit 6490b89
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions solidity/contracts/governance/utils/WonderVotes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ abstract contract WonderVotes is Context, EIP712, Nonces, IERC6372, IWonderVotes

mapping(uint8 proposalType => Checkpoints.Trace208) private _totalCheckpoints;

mapping(address account => bool) private _nonDelegatableAddresses;
mapping(address account => bool) private _nonDelegableAddresses;

/**
* @dev The clock was incorrectly modified.
Expand Down Expand Up @@ -248,14 +248,14 @@ abstract contract WonderVotes is Context, EIP712, Nonces, IERC6372, IWonderVotes
* @dev See {IWonderVotes-isSuspendedDelegation}.
*/
function isSuspendedDelegation(address account) external view returns (bool) {
return _nonDelegatableAddresses[account];
return _nonDelegableAddresses[account];
}

/**
* @dev See {IWonderVotes-suspendDelegation}.
*/
function suspendDelegation(bool allow) external {
_nonDelegatableAddresses[msg.sender] = allow;
_nonDelegableAddresses[msg.sender] = allow;
}

/**
Expand Down Expand Up @@ -408,7 +408,7 @@ abstract contract WonderVotes is Context, EIP712, Nonces, IERC6372, IWonderVotes
* @dev checks if the delegation is active for the `account`
*/
modifier activeDelegation(address account) {
if (_nonDelegatableAddresses[account]) revert DelegationSuspended(account);
if (_nonDelegableAddresses[account]) revert DelegationSuspended(account);
_;
}

Expand All @@ -417,7 +417,7 @@ abstract contract WonderVotes is Context, EIP712, Nonces, IERC6372, IWonderVotes
*/
modifier activeDelegations(Delegate[] memory delegatees) {
for (uint256 i = 0; i < delegatees.length; i++) {
if (_nonDelegatableAddresses[delegatees[i].account]) revert DelegationSuspended(delegatees[i].account);
if (_nonDelegableAddresses[delegatees[i].account]) revert DelegationSuspended(delegatees[i].account);
}
_;
}
Expand Down

0 comments on commit 6490b89

Please sign in to comment.