The spec is split up in different files to make sure we can efficiently run all checks:
account-state.spec
: focus only on theFullMarginEngine
's account storage structure. (State transitioning)engine-grappa.spec
: link Grappa with the full engine contract, focus on higher level properties.
Running the script
Make sure solc
is a installed command on your terminal, with solc --version
equals 0.8.18.
./certora/verify-account-state.sh
./certora/verify-engine.sh
- asset balance can only decrease with
execute
function orGrappa.settle
- 1. sum of all Grappa.getPayout() <= total asset
- 2. get min collateral <= account.collateral for all accounts
- 3. transferAccount doesn't affect the total collateral requirement
- 4. cannot mint call or put with no collateral (no rounding error)
- 5. a vault always has more collateral than the total payout the token it mints worth.
These can be found in account-state.spec
- 1. if account.shortAmount != 0, account.tokenId must not be 0. (no hanging debt with no ID)
- 2. if account.collateralAmount != 0, collateralId must not be 0. (no hanging collateral)
- 3. if account.collateral != 0 && account.short != 0 => collateral id in account.collateralId must match the one derived from token