Skip to content

Commit

Permalink
fix: implement review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-morpho committed Feb 3, 2025
1 parent 06b6407 commit 3fb5d42
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion certora/specs/Delegation.spec
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ rule updatedDelegatedVPLTEqTotalSupply(env e, address to, uint256 amount) {
// This require avoids an impossible revert as zeroVirtualVotingPower operations comme from munging.
require delegatee(e.msg.sender) == 0 => currentContract._zeroVirtualVotingPower >= balanceOf(e.msg.sender);

uint256 delegatedVotingPowerDelegateeToBefore = delegatedVotingPower(delegatee(to));

// This invariant can't be required as it's using a parameterized variable.
// But it is proven by delegatedLTEqDelegateeVP.
require delegatee(e.msg.sender) != 0 => delegatedVotingPower(delegatee(e.msg.sender)) >= balanceOf(e.msg.sender);
Expand All @@ -239,5 +241,5 @@ rule updatedDelegatedVPLTEqTotalSupply(env e, address to, uint256 amount) {

assert delegatee(e.msg.sender) == e.msg.sender;

assert delegatedVotingPower(to) + amount <= totalSupply();
assert delegatedVotingPowerDelegateeToBefore + amount <= totalSupply();
}

0 comments on commit 3fb5d42

Please sign in to comment.