# Transaction Reverted but Assets Not Returned

**URL:** <https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874>\
**Category:** General\
**Created:** [October 20, 2024, 10:37pm UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874 "2024-10-20T22:37:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shikimi](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Shikimi](https://forum.fuel.network/u/Shikimi)\
**Post date:** [October 20, 2024, 10:37pm UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/1 "2024-10-20T22:37:45Z")

</div>

When I called a script on the mainnet, the transaction failed and was reverted. However, the input UTXO has not been returned and disappeared from my wallet.  
My understanding is that when a transaction is reverted, everything should return to the state prior to the execution except for gas fees.  
Why is this happening, and is there a way to recover my assets?

---

<div class="post-metadata">

**Author:** ![rishabhkeshan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/rishabhkeshan/32/3346_2.png) [@rishabhkeshan](https://forum.fuel.network/u/rishabhkeshan)\
**Post date:** [October 21, 2024, 9:17am UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/3 "2024-10-21T09:17:45Z")

</div>

Hey @Shikimi let me know if the [thread](https://forum.fuel.network/t/successful-transaction-marked-as-failed/6614/8) is helpful for you.

---

<div class="post-metadata">

**Author:** ![Shikimi](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Shikimi](https://forum.fuel.network/u/Shikimi)\
**Post date:** [October 21, 2024, 11:42am UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/4 "2024-10-21T11:42:21Z")

</div>

@rishabhkeshan  
Thank you for your reply and the reference link.  
I understand that, unlike EVM, reverting a transaction does not necessarily mean returning to the pre-execution state, though I still feel it is not intuitive behavior.  
In my case, it seems that not specifying Output Change was the root cause.  
Does this mean that the input assets were burned and lost forever?  
The lost amount is not small, and I hope there is a way to recover them  
[Fuel Explorer](https://app.fuel.network/tx/0x505a36051a4365304182bddcf1575d0bb7476bd481c49fd42dc3b27b570430cb/simple)

---

<div class="post-metadata">

**Author:** ![rishabhkeshan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/rishabhkeshan/32/3346_2.png) [@rishabhkeshan](https://forum.fuel.network/u/rishabhkeshan)\
**Post date:** [October 22, 2024, 10:49am UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/5 "2024-10-22T10:49:00Z")

</div>

Hey @Shikimi just to understand more on this, did this happen while interacting with Mira dapp or were you executing your own scripts?

---

<div class="post-metadata">

**Author:** ![Shikimi](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Shikimi](https://forum.fuel.network/u/Shikimi)\
**Post date:** [October 22, 2024, 12:12pm UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/6 "2024-10-22T12:12:38Z")

</div>

@rishabhkeshan  
I executed a script via Rust SDK. The script itself was cloned from Mira’s official repository ([github](https://github.com/mira-amm/mira-v1-periphery/blob/main/scripts/swap_exact_input_script/src/main.sw)). Transaction failed since I had missing contract\_id, and another mistake was missing output changes for ezETH.

---

<div class="post-metadata">

**Author:** ![Shikimi](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Shikimi](https://forum.fuel.network/u/Shikimi)\
**Post date:** [October 25, 2024, 1:54am UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/7 "2024-10-25T01:54:07Z")

</div>

@rishabhkeshan  
Any update on this?  
What I would like to know is:

- Have my coins been burned and lost, or are they still somewhere in limbo?  
The loss of 16 ezETH is not a negligible amount.
- Why is it possible to execute a transaction that results in the complete loss of InputCoin without any safeguard? If an unused coin disappears when there is no OutputChange corresponding to the InputCoin, then OutputChange should be a requirement and validated before execution.

The contract was correct, and the script was also legitimate. I lost all my coins just because I misconfigured one parameter. In other blockchains, misconfigured parameter simply results in a transaction failure, it would not cost more than gas fees.  
I attempted to swap just 0.1 ezETH, but I ended up losing 16 ezETH. It’s hard to accept.

---

<div class="post-metadata">

**Author:** ![Shikimi](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Shikimi](https://forum.fuel.network/u/Shikimi)\
**Post date:** [November 1, 2024, 7:18am UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/8 "2024-11-01T07:18:29Z")

</div>

ANY UPDATES?  
It seems like only phishing scammers are looking at this thread.

---

<div class="post-metadata">

**Author:** ![Rubyto](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/rubyto/32/2700_2.png) [@Rubyto](https://forum.fuel.network/u/Rubyto)\
**Post date:** [November 2, 2024, 6:29pm UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/9 "2024-11-02T18:29:04Z")

</div>

Hey sir,  
we’re looking into it internally and will get back to you asap @Shikimi

---

<div class="post-metadata">

**Author:** ![Rubyto](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/rubyto/32/2700_2.png) [@Rubyto](https://forum.fuel.network/u/Rubyto)\
**Post date:** [November 4, 2024, 7:17pm UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/10 "2024-11-04T19:17:48Z")

</div>

Hey @Shikimi ,

Thanks for your patience.

After reviewing the transaction, it appears the ezETH was lost because a change output wasn’t specified in your custom transaction code. Without this, any unused funds in the transaction were burned automatically, meaning they’re unfortunately permanently lost and can’t be recovered on-chain.

Here’s a quick breakdown of what happened:

- Custom Code Execution: While you used Mira’s script, it was run through a custom Rust code rather than Mira’s pre-built version. Since a change output wasn’t included in your script, any unspent tokens in the transaction were burned. This is a potential risk when working with custom logic on mainnet.

- Change Output Handling: The Rust SDK typically handles change outputs for standard transactions. However, for fully custom transactions where inputs and outputs are set manually like this one, it’s necessary to add a change output or use a helper like `adjust_for_fee` to ensure any remaining funds are returned.

In the future, test your logics on Testnet first or with smaller amounts first to help avoid similar issues.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/5/57d5a345cc15a64b636e0d56e042857f8a0e80b1.png) [@system](https://forum.fuel.network/u/system)\
**Post date:** [November 25, 2024, 3:18pm UTC](https://forum.fuel.network/t/transaction-reverted-but-assets-not-returned/6874/11 "2024-11-25T15:18:28Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
