2

I am testing ERC20 USDT contract locally with parity. I imported contract to my private testnet and manually generated raw transaction that calls "transfer" method of contract. I send it to the node using eth_sendTransaction, but it's got reverted. I want to understand the reason of it. I tried to call trace_replayTransaction rpc method, here is the result:

curl
    --data '{
        "jsonrpc":"2.0",
        "method":"trace_replayTransaction",
        "params":[
            "0x9a6df75ffa10e229b5620cb1f2079da29b7a8cbe65535bf2e8a34ed1739f1d93",
            ["stateDiff"]
        ],
        "id":1
    }'
    -H "Content-Type: application/json"
    -X POST ip:port

The result:

{
    "jsonrpc":"2.0",
    "result":{
        "output":"0x",
        "stateDiff":{
            "0x56507ba059a09b2cb64f6ec5c2aaf402184858da":{
                "balance":{
                    "*":{
                        "from":"0x42ae0",
                        "to":"0x3cf50"
                    }
                },
                "code":"=",
                "nonce":{
                    "*":{
                        "from":"0x2",
                        "to":"0x3"
                    }
                },
                "storage":{}
            },
            "0x5ed8cee6b63b1c6afce3ad7c92f4fd7e1b8fad9f":{
                "balance":{
                    "*":{
                        "from":"0x1314fb370629b3c366",
                        "to":"0x1314fb370629b41ef6"
                    }
                },
                "code":"=",
                "nonce":"=",
                "storage":{}
            }
        },
        "trace":[],
        "vmTrace":null
    },
    "id":1
}

As I can see, the output field is empty. I would be very gratefull if someone could tell me how to find out the reason for the tx reversion in parity.

EDITED:

trace_replayTransaction takes a hash of the transaction, not it's actual body. But I can also provide the exact tx too. Here it is:

{
  "jsonrpc": "2.0",
  "result": {
    "blockHash": "0x161d801c113352414c409ac35883739c41d910acefbcff52fa14e4afdf047eed",
    "blockNumber": "0xb1",
    "chainId": "0x21",
    "condition": null,
    "creates": null,
    "from": "0x56507ba059a09b2cb64f6ec5c2aaf402184858da",
    "gas": "0x13880",
    "gasPrice": "0x1",
    "hash": "0x9a6df75ffa10e229b5620cb1f2079da29b7a8cbe65535bf2e8a34ed1739f1d93",
    "input": "0xa9059cbb000000000000000000000000807e09f9b439eeb7c7b3e2cfd52fc6775f33352c00000000000000000000000000000000000000000000000000000000000000fa",
    "nonce": "0x2",
    "publicKey": "0x497104220bd7241711ca8173314894414b7d4bbd5689f8642812f2a4d55e78ec1257eeff5ed7a001115a22a1f73ac04ea974966854d79dbdb52b0875f1d14388",
    "r": "0x3999c6dfcd91c70ebeedb844585851384ddc8e259b2b059cda5cdfc7faf51dd5",
    "raw": "0xf8a50201830138809475aa3ac9799770edd6db780302fcd55e5b2cdbb201b844a9059cbb000000000000000000000000807e09f9b439eeb7c7b3e2cfd52fc6775f33352c00000000000000000000000000000000000000000000000000000000000000fa65a03999c6dfcd91c70ebeedb844585851384ddc8e259b2b059cda5cdfc7faf51dd5a0011dcf406a22c916d63f01d4359c1869524f110732b1257a708261f14383258c",
    "s": "0x11dcf406a22c916d63f01d4359c1869524f110732b1257a708261f14383258c",
    "standardV": "0x0",
    "to": "0x75aa3ac9799770edd6db780302fcd55e5b2cdbb2",
    "transactionIndex": "0x1",
    "v": "0x65",
    "value": "0x1"
  },
  "id": 1
}

The arguments of USDT transfer are in input field.

  • a9059cbb — hash of a trasnsfer method
  • 000000000000000000000000807e09f9b439eeb7c7b3e2cfd52fc6775f33352c — padded destination address
  • 00000000000000000000000000000000000000000000000000000000000000fa — padded amount that I want to transfer

Also, 0x75aa3ac9799770edd6db780302fcd55e5b2cdbb2 — addres of my local USDT contract

2
  • Please explain how exactly this raw transaction reflects a call to the transfer method of the contract, and what parameters are passed to that method (I guess that all of this is embedded in 0x9a6df75f...739f1d93, so you probably need to explain how you've calculated this value). Commented Apr 18, 2020 at 6:38
  • Hi. I updated my question.
    – Oroffe
    Commented Apr 18, 2020 at 12:35

0

Your Answer

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