Skip to content

Commit

Permalink
fix: add missing hypothesis in transfer rules
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-morpho committed Jan 16, 2025
1 parent f6f5b89 commit f121755
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions certora/specs/ERC20.spec
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ rule transfer(env e) {
uint256 otherBalanceBefore = balanceOf(other);

// Safe require as it is verified in delegatedLTEqDelegateeVP.
require holderBalanceBefore <= holderVotingPowerBefore;
require delegatee(holder) != 0 => holderBalanceBefore <= holderVotingPowerBefore;
// Safe require as it is verified in totalSupplyGTEqSumOfVotingPower.
require delegatee(holder) != delegatee(recipient) => holderBalanceBefore + recipientVotingPowerBefore <= totalSupply();
require delegatee(holder) != delegatee(recipient) => recipientVotingPowerBefore + holderBalanceBefore <= totalSupply();

// run transaction
transfer@withrevert(e, recipient, amount);
Expand Down Expand Up @@ -133,9 +133,9 @@ rule transferFrom(env e) {
uint256 otherBalanceBefore = balanceOf(other);

// Safe require as it is verified in delegatedLTEqDelegateeVP.
require holderBalanceBefore <= holderVotingPowerBefore;
require delegatee(holder) != 0 => holderBalanceBefore <= holderVotingPowerBefore;
// Safe require as it is verified in totalSupplyGTEqSumOfVotingPower.
require delegatee(holder) != delegatee(recipient) => holderBalanceBefore + recipientVotingPowerBefore <= totalSupply();
require delegatee(holder) != delegatee(recipient) => recipientVotingPowerBefore + holderBalanceBefore <= totalSupply();

// run transaction
transferFrom@withrevert(e, holder, recipient, amount);
Expand Down

0 comments on commit f121755

Please sign in to comment.