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

[Certora] Check supply followed by withdraw is not profitable #345

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

jhoenicke
Copy link
Contributor

... and vice versa.

@QGarchery QGarchery added the verif Modifies the formal verification label Aug 17, 2023
Copy link
Contributor

@QGarchery QGarchery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome ! This is a very nice property to have. Next we can try to do the same thing for borrow and repay

assert suppliedAssets * (getVirtualTotalSupplyShares(id) - suppliedShares) >= suppliedShares * (getVirtualTotalSupply(id) - suppliedAssets);
assert suppliedAssets * getVirtualTotalSupplyShares(id) >= suppliedShares * getVirtualTotalSupply(id);

withdrawnAssets, withdrawnShares = withdraw(e2, market, 0, suppliedShares, onbehalf, receiver);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we may want to also verify that property by letting the user choose the amount to withdraw. This seems out of reach for now because of the heavy math involved in these rules, making the prover timeout

@QGarchery QGarchery merged commit edec6b4 into certora/dev Aug 17, 2023
10 checks passed
@QGarchery QGarchery deleted the certora/roundtrip branch August 17, 2023 12:07
This was referenced Aug 17, 2023
@QGarchery QGarchery mentioned this pull request Nov 24, 2023
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verif Modifies the formal verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants