2

Let's assume a contract has some state and functions which will alter that state. How could I check what the state of the contract will be after I execute a function before making the transaction? (Assume nobody else is affecting the state of the contract)

1 Answer 1

2

I am assuming you ask how to simulate a transaction off-chain. For this you have a couple tools. If you want the all in one hosted solution I would suggest you to look into https://tenderly.co/. If you have some programming knowledge you can also use Ganache to spin up a local for of a network and simulate your transaction. This will then allow you to inspect the state afterward. This can also be done with hardhat or Brownie.

An example how Ganache can be used for transaction simulation can be found here: https://github.com/rmeissner/safe-simulator-gh-action/blob/main/src/simulator.ts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.