Cannot estimate gas; transaction may fail or may require manual gas limit
This error may include "code":"UNPREDICTABLE_GAS_LIMIT”
.
What it means
There was an error simulating the transaction in order to estimate the gas. This indicates the transaction is expected to fail (”revert”) onchain and was rejected by the RPC. No gas is consumed.
How to fix it
Simulate your transaction with the thirdweb Transaction Simulator or the simulateTransaction SDK method to get the error returned by the contract logic, if any.
See the Execution reverted article for more troubleshooting steps.