-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Adding this just as a note really, and the idea is stolen from this issue in k-dss.
We could introduce a new kind of block into act: invariant that would look something like this:
invariant K of UniswapV2Exchange
storage
reserve0_reserve1_blockTimestampLast |-> #WordPackUInt112UInt112UInt32(Reserve0, Reserve1, _) => _
totalSupply |-> TotalSupply => _
kLast |-> KLast => _
such that
(Reserve0 * Reserve1) / (TotalSupply ^ 2) == KLast
This would generate a K spec with symbolic calldata that proves that the generalized invariant holds at the end of every possible call to the contract. This proof could be made fast by implicitly reusing all the other specs (i.e. implicitly including every other spec for UniswapV2Exchange in a calls block for each invariant block).
desaperados
Metadata
Metadata
Assignees
Labels
No labels