3

I want to know the exact effect of submitting a smart-contract call. For example, if I swap USDC to ETH on uniswap.

For transactions, we have eth_call, is there something similar for contracts? This needs to work for arbitrary complicated interactions, basically anything I can sign and submit.

I have a fully synced node, so everything can be done locally.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Danny
  • 41
  • 1
  • 3

2 Answers2

2

Ganache in-memory Ethereum testnet supports forking a mainnet.

Ganache allows you to "unlock" any Ethereum account, so you do not need to have necessary private keys to sign transactions to simulate actions.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
0

late answer but I recently had this problem and so I've developed a tool to solve it.

You can simulate Ethereum transactions on the mainnet with Pelta Shield.

This tool allows you to see the usual tx info (such as what you would see on Etherscan) before the transaction actually gets included in a block.

In fact you can even abort the simulated transactions if you don't like the result of it, and you will not pay any gas.

Note that the results of the simulation will only be accurate as long as the transaction doesn't depend too much on the live state of the Ethereum blockchain.

If the state of the blockchain changes between the simulation and the actual execution, the simulation may not accurately reflect the result of the transaction.

DISCLAIMER: I am the founder of Pelta.tech, the startup that developed Pelta Shield, so I'm definitely biased in my recommendation.