If a transaction is marked "failed" on TRONSCAN, the funds to be transferred will not be deducted but will remain in the sender's wallet address. However, the transaction fee will still be charged as the irreversible transaction has been recorded on the blockchain. A "failed" transaction may be caused by the following reasons:
- Out of Energy
If a transaction fails because it is "out of Energy", the reason may be as follows:
- The fee_limit set by the sender for this contract transaction is too low to cover the caller's required Energy. fee_limit is a transaction-level Energy budget expressed in SUN (1 TRX = 1,000,000 SUN); it also limits usable Energy when the account already has staked or delegated Energy, and it does not cover Bandwidth or other fees.
- The sender's available Energy and the TRX balance available to pay for an Energy shortfall are insufficient. Check the transaction's fee_limit, available Energy, and available TRX balance together. The interface for setting fee_limit depends on the wallet or application used.
- Transaction Revert
If a transaction fails because of "transaction revert", the transaction is not executed. Transaction reversion is typically caused by an error in the contract's code. Please contact the deployer of the contract for further assistance.
- Timeout for Contract Execution
If a transaction fails because of "timeout for contract execution", it is likely that the execution time exceeded 80ms or the SR node performance fluctuated due to an overly complex contract. To avoid this, here are some recommendations for contract developers:
- The functionality of a smart contract should be as simple as possible. Try to avoid long loops in the contract
- Timeout will result in a full Fee_limit penalty. Setting a low Fee_limit can cut the losses
- Invalid Transaction
If a transaction fails because it is "invalid", it is likely that an error has occurred in the contract execution. Please contact the deployer of the contract for further assistance.