-
Notifications
You must be signed in to change notification settings - Fork 10
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
chore(certora): add invariant that totalSent is <= totalReceived #147
Conversation
@@ -72,6 +72,22 @@ invariant totalSupplyIsSumOfBalances() | |||
invariant requestStartedWhenSlotsFilled(env e, Marketplace.RequestId requestId, Marketplace.SlotId slotId) | |||
to_mathint(currentContract.requestContext(e, requestId).slotsFilled) == to_mathint(currentContract.getRequest(e, requestId).ask.slots) => currentContract.requestState(e, requestId) == Marketplace.RequestState.Started; | |||
|
|||
// STATUS - in progress (fails on constructor state due to a strange behaviour in the tool) | |||
// _marketplaceTotals.received - _marketplaceTotals.sent == tokenBalanceOfContract | |||
// https://prover.certora.com/output/3106/4e6cac8055ac45bb92840e14d9b095eb/?anonymousKey=655a42ca6306a023db78914d5a188d8ec2882771 |
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.
As pointed out here, there's a bug in the prover that causes this invariant to file after the constructor has been called.
I'd leave this pending until the bug in certora has been fixed.
02dfe5c
to
b41c3a1
Compare
19379eb
to
02b9c1f
Compare
While this is green on CI, it should actually fail because there's a bug in the prover that will find a counter example on one of the rules. We need to change the GH action in this repo so it has a proper exit code or something. |
02b9c1f
to
d6555cc
Compare
d6555cc
to
018ed25
Compare
This commit adds an invariant that verifies `marketplaceTotals.sent <= marketplceTotals.received`. The invariant relies on the `Token.totalSupply()` which has previously been verified to be the sum of all balances. The invariant uses `<=` as there could be donations sent to the marketplace. Closes #132
018ed25
to
b413d77
Compare
As per #132 (comment) we won't merge this. |
This commit adds an invariant that verifies
marketplaceTotals.sent <= marketplceTotals.received
.The invariant relies on the
Token.totalSupply()
which has previously been verified to be the sum of all balances.The invariant uses
<=
as there could be donations sent to the marketplace.Closes #132
This PR depends on #146