Skip to content

Commit

Permalink
refactor: simplify revert causes
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-morpho committed Dec 16, 2024
1 parent 2ebbdff commit 6ab5bad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions certora/specs/MintBurnEthereum.spec
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ rule mint(env e) {

// cache state
uint256 toBalanceBefore = balanceOf(to);
uint256 toVotingPowerBefore = delegatedVotingPower(delegatee(to));
uint256 otherBalanceBefore = balanceOf(other);
uint256 totalSupplyBefore = totalSupply();

Expand All @@ -76,8 +75,7 @@ rule mint(env e) {

// check outcome
if (lastReverted) {
assert e.msg.sender != owner() || to == 0 || totalSupplyBefore + amount > max_uint256 ||
toVotingPowerBefore + amount > max_uint256;
assert e.msg.sender != owner() || to == 0 || totalSupplyBefore + amount > max_uint256 ;
} else {
// updates balance and totalSupply
assert e.msg.sender == owner();
Expand Down
3 changes: 1 addition & 2 deletions certora/specs/MintBurnOptimism.spec
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ rule mint(env e) {

// cache state
uint256 toBalanceBefore = balanceOf(to);
uint256 toVotingPowerBefore = delegatedVotingPower(delegatee(to));
uint256 otherBalanceBefore = balanceOf(other);
uint256 totalSupplyBefore = totalSupply();

Expand All @@ -78,7 +77,7 @@ rule mint(env e) {
// check outcome
if (lastReverted) {
assert e.msg.sender != owner() || to == 0 || totalSupplyBefore + amount > max_uint256 ||
toVotingPowerBefore + amount > max_uint256 || e.msg.sender != currentContract.bridge;
e.msg.sender != currentContract.bridge;
} else {
// updates balance and totalSupply
assert e.msg.sender == currentContract.bridge;
Expand Down

0 comments on commit 6ab5bad

Please sign in to comment.