Skip to content

Commit

Permalink
Prevent delegation to zero
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangoree committed Apr 18, 2024
1 parent 48d353f commit d54fb8a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/vaults/LockingVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ abstract contract AbstractLockingVault is IVotingVault, ILockingVault {
/// @notice Changes a user's voting power
/// @param newDelegate The new address which gets voting power
function changeDelegation(address newDelegate) external override {
// No delegating to zero
require(newDelegate != address(0), "Zero addr delegation");
// Get the stored user data
Storage.AddressUint storage userData = _deposits()[msg.sender];
// Get the user balance
Expand Down

0 comments on commit d54fb8a

Please sign in to comment.