Is it possible to predict from ethers.js that a transaction will fail/revert ? I've noticed many times Remix pops up a warning when the transaction will fail and wondering how to protect my ethers.js script from submitting transactions that will fail

Nov 4, 2021, 12:55 PM
You can use the estimateGas functionality. Or simply change the transaction into a static call
Nov 4, 2021, 1:26 PM
interesting thanks, with the estimateGas approach would the function returning maximum gas cost be the indication that the transaction will likely fail ?
Nov 4, 2021, 2:42 PM
No you get exception I believe
Nov 4, 2021, 3:02 PM
perfect, thanks !
Nov 4, 2021, 3:03 PM

© 2024 Draquery.com All rights reserved.