# Does the Mint/Burn receipt always happen in the context of the tokens address?

**URL:** <https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815>\
**Category:** Fuel Network\
**Created:** [June 14, 2024, 6:32pm UTC](https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815 "2024-06-14T18:32:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasoonS](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/jasoons/32/2727_2.png) [@JasoonS](https://forum.fuel.network/u/JasoonS)\
**Post date:** [June 14, 2024, 6:32pm UTC](https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815/1 "2024-06-14T18:32:25Z")

</div>

I’m looking at these docs: [Fuel Specifications | Fuel Docs](https://docs.fuel.network/docs/specs/abi/receipts/#burn-receipt) and [Fuel Specifications | Fuel Docs](https://docs.fuel.network/docs/specs/abi/receipts/#mint-receipt)

When there is a mint or a burn is the `contract_id` of the receipt always the ‘creator’ contract of that asset? IE is `sha256(contract_id, sub_id) == asset_id` always for all Mint and Burn that can be found on chain? It is impossible for mint/burn to be called from any other context?

I’d assume the answer is yes, and if not there is no way to construct the asset\_id.

I ask because I have a script that is erroring, and I’m confused what the issue could be.

---

<div class="post-metadata">

**Author:** ![JasoonS](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/jasoons/32/2727_2.png) [@JasoonS](https://forum.fuel.network/u/JasoonS)\
**Post date:** [June 14, 2024, 7:10pm UTC](https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815/2 "2024-06-14T19:10:27Z")

</div>

The issue that I’m having in a script that is analyzing all Mint/Burn on the chain using HyperFuel by Envio [the product my team is building] on Testnet.

I get stuck on the burn that happens in this transaction: [Fuel Explorer](https://app.fuel.network/tx/0x3fa1fe1519362025fe17096b681765156934634a3b2440bf5734ab1aabb983f2/simple)

I calculate that the assetId should be assetId: 0xf229c838d664dd35e9272af4dc34fe7147ed9491e8ca6c1ac9a6230fe9e23513 (since the subId is 0xcd2662154e6d76b2b2b92e70c0cac3ccf534f9b74eb5b89819ec509083d00a50 and the contract is 0x3550c53890db64a241d3cc6523d4255a9c588c4bd8503f911a39444989626626)

Hover these is no mint ever for an asset that matches this?

It is an immaculate conception of as asset - so I must be missing something.

If I skip any burns from 0x3550c53890db64a241d3cc6523d4255a9c588c4bd8503f911a39444989626626 the script runs fine and goes through the whole chain so far (and culculates the total supply of every asset based on `Mint`/`Burn`).

If I click through the ‘inputs’ to the transactions, I eventually get to transactions like this as the source of all these funds: [Fuel Explorer](https://app.fuel.network/tx/0x5ba0b176c6b72d70f1def99515d487ef49be81e157910c8814fc7fb3f19d650c/simple) from here - there are just lots of UTXOs - so maybe this is some kind of block reward thing or something that I don’t understand.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/fuel/original/2X/c/ca730ec606d497032ed30a5dfea0c56133d64026.png)  
As seen, the first utxo I follow is: “0x241203072ffc6c091a3072ae7e0073d13880b53ed5e7a97d18eb2b2d9300ecc70003”

I’ll share the script once it is a tiny bit more polished.

---

<div class="post-metadata">

**Author:** ![naz3eh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/naz3eh/32/2025_2.png) [@naz3eh](https://forum.fuel.network/u/naz3eh)\
**Post date:** [June 25, 2024, 3:04pm UTC](https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815/3 "2024-06-25T15:04:39Z")

</div>

I confirmed with my team internally and they are saying burning tokens is impossible if the contract balance of this token is zero. So, if the token was burned, it means it was minted at some point in the life of the contract.

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/david/32/32_2.png) [@david](https://forum.fuel.network/u/david)\
**Post date:** [June 25, 2024, 4:13pm UTC](https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815/4 "2024-06-25T16:13:20Z")

</div>

Hey @JasoonS, as you mentioned, it appears the UTXO being burned was minted in [0x241203072ffc6c091a3072ae7e0073d13880b53ed5e7a97d18eb2b2d9300ecc7](https://app.fuel.network/tx/0x241203072ffc6c091a3072ae7e0073d13880b53ed5e7a97d18eb2b2d9300ecc7/simple).

Is your script not indexing that transaction/output for some reason?

---

<div class="post-metadata">

**Author:** ![JasoonS](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/jasoons/32/2727_2.png) [@JasoonS](https://forum.fuel.network/u/JasoonS)\
**Post date:** [June 26, 2024, 10:40am UTC](https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815/5 "2024-06-26T10:40:44Z")

</div>

Thanks @david - you are right. It is minted in that transaction!

Sorry for the query. It indeed is some kind of bug in the indexer where it is getting the receipts out of order. I’m really grateful for the help in confirming that there is an issue in our API with this case.

Here is the script btw: [GitHub - enviodev/example-fuel-assets-script: An example script that gets information about all assets on Fuel Testnet](https://github.com/enviodev/example-fuel-assets-script)

And this is a commit that shows there is an ordering issue: [Show the buggy transactions · enviodev/example-fuel-assets-script@9a40934 · GitHub](https://github.com/enviodev/example-fuel-assets-script/commit/9a40934e0c0c679d77037ad6dc4c1dc63cc3b9fd)

---

<div class="post-metadata">

**Author:** ![david](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/david/32/32_2.png) [@david](https://forum.fuel.network/u/david)\
**Post date:** [June 26, 2024, 12:57pm UTC](https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815/6 "2024-06-26T12:57:34Z")

</div>

Glad we were able to get it sorted!

---

<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:** [July 17, 2024, 8:58am UTC](https://forum.fuel.network/t/does-the-mint-burn-receipt-always-happen-in-the-context-of-the-tokens-address/5815/7 "2024-07-17T08:58:06Z")

</div>

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