Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove reference to increaseAllowance #9

Merged
merged 2 commits into from
Feb 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
remove reference to increaseAllowance
  • Loading branch information
urikirsh committed Feb 2, 2024
commit 8ccbfbc05aadeb43459330090121b2b1b760dcf1
8 changes: 2 additions & 6 deletions certora/spec/ERC20.spec
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,12 @@ rule onlyHolderCanChangeAllowance {
mathint allowance_before = allowance(holder, spender);

method f; env e; calldataarg args; // was: env e; uint256 amount;
f(e, args); // was: approve(e, spender, amount);
approve(e, spender, amount);

mathint allowance_after = allowance(holder, spender);

assert allowance_after > allowance_before => e.msg.sender == holder,
"approve must only change the sender's allowance";

assert allowance_after > allowance_before =>
(f.selector == sig:approve(address,uint).selector || f.selector == sig:increaseAllowance(address,uint).selector),
"only approve and increaseAllowance can increase allowances";
"only the holder can increase their allowance";
}

//// ## Part 3: invariants /////////////////////////////////////////////////////
Expand Down
Loading