-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Certora] If calls succeed state changes #229
base: main
Are you sure you want to change the base?
Conversation
1648ac9
to
1a21f46
Compare
For reference, comments of interest made on #227. |
Co-authored-by: MathisGD <[email protected]> Signed-off-by: Colin | Morpho 🦋 <[email protected]>
"Address": "solc-0.8.28", | ||
"Permit2Lib": "solc-0.8.28", | ||
"AllowanceTransfer": "solc-0.8.17", | ||
"WETH9": "solc-0.5.15" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it compiled with version 0.4.19 ? See here
"lib/morpho-blue/src/Morpho.sol", | ||
"lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol", | ||
"lib/permit2/src/libraries/Permit2Lib.sol", | ||
"lib/permit2/src/AllowanceTransfer.sol", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use the Permit2 contract directly (which inherits from AllowanceTransfer). I know it's not necessary, but AllowanceTransfer is not really well-known compared to Permit2
assert (receiver == Bundler3.initiator() && token.allowance(e, Bundler3.initiator(), currentContract) == max_uint256 => storageBefore == lastStorage) && | ||
(storageBefore == lastStorage => receiver == Bundler3.initiator() && token.allowance(e, Bundler3.initiator(), currentContract) == max_uint256); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(optional) could apply to other places where equivalence is rewritten as well
assert (receiver == Bundler3.initiator() && token.allowance(e, Bundler3.initiator(), currentContract) == max_uint256 => storageBefore == lastStorage) && | |
(storageBefore == lastStorage => receiver == Bundler3.initiator() && token.allowance(e, Bundler3.initiator(), currentContract) == max_uint256); | |
bool noChangeExpectedCondition = receiver == Bundler3.initiator() && token.allowance(e, Bundler3.initiator(), currentContract) == max_uint256 ; | |
assert (noChangeExpectedCondition => storageBefore == lastStorage) && | |
(storageBefore == lastStorage => noChangeExpectedCondition); |
This PR replaces #227.
We verify, up to some exceptions, that whenever an adapter function is called the states changes or the execution reverts.
We try to this in most general fashion, using a parametric rule.
Before accepting this PR please check that: