ditto
ditto copied to clipboard
feat: spec for formal verification
Since our contract is small, we should be able to use formal verification to prove correctness (Certora).
Don't have much experience in this, but I can take a look.
We can explore manticore https://github.com/trailofbits/manticore https://github.com/crytic/building-secure-contracts/tree/master/program-analysis/manticore
started on manticore.
@calvbore i think before we explore these tools, it would be good to have some specs we want to test against. Few thing we should formally verify:
- Linked list manipulation is correct.
- Oracle updates are correct.
- Each ERC20 token in DittoMachine's balance can be claimed eventually, i.e., tokens are not permanently locked in the contract.
- NFT transfer to DittoMachine never locks NFT in the contract, is always sold to protoId.
- Dissolve works correctly.
We should think of how to translate them into sensible rules.