0

I come up with this solution with gas estimation. Could someone help check whether it is feasible?

If we want to send a transaction, first, we just fork the newest mainnet blockchain using ganache-cli fork. Then we send the transaction to local forked chain with intended input, and we can get the gasUsed after this transaction succeeds.

Is this gasUsed the same as the cost for trans sent to mainnet?

The link below found they are different. But do someone know why this happens? Or what the difference between forked mainnet with actual mainnet?

Blockquote

2
  • Yeah, ganache gas estimate is currently slightly lower than mainnet's. AFAIK it's because the cost of a single load (read) operation of a state variable has increased from 200 gas to 800 gas in the recent fork on mainnet (constantinople). But if I remember correctly, then even after ganache core is updated to the latest fork, there are still some inherited differences. – goodvibration Apr 13 '20 at 13:17
  • Very appreciate for your immediate reply. The "ganache gas estimate" you referred is the gasUsed for transaction run in ganache (forked mainnet)? Could you detail the difference or give me some hint to find the deep insight for the differences? – chunmiao Apr 13 '20 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.