tronprotocol / tronweb

Javascript API Library for interacting with the TRON Network
MIT License
423 stars 271 forks source link

Decode Message in CONTRACT_VALIDATE_ERROR #538

Closed rtomas closed 2 months ago

rtomas commented 2 months ago

I'm having this error while sending a sign transaction with await tronWeb.trx.sendRawTransaction(tx);

{
    "code": "CONTRACT_VALIDATE_ERROR",
    "txid": "0e74c7d5e48e09f2e05c856e6b2973b39e37547976c03de5ce9d46368fc417ef",
    "message": "436f6e74726163742076616c6964617465206572726f72203a20617373657442616c616e6365206d7573742067726561746572207468616e20302e"
}

This is the deailt from the error documentation:

CONTRACT_VALIDATE_ERROR | Transaction (system contract) verification failed | Any parameter error may cause this error, need to parse the error message to view the details. Common error messages are shown in the table below.

Question

How can I understand the error message or know the real issue with my transaction ?

ferdinand026 commented 2 months ago

@rtomas Convert the message from hex format to string, then you will get the detailed error information. https://codebeautify.org/hex-string-converter