0

This is the json-rpc call I make

{
  "jsonrpc": "2.0", 
  "method": "eth_estimateGas", 
  "params": [
   {
    "from": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F", 
    "to": "0xdac17f958d2ee523a2206206994597c13d831ec7", //USDT
    "data": "0xa9059cbb00000000000000000000000044C004Fbbb407a45ea731AbE01E0CE348f311b9f000000000000000000000000000003e8" 
   }
  ],
  "id": "1"
}

but I keep on getting this error

{ 
  "jsonrpc": "2.0", 
  "id": "1", 
  "error": {
     "code": "-32000", 
     "message": "execution reverted"
  }
}

The from address has enough USDT (around 10k USDT) and the value of the tx is 1000 USDT.

1 Answer 1

0

You didn't encode the data correctly in the value params. It must be uint256.

So the correct payload should use this data string:

"data": "0xa9059cbb00000000000000000000000044c004fbbb407a45ea731abe01e0ce348f311b9f00000000000000000000000000000000000000000000000000000000000003e8"

Debugging Tips:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.