Skip to content

Commit

Permalink
fix: update to new invariants
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-morpho committed Dec 10, 2024
1 parent 9132208 commit d648654
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions certora/specs/MintBurnEthereum.spec
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ rule noChangeTotalSupply(env e) {
rule mint(env e) {
requireInvariant totalSupplyIsSumOfBalances();
requireInvariant balancesLTEqTotalSupply();
requireInvariant delegatedVotingPowerLTEqTotalVotingPower();
assert isTotalSupplyGTEqSumOfVotingPower();
requireInvariant zeroAddressNoVotingPower();
require nonpayable(e);
Expand All @@ -70,9 +71,6 @@ rule mint(env e) {
uint256 otherBalanceBefore = balanceOf(other);
uint256 totalSupplyBefore = totalSupply();

// Safe require thats follows from delegatedVotingPowerLTEqTotalVotingPower.
require toVotingPowerBefore <= sumOfVotingPower;

// run transaction
mint@withrevert(e, to, amount);

Expand Down Expand Up @@ -100,6 +98,7 @@ rule burn(env e) {
requireInvariant balancesLTEqTotalSupply();
assert isTotalSupplyGTEqSumOfVotingPower();
requireInvariant zeroAddressNoVotingPower();
requireInvariant delegatedVotingPowerLTEqTotalVotingPower();
require nonpayable(e);

address from;
Expand All @@ -113,9 +112,6 @@ rule burn(env e) {
uint256 otherBalanceBefore = balanceOf(other);
uint256 totalSupplyBefore = totalSupply();

// Safe require that follows from delegatedVotingPowerLTEqTotalVotingPower.
require fromVotingPowerBefore <= sumOfVotingPower;

// run transaction
burn@withrevert(e, amount);

Expand Down
8 changes: 2 additions & 6 deletions certora/specs/MintBurnOptimism.spec
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ rule mint(env e) {
requireInvariant totalSupplyIsSumOfBalances();
requireInvariant balancesLTEqTotalSupply();
assert isTotalSupplyGTEqSumOfVotingPower();
requireInvariant delegatedVotingPowerLTEqTotalVotingPower();
requireInvariant zeroAddressNoVotingPower();
require nonpayable(e);

Expand All @@ -71,9 +72,6 @@ rule mint(env e) {
uint256 otherBalanceBefore = balanceOf(other);
uint256 totalSupplyBefore = totalSupply();

// Safe require that follows from delegatedVotingPowerLTEqTotalVotingPower.
require toVotingPowerBefore <= sumOfVotingPower;

// run transaction
mint@withrevert(e, to, amount);

Expand All @@ -100,6 +98,7 @@ rule mint(env e) {
rule burn(env e) {
requireInvariant balancesLTEqTotalSupply();
assert isTotalSupplyGTEqSumOfVotingPower();
requireInvariant delegatedVotingPowerLTEqTotalVotingPower();
requireInvariant zeroAddressNoVotingPower();
require nonpayable(e);

Expand All @@ -114,9 +113,6 @@ rule burn(env e) {
uint256 otherBalanceBefore = balanceOf(other);
uint256 totalSupplyBefore = totalSupply();

// Safe require that follows from delegatedVotingPowerLTEqTotalVotingPower.
require fromVotingPowerBefore <= sumOfVotingPower;

// run transaction
burn@withrevert(e, from, amount);

Expand Down

0 comments on commit d648654

Please sign in to comment.