You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
Perhaps we could even just directly append the ensures statements to the existing specs without even having to create a new spec specifically for the invariants
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: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 forUniswapV2Exchange
in acalls
block for eachinvariant
block).The text was updated successfully, but these errors were encountered: