- ape_safe.cli.propose_from_simulation()
Create and propose a new SafeTx from transaction receipts inside a fork.
Usage:
@propose_from_simulation() # NOTE: Name of decorated function *must* be called `cli` # NOTE: Decorated function may have `safe` or `submitter` args in it def cli(): # This entire function is executed within a fork/isolated context # Use normal Ape features my_contract = Contract("<address>") # Any transaction is performed as if `sender=safe.address` my_contract.mutableMethod(...) # You can make assertions that will cause your simulation to fail if tripped assert my_contract.viewMethod() == ... # You can also add conditional calls if my_contract.viewMethod() < some_number: my_contract.mutableMethod() # Once you are done with your transactions, the simulation will complete after exiting # Once the simulation is complete, the decorator will collect all receipts it finds # from the `safe` and collect them into a single SafeTx to propose to a public network