Execution reverted (-32000)
This error may include "code":"-32000”
.
What it means
This RPC returns this error when the transaction has failed simulation and is expected to fail.
Common reasons include:
The transaction is sent to an invalid contract.
The transaction is calling a function that does not exist on the contract.
The transaction is calling a function with invalid arguments (e.g. wrong order or type, or missing a required argument).
The transaction uses more gas than the defined gas limit.
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.
Confirm the contract is valid by calling a simple “read” function.
Also check the following:
The chain and contract address match the contract called.
The function name and arguments being called matches the contract’s ABI.
The sender wallet has sufficient gas funds to send the transaction.
If the contract function expects native currency payment,
value
is set.If the contract function expects ERC20 payment, the sender wallet has set this contract as an approved spender for this ERC20 contract.
The sender wallet has sufficient permissions to call this function on the contract.
The gas limit is higher than the amount of gas the transaction will consume.