# Can native assets be minted to arbitrary accounts?

**URL:** <https://forum.fuel.network/t/can-native-assets-be-minted-to-arbitrary-accounts/3108>\
**Category:** General\
**Created:** [September 22, 2023, 10:21am UTC](https://forum.fuel.network/t/can-native-assets-be-minted-to-arbitrary-accounts/3108 "2023-09-22T10:21:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prberg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/prberg/32/1612_2.png) [@prberg](https://forum.fuel.network/u/prberg)\
**Post date:** [September 22, 2023, 10:21am UTC](https://forum.fuel.network/t/can-native-assets-be-minted-to-arbitrary-accounts/3108/1 "2023-09-22T10:21:20Z")

</div>

I’ve read the [SRC-20 token standard](https://github.com/FuelLabs/sway-standards/issues/1) and the spec of the [MINT instruction](https://specs.fuel.network/master/fuel-vm/instruction-set.html?highlight=mint#mint-mint-new-coins), but it is not clear whether assets can be minted to arbitrary accounts?

By the looks of it, assets have to be minted to the current contract first, and only then can be transferred. Is my understanding correct?

---

<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:** [September 22, 2023, 10:30am UTC](https://forum.fuel.network/t/can-native-assets-be-minted-to-arbitrary-accounts/3108/2 "2023-09-22T10:30:09Z")

</div>

> [@prberg](#):
>
> assets have to be minted to the current contract first, and only then can be transferred. Is my understanding correct?

This is correct, assets are minted directly to the contract, then can be transferred out.

But that’s effectively the same thing… is there any use case where this doesn’t work for you?

---

<div class="post-metadata">

**Author:** ![prberg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/prberg/32/1612_2.png) [@prberg](https://forum.fuel.network/u/prberg)\
**Post date:** [September 26, 2023, 10:43am UTC](https://forum.fuel.network/t/can-native-assets-be-minted-to-arbitrary-accounts/3108/4 "2023-09-26T10:43:48Z")

</div>

> [@david](#):
>
> that’s effectively the same thing

Well, not strictly the same thing. If the `MINT` opcode accepted a `to` parameter, the contract could mint assets to third-party accounts directly.

Anyway, this is a smol technical detail, which only nerds like us need care about.

> [@david](#):
>
> is there any use case where this doesn’t work for you?

Nope

---

<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:** [September 26, 2023, 4:28pm UTC](https://forum.fuel.network/t/can-native-assets-be-minted-to-arbitrary-accounts/3108/5 "2023-09-26T16:28:10Z")

</div>

One reason behind this decision, is that there’s actually two opcodes for transferring assets in the FuelVM: `TR` transfers tokens to a contract (increasing the contract’s balance), and `TRO` transfers tokens to an address by adding the assets to an output UTXO.

If `MINT` directly had a “to” address, there would need to be two opcodes (`MINT` & `MINTO`). So it’s simpler to just mint directly to the minting contract.

---

<div class="post-metadata">

**Author:** ![prberg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/prberg/32/1612_2.png) [@prberg](https://forum.fuel.network/u/prberg)\
**Post date:** [September 29, 2023, 3:43pm UTC](https://forum.fuel.network/t/can-native-assets-be-minted-to-arbitrary-accounts/3108/6 "2023-09-29T15:43:58Z")

</div>

I’ve just stumbled upon the [Native Token Example](https://fuellabs.github.io/sway/v0.46.0/book/blockchain-development/native_assets.html#native-token-example) in the Sway docs, which implements the following functions:

```plaintext
impl NativeAssetToken for Contract {
    /// <---- snip ----> ///

    /// Mint and send this contracts native token to a destination contract.
    fn mint_and_send_to_contract(amount: u64, destination: ContractId) {
        mint_to_contract(destination, ZERO_B256, amount);
    }

    /// Mind and send this contracts native token to a destination address.
    fn mint_and_send_to_address(amount: u64, recipient: Address) {
        mint_to_address(recipient, ZERO_B256, amount);
    }
}

```

This in turn has led me to the [`mint_to_contract`](https://github.com/FuelLabs/sway/blob/d37f706af75b41528073860c43bd1afb7041b69a/sway-lib-std/src/token.sw#L71) function in the Sway Standard Library.

Thus, it seems to me that the problem of “how to mint and transfer in one go” is effectively solved at a level above the raw FuelVM, i.e., in the Sway Standard Library.
