This PR provides a way for generating K claims about PyTeal contracts without writing K directly. Perhaps some K will need to be written using pyk combinators, but that should be possible to avoid too, eventually.
The workflow looks like this:
initialize all actors (contract creator, etc.) and the contract for simulation. This step is done completely with py-algroand-sdk
execute the transactions to "deploy" the contract, i.e. bring the system to a desired "live" state for verification. This only involves concrete execution and can be done with both KAVM and algod, using the same code
Create symbolic variables for all entities that need to be symbolic: balances, state variables etc. Specify any relevant preconditions.
Edit the objects obtained at step 2 by intriducing the variables created at step 3.
Initialize a KAVMProof object with the edited py-algorand-sdk objects that now contain symbolic variables
The initialized KAVMProof object will generate a mapping from the initial state variables (defined in step 3) to the existential variables in the eventual final state. Use this mapping to formulate the postconditions: what would you like the final state of the variables to look like?
This PR provides a way for generating K claims about PyTeal contracts without writing K directly. Perhaps some K will need to be written using
pyk
combinators, but that should be possible to avoid too, eventually.The workflow looks like this:
KAVMProof
object with the edited py-algorand-sdk objects that now contain symbolic variablesKAVMProof
object will generate a mapping from the initial state variables (defined in step 3) to the existential variables in the eventual final state. Use this mapping to formulate the postconditions: what would you like the final state of the variables to look like?See ./kavm/src/tests/algod_integration/contracts/kcoin_vault/test_specs.py for a complete and relatively well-documented example.