
<a name="iota_coin"></a>

# Module `iota::coin`

Defines the <code><a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a></code> type - platform wide representation of fungible
tokens and coins. <code><a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a></code> can be described as a secure wrapper around
<code>Balance</code> type.


-  [Struct `Coin`](#iota_coin_Coin)
-  [Struct `CoinMetadata`](#iota_coin_CoinMetadata)
-  [Struct `RegulatedCoinMetadata`](#iota_coin_RegulatedCoinMetadata)
-  [Struct `TreasuryCap`](#iota_coin_TreasuryCap)
-  [Struct `DenyCapV1`](#iota_coin_DenyCapV1)
-  [Constants](#@Constants_0)
-  [Function `total_supply`](#iota_coin_total_supply)
-  [Function `treasury_into_supply`](#iota_coin_treasury_into_supply)
-  [Function `supply_immut`](#iota_coin_supply_immut)
-  [Function `supply_mut`](#iota_coin_supply_mut)
-  [Function `value`](#iota_coin_value)
-  [Function `balance`](#iota_coin_balance)
-  [Function `balance_mut`](#iota_coin_balance_mut)
-  [Function `from_balance`](#iota_coin_from_balance)
-  [Function `into_balance`](#iota_coin_into_balance)
-  [Function `take`](#iota_coin_take)
-  [Function `put`](#iota_coin_put)
-  [Function `join`](#iota_coin_join)
-  [Function `split`](#iota_coin_split)
-  [Function `divide_into_n`](#iota_coin_divide_into_n)
-  [Function `zero`](#iota_coin_zero)
-  [Function `destroy_zero`](#iota_coin_destroy_zero)
-  [Function `create_currency`](#iota_coin_create_currency)
-  [Function `create_regulated_currency_v1`](#iota_coin_create_regulated_currency_v1)
-  [Function `mint`](#iota_coin_mint)
-  [Function `mint_balance`](#iota_coin_mint_balance)
-  [Function `burn`](#iota_coin_burn)
-  [Function `deny_list_v1_add`](#iota_coin_deny_list_v1_add)
-  [Function `deny_list_v1_remove`](#iota_coin_deny_list_v1_remove)
-  [Function `deny_list_v1_contains_current_epoch`](#iota_coin_deny_list_v1_contains_current_epoch)
-  [Function `deny_list_v1_contains_next_epoch`](#iota_coin_deny_list_v1_contains_next_epoch)
-  [Function `deny_list_v1_enable_global_pause`](#iota_coin_deny_list_v1_enable_global_pause)
-  [Function `deny_list_v1_disable_global_pause`](#iota_coin_deny_list_v1_disable_global_pause)
-  [Function `deny_list_v1_is_global_pause_enabled_current_epoch`](#iota_coin_deny_list_v1_is_global_pause_enabled_current_epoch)
-  [Function `deny_list_v1_is_global_pause_enabled_next_epoch`](#iota_coin_deny_list_v1_is_global_pause_enabled_next_epoch)
-  [Function `mint_and_transfer`](#iota_coin_mint_and_transfer)
-  [Function `update_name`](#iota_coin_update_name)
-  [Function `update_symbol`](#iota_coin_update_symbol)
-  [Function `update_description`](#iota_coin_update_description)
-  [Function `update_icon_url`](#iota_coin_update_icon_url)
-  [Function `get_decimals`](#iota_coin_get_decimals)
-  [Function `get_name`](#iota_coin_get_name)
-  [Function `get_symbol`](#iota_coin_get_symbol)
-  [Function `get_description`](#iota_coin_get_description)
-  [Function `get_icon_url`](#iota_coin_get_icon_url)


<pre><code><b>use</b> <a href="../../dependencies/iota/address.md#iota_address">iota::address</a>;
<b>use</b> <a href="../../dependencies/iota/bag.md#iota_bag">iota::bag</a>;
<b>use</b> <a href="../../dependencies/iota/balance.md#iota_balance">iota::balance</a>;
<b>use</b> <a href="../../dependencies/iota/config.md#iota_config">iota::config</a>;
<b>use</b> <a href="../../dependencies/iota/deny_list.md#iota_deny_list">iota::deny_list</a>;
<b>use</b> <a href="../../dependencies/iota/dynamic_field.md#iota_dynamic_field">iota::dynamic_field</a>;
<b>use</b> <a href="../../dependencies/iota/dynamic_object_field.md#iota_dynamic_object_field">iota::dynamic_object_field</a>;
<b>use</b> <a href="../../dependencies/iota/event.md#iota_event">iota::event</a>;
<b>use</b> <a href="../../dependencies/iota/hex.md#iota_hex">iota::hex</a>;
<b>use</b> <a href="../../dependencies/iota/object.md#iota_object">iota::object</a>;
<b>use</b> <a href="../../dependencies/iota/transfer.md#iota_transfer">iota::transfer</a>;
<b>use</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context">iota::tx_context</a>;
<b>use</b> <a href="../../dependencies/iota/types.md#iota_types">iota::types</a>;
<b>use</b> <a href="../../dependencies/iota/url.md#iota_url">iota::url</a>;
<b>use</b> <a href="../../dependencies/std/address.md#std_address">std::address</a>;
<b>use</b> <a href="../../dependencies/std/ascii.md#std_ascii">std::ascii</a>;
<b>use</b> <a href="../../dependencies/std/bcs.md#std_bcs">std::bcs</a>;
<b>use</b> <a href="../../dependencies/std/option.md#std_option">std::option</a>;
<b>use</b> <a href="../../dependencies/std/string.md#std_string">std::string</a>;
<b>use</b> <a href="../../dependencies/std/type_name.md#std_type_name">std::type_name</a>;
<b>use</b> <a href="../../dependencies/std/vector.md#std_vector">std::vector</a>;
</code></pre>



<a name="iota_coin_Coin"></a>

## Struct `Coin`

A coin of type <code>T</code> worth <code><a href="../../dependencies/iota/coin.md#iota_coin_value">value</a></code>. Transferable and storable


<pre><code><b>public</b> <b>struct</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;<b>phantom</b> T&gt; <b>has</b> key, store
</code></pre>



<details>
<summary>Fields</summary>


<dl>
<dt>
<code>id: <a href="../../dependencies/iota/object.md#iota_object_UID">iota::object::UID</a></code>
</dt>
<dd>
</dd>
<dt>
<code><a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: <a href="../../dependencies/iota/balance.md#iota_balance_Balance">iota::balance::Balance</a>&lt;T&gt;</code>
</dt>
<dd>
</dd>
</dl>


</details>

<a name="iota_coin_CoinMetadata"></a>

## Struct `CoinMetadata`

Each Coin type T created through <code><a href="../../dependencies/iota/coin.md#iota_coin_create_currency">create_currency</a></code> function will have a
unique instance of CoinMetadata<T> that stores the metadata for this coin type.


<pre><code><b>public</b> <b>struct</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;<b>phantom</b> T&gt; <b>has</b> key, store
</code></pre>



<details>
<summary>Fields</summary>


<dl>
<dt>
<code>id: <a href="../../dependencies/iota/object.md#iota_object_UID">iota::object::UID</a></code>
</dt>
<dd>
</dd>
<dt>
<code>decimals: u8</code>
</dt>
<dd>
 Number of decimal places the coin uses.
 A coin with <code><a href="../../dependencies/iota/coin.md#iota_coin_value">value</a> </code> N and <code>decimals</code> D should be shown as N / 10^D
 E.g., a coin with <code><a href="../../dependencies/iota/coin.md#iota_coin_value">value</a></code> 7002 and decimals 3 should be displayed as 7.002
 This is metadata for display usage only.
</dd>
<dt>
<code>name: <a href="../../dependencies/std/string.md#std_string_String">std::string::String</a></code>
</dt>
<dd>
 Name for the token
</dd>
<dt>
<code>symbol: <a href="../../dependencies/std/ascii.md#std_ascii_String">std::ascii::String</a></code>
</dt>
<dd>
 Symbol for the token
</dd>
<dt>
<code>description: <a href="../../dependencies/std/string.md#std_string_String">std::string::String</a></code>
</dt>
<dd>
 Description of the token
</dd>
<dt>
<code>icon_url: <a href="../../dependencies/std/option.md#std_option_Option">std::option::Option</a>&lt;<a href="../../dependencies/iota/url.md#iota_url_Url">iota::url::Url</a>&gt;</code>
</dt>
<dd>
 URL for the token logo
</dd>
</dl>


</details>

<a name="iota_coin_RegulatedCoinMetadata"></a>

## Struct `RegulatedCoinMetadata`

Similar to CoinMetadata, but created only for regulated coins that use the DenyList.
This object is always immutable.


<pre><code><b>public</b> <b>struct</b> <a href="../../dependencies/iota/coin.md#iota_coin_RegulatedCoinMetadata">RegulatedCoinMetadata</a>&lt;<b>phantom</b> T&gt; <b>has</b> key
</code></pre>



<details>
<summary>Fields</summary>


<dl>
<dt>
<code>id: <a href="../../dependencies/iota/object.md#iota_object_UID">iota::object::UID</a></code>
</dt>
<dd>
</dd>
<dt>
<code>coin_metadata_object: <a href="../../dependencies/iota/object.md#iota_object_ID">iota::object::ID</a></code>
</dt>
<dd>
 The ID of the coin's CoinMetadata object.
</dd>
<dt>
<code>deny_cap_object: <a href="../../dependencies/iota/object.md#iota_object_ID">iota::object::ID</a></code>
</dt>
<dd>
 The ID of the coin's DenyCap object.
</dd>
</dl>


</details>

<a name="iota_coin_TreasuryCap"></a>

## Struct `TreasuryCap`

Capability allowing the bearer to mint and burn
coins of type <code>T</code>. Transferable


<pre><code><b>public</b> <b>struct</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;<b>phantom</b> T&gt; <b>has</b> key, store
</code></pre>



<details>
<summary>Fields</summary>


<dl>
<dt>
<code>id: <a href="../../dependencies/iota/object.md#iota_object_UID">iota::object::UID</a></code>
</dt>
<dd>
</dd>
<dt>
<code><a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>: <a href="../../dependencies/iota/balance.md#iota_balance_Supply">iota::balance::Supply</a>&lt;T&gt;</code>
</dt>
<dd>
</dd>
</dl>


</details>

<a name="iota_coin_DenyCapV1"></a>

## Struct `DenyCapV1`

Capability allowing the bearer to deny addresses from using the currency's coins--
immediately preventing those addresses from interacting with the coin as an input to a
transaction and at the start of the next preventing them from receiving the coin.
If <code>allow_global_pause</code> is true, the bearer can enable a global pause that behaves as if
all addresses were added to the deny list.


<pre><code><b>public</b> <b>struct</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">DenyCapV1</a>&lt;<b>phantom</b> T&gt; <b>has</b> key, store
</code></pre>



<details>
<summary>Fields</summary>


<dl>
<dt>
<code>id: <a href="../../dependencies/iota/object.md#iota_object_UID">iota::object::UID</a></code>
</dt>
<dd>
</dd>
<dt>
<code>allow_global_pause: bool</code>
</dt>
<dd>
</dd>
</dl>


</details>

<a name="@Constants_0"></a>

## Constants


<a name="iota_coin_EBadWitness"></a>

A type passed to create_supply is not a one-time witness.


<pre><code><b>const</b> <a href="../../dependencies/iota/coin.md#iota_coin_EBadWitness">EBadWitness</a>: u64 = 0;
</code></pre>



<a name="iota_coin_EInvalidArg"></a>

Invalid arguments are passed to a function.


<pre><code><b>const</b> <a href="../../dependencies/iota/coin.md#iota_coin_EInvalidArg">EInvalidArg</a>: u64 = 1;
</code></pre>



<a name="iota_coin_ENotEnough"></a>

Trying to split a coin more times than its balance allows.


<pre><code><b>const</b> <a href="../../dependencies/iota/coin.md#iota_coin_ENotEnough">ENotEnough</a>: u64 = 2;
</code></pre>



<a name="iota_coin_EGlobalPauseNotAllowed"></a>



<pre><code><b>const</b> <a href="../../dependencies/iota/coin.md#iota_coin_EGlobalPauseNotAllowed">EGlobalPauseNotAllowed</a>: u64 = 3;
</code></pre>



<a name="iota_coin_DENY_LIST_COIN_INDEX"></a>

The index into the deny list vector for the <code><a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a></code> type.


<pre><code><b>const</b> <a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>: u64 = 0;
</code></pre>



<a name="iota_coin_total_supply"></a>

## Function `total_supply`

Return the total number of <code>T</code>'s in circulation.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>&lt;T&gt;(cap: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;): u64
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>&lt;T&gt;(cap: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;): u64 {
    balance::supply_value(&cap.<a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>)
}
</code></pre>



</details>

<a name="iota_coin_treasury_into_supply"></a>

## Function `treasury_into_supply`

Unwrap <code><a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a></code> getting the <code>Supply</code>.

Operation is irreversible. Supply cannot be converted into a <code><a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a></code> due
to different security guarantees (TreasuryCap can be created only once for a type)


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_treasury_into_supply">treasury_into_supply</a>&lt;T&gt;(treasury: <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;): <a href="../../dependencies/iota/balance.md#iota_balance_Supply">iota::balance::Supply</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_treasury_into_supply">treasury_into_supply</a>&lt;T&gt;(treasury: <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;): Supply&lt;T&gt; {
    <b>let</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a> { id, <a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a> } = treasury;
    id.delete();
    <a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>
}
</code></pre>



</details>

<a name="iota_coin_supply_immut"></a>

## Function `supply_immut`

Get immutable reference to the treasury's <code>Supply</code>.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_supply_immut">supply_immut</a>&lt;T&gt;(treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;): &<a href="../../dependencies/iota/balance.md#iota_balance_Supply">iota::balance::Supply</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_supply_immut">supply_immut</a>&lt;T&gt;(treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;): &Supply&lt;T&gt; {
    &treasury.<a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>
}
</code></pre>



</details>

<a name="iota_coin_supply_mut"></a>

## Function `supply_mut`

Get mutable reference to the treasury's <code>Supply</code>.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_supply_mut">supply_mut</a>&lt;T&gt;(treasury: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;): &<b>mut</b> <a href="../../dependencies/iota/balance.md#iota_balance_Supply">iota::balance::Supply</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_supply_mut">supply_mut</a>&lt;T&gt;(treasury: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;): &<b>mut</b> Supply&lt;T&gt; {
    &<b>mut</b> treasury.<a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>
}
</code></pre>



</details>

<a name="iota_coin_value"></a>

## Function `value`

Public getter for the coin's value


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>&lt;T&gt;(self: &<a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;): u64
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>&lt;T&gt;(self: &<a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;): u64 {
    self.<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>.<a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>()
}
</code></pre>



</details>

<a name="iota_coin_balance"></a>

## Function `balance`

Get immutable reference to the balance of a coin.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>&lt;T&gt;(coin: &<a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;): &<a href="../../dependencies/iota/balance.md#iota_balance_Balance">iota::balance::Balance</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>&lt;T&gt;(coin: &<a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;): &Balance&lt;T&gt; {
    &coin.<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>
}
</code></pre>



</details>

<a name="iota_coin_balance_mut"></a>

## Function `balance_mut`

Get a mutable reference to the balance of a coin.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_balance_mut">balance_mut</a>&lt;T&gt;(coin: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;): &<b>mut</b> <a href="../../dependencies/iota/balance.md#iota_balance_Balance">iota::balance::Balance</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_balance_mut">balance_mut</a>&lt;T&gt;(coin: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;): &<b>mut</b> Balance&lt;T&gt; {
    &<b>mut</b> coin.<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>
}
</code></pre>



</details>

<a name="iota_coin_from_balance"></a>

## Function `from_balance`

Wrap a balance into a Coin to make it transferable.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_from_balance">from_balance</a>&lt;T&gt;(<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: <a href="../../dependencies/iota/balance.md#iota_balance_Balance">iota::balance::Balance</a>&lt;T&gt;, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_from_balance">from_balance</a>&lt;T&gt;(<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: Balance&lt;T&gt;, ctx: &<b>mut</b> TxContext): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt; {
    <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a> { id: object::new(ctx), <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a> }
}
</code></pre>



</details>

<a name="iota_coin_into_balance"></a>

## Function `into_balance`

Destruct a Coin wrapper and keep the balance.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_into_balance">into_balance</a>&lt;T&gt;(coin: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;): <a href="../../dependencies/iota/balance.md#iota_balance_Balance">iota::balance::Balance</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_into_balance">into_balance</a>&lt;T&gt;(coin: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;): Balance&lt;T&gt; {
    <b>let</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a> { id, <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a> } = coin;
    id.delete();
    <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>
}
</code></pre>



</details>

<a name="iota_coin_take"></a>

## Function `take`

Take a <code><a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a></code> worth of <code><a href="../../dependencies/iota/coin.md#iota_coin_value">value</a></code> from <code>Balance</code>.
Aborts if <code><a href="../../dependencies/iota/coin.md#iota_coin_value">value</a> &gt; <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>.<a href="../../dependencies/iota/coin.md#iota_coin_value">value</a></code>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_take">take</a>&lt;T&gt;(<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: &<b>mut</b> <a href="../../dependencies/iota/balance.md#iota_balance_Balance">iota::balance::Balance</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>: u64, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_take">take</a>&lt;T&gt;(<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: &<b>mut</b> Balance&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>: u64, ctx: &<b>mut</b> TxContext): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt; {
    <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a> {
        id: object::new(ctx),
        <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>.<a href="../../dependencies/iota/coin.md#iota_coin_split">split</a>(<a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>),
    }
}
</code></pre>



</details>

<a name="iota_coin_put"></a>

## Function `put`

Put a <code><a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;</code> to the <code>Balance&lt;T&gt;</code>.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_put">put</a>&lt;T&gt;(<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: &<b>mut</b> <a href="../../dependencies/iota/balance.md#iota_balance_Balance">iota::balance::Balance</a>&lt;T&gt;, coin: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_put">put</a>&lt;T&gt;(<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: &<b>mut</b> Balance&lt;T&gt;, coin: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;) {
    <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>.<a href="../../dependencies/iota/coin.md#iota_coin_join">join</a>(<a href="../../dependencies/iota/coin.md#iota_coin_into_balance">into_balance</a>(coin));
}
</code></pre>



</details>

<a name="iota_coin_join"></a>

## Function `join`

Consume the coin <code>c</code> and add its value to <code>self</code>.
Aborts if <code>c.<a href="../../dependencies/iota/coin.md#iota_coin_value">value</a> + self.<a href="../../dependencies/iota/coin.md#iota_coin_value">value</a> &gt; U64_MAX</code>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_join">join</a>&lt;T&gt;(self: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;, c: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_join">join</a>&lt;T&gt;(self: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;, c: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;) {
    <b>let</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a> { id, <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a> } = c;
    id.delete();
    self.<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>.<a href="../../dependencies/iota/coin.md#iota_coin_join">join</a>(<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>);
}
</code></pre>



</details>

<a name="iota_coin_split"></a>

## Function `split`

Split coin <code>self</code> to two coins, one with balance <code>split_amount</code>,
and the remaining balance is left is <code>self</code>.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_split">split</a>&lt;T&gt;(self: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;, split_amount: u64, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_split">split</a>&lt;T&gt;(self: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;, split_amount: u64, ctx: &<b>mut</b> TxContext): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt; {
    <a href="../../dependencies/iota/coin.md#iota_coin_take">take</a>(&<b>mut</b> self.<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>, split_amount, ctx)
}
</code></pre>



</details>

<a name="iota_coin_divide_into_n"></a>

## Function `divide_into_n`

Split coin <code>self</code> into <code>n - 1</code> coins with equal balances. The remainder is left in
<code>self</code>. Return newly created coins.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_divide_into_n">divide_into_n</a>&lt;T&gt;(self: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;, n: u64, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): vector&lt;<a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_divide_into_n">divide_into_n</a>&lt;T&gt;(self: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;, n: u64, ctx: &<b>mut</b> TxContext): vector&lt;<a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;&gt; {
    <b>assert</b>!(n &gt; 0, <a href="../../dependencies/iota/coin.md#iota_coin_EInvalidArg">EInvalidArg</a>);
    <b>assert</b>!(n &lt;= <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>(self), <a href="../../dependencies/iota/coin.md#iota_coin_ENotEnough">ENotEnough</a>);
    <b>let</b> <b>mut</b> vec = vector[];
    <b>let</b> <b>mut</b> i = 0;
    <b>let</b> split_amount = <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>(self) / n;
    <b>while</b> (i &lt; n - 1) {
        vec.push_back(self.<a href="../../dependencies/iota/coin.md#iota_coin_split">split</a>(split_amount, ctx));
        i = i + 1;
    };
    vec
}
</code></pre>



</details>

<a name="iota_coin_zero"></a>

## Function `zero`

Make any Coin with a zero value. Useful for placeholding
bids/payments or preemptively making empty balances.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_zero">zero</a>&lt;T&gt;(ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_zero">zero</a>&lt;T&gt;(ctx: &<b>mut</b> TxContext): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt; {
    <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a> { id: object::new(ctx), <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: balance::zero() }
}
</code></pre>



</details>

<a name="iota_coin_destroy_zero"></a>

## Function `destroy_zero`

Destroy a coin with value zero


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_destroy_zero">destroy_zero</a>&lt;T&gt;(c: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_destroy_zero">destroy_zero</a>&lt;T&gt;(c: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;) {
    <b>let</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a> { id, <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a> } = c;
    id.delete();
    <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>.<a href="../../dependencies/iota/coin.md#iota_coin_destroy_zero">destroy_zero</a>()
}
</code></pre>



</details>

<a name="iota_coin_create_currency"></a>

## Function `create_currency`

Create a new currency type <code>T</code> as and return the <code><a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a></code> for
<code>T</code> to the caller. Can only be called with a <code>one-time-witness</code>
type, ensuring that there's only one <code><a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a></code> per <code>T</code>.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_create_currency">create_currency</a>&lt;T: drop&gt;(witness: T, decimals: u8, symbol: vector&lt;u8&gt;, name: vector&lt;u8&gt;, description: vector&lt;u8&gt;, icon_url: <a href="../../dependencies/std/option.md#std_option_Option">std::option::Option</a>&lt;<a href="../../dependencies/iota/url.md#iota_url_Url">iota::url::Url</a>&gt;, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): (<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_create_currency">create_currency</a>&lt;T: drop&gt;(
    witness: T,
    decimals: u8,
    symbol: vector&lt;u8&gt;,
    name: vector&lt;u8&gt;,
    description: vector&lt;u8&gt;,
    icon_url: Option&lt;Url&gt;,
    ctx: &<b>mut</b> TxContext,
): (<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;) {
    // Make sure there's only one instance of the type T
    <b>assert</b>!(<a href="../../dependencies/iota/types.md#iota_types_is_one_time_witness">iota::types::is_one_time_witness</a>(&witness), <a href="../../dependencies/iota/coin.md#iota_coin_EBadWitness">EBadWitness</a>);
    (
        <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a> {
            id: object::new(ctx),
            <a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>: balance::create_supply(witness),
        },
        <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a> {
            id: object::new(ctx),
            decimals,
            name: string::utf8(name),
            symbol: ascii::string(symbol),
            description: string::utf8(description),
            icon_url,
        },
    )
}
</code></pre>



</details>

<a name="iota_coin_create_regulated_currency_v1"></a>

## Function `create_regulated_currency_v1`

This creates a new currency, via <code><a href="../../dependencies/iota/coin.md#iota_coin_create_currency">create_currency</a></code>, but with an extra capability that
allows for specific addresses to have their coins frozen. When an address is added to the
deny list, it is immediately unable to interact with the currency's coin as input objects.
Additionally at the start of the next epoch, they will be unable to receive the currency's
coin.
The <code>allow_global_pause</code> flag enables an additional API that will cause all addresses to
be denied. Note however, that this doesn't affect per-address entries of the deny list and
will not change the result of the "contains" APIs.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_create_regulated_currency_v1">create_regulated_currency_v1</a>&lt;T: drop&gt;(witness: T, decimals: u8, symbol: vector&lt;u8&gt;, name: vector&lt;u8&gt;, description: vector&lt;u8&gt;, icon_url: <a href="../../dependencies/std/option.md#std_option_Option">std::option::Option</a>&lt;<a href="../../dependencies/iota/url.md#iota_url_Url">iota::url::Url</a>&gt;, allow_global_pause: bool, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): (<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">iota::coin::DenyCapV1</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_create_regulated_currency_v1">create_regulated_currency_v1</a>&lt;T: drop&gt;(
    witness: T,
    decimals: u8,
    symbol: vector&lt;u8&gt;,
    name: vector&lt;u8&gt;,
    description: vector&lt;u8&gt;,
    icon_url: Option&lt;Url&gt;,
    allow_global_pause: bool,
    ctx: &<b>mut</b> TxContext,
): (<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">DenyCapV1</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;) {
    <b>let</b> (treasury_cap, metadata) = <a href="../../dependencies/iota/coin.md#iota_coin_create_currency">create_currency</a>(
        witness,
        decimals,
        symbol,
        name,
        description,
        icon_url,
        ctx,
    );
    <b>let</b> deny_cap = <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">DenyCapV1</a> {
        id: object::new(ctx),
        allow_global_pause,
    };
    transfer::freeze_object(<a href="../../dependencies/iota/coin.md#iota_coin_RegulatedCoinMetadata">RegulatedCoinMetadata</a>&lt;T&gt; {
        id: object::new(ctx),
        coin_metadata_object: object::id(&metadata),
        deny_cap_object: object::id(&deny_cap),
    });
    (treasury_cap, deny_cap, metadata)
}
</code></pre>



</details>

<a name="iota_coin_mint"></a>

## Function `mint`

Create a coin worth <code><a href="../../dependencies/iota/coin.md#iota_coin_value">value</a></code> and increase the total supply
in <code>cap</code> accordingly.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_mint">mint</a>&lt;T&gt;(cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>: u64, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_mint">mint</a>&lt;T&gt;(cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>: u64, ctx: &<b>mut</b> TxContext): <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt; {
    <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a> {
        id: object::new(ctx),
        <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>: cap.<a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>.increase_supply(<a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>),
    }
}
</code></pre>



</details>

<a name="iota_coin_mint_balance"></a>

## Function `mint_balance`

Mint some amount of T as a <code>Balance</code> and increase the total
supply in <code>cap</code> accordingly.
Aborts if <code><a href="../../dependencies/iota/coin.md#iota_coin_value">value</a></code> + <code>cap.<a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a></code> >= U64_MAX


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_mint_balance">mint_balance</a>&lt;T&gt;(cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>: u64): <a href="../../dependencies/iota/balance.md#iota_balance_Balance">iota::balance::Balance</a>&lt;T&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_mint_balance">mint_balance</a>&lt;T&gt;(cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;, <a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>: u64): Balance&lt;T&gt; {
    cap.<a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>.increase_supply(<a href="../../dependencies/iota/coin.md#iota_coin_value">value</a>)
}
</code></pre>



</details>

<a name="iota_coin_burn"></a>

## Function `burn`

Destroy the coin <code>c</code> and decrease the total supply in <code>cap</code>
accordingly.


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_burn">burn</a>&lt;T&gt;(cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, c: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">iota::coin::Coin</a>&lt;T&gt;): u64
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_burn">burn</a>&lt;T&gt;(cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;, c: <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a>&lt;T&gt;): u64 {
    <b>let</b> <a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a> { id, <a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a> } = c;
    id.delete();
    cap.<a href="../../dependencies/iota/coin.md#iota_coin_total_supply">total_supply</a>.decrease_supply(<a href="../../dependencies/iota/coin.md#iota_coin_balance">balance</a>)
}
</code></pre>



</details>

<a name="iota_coin_deny_list_v1_add"></a>

## Function `deny_list_v1_add`

Adds the given address to the deny list, preventing it from interacting with the specified
coin type as an input to a transaction. Additionally at the start of the next epoch, the
address will be unable to receive objects of this coin type.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_add">deny_list_v1_add</a>&lt;T&gt;(deny_list: &<b>mut</b> <a href="../../dependencies/iota/deny_list.md#iota_deny_list_DenyList">iota::deny_list::DenyList</a>, _deny_cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">iota::coin::DenyCapV1</a>&lt;T&gt;, addr: <b>address</b>, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_add">deny_list_v1_add</a>&lt;T&gt;(
    deny_list: &<b>mut</b> DenyList,
    _deny_cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">DenyCapV1</a>&lt;T&gt;,
    addr: <b>address</b>,
    ctx: &<b>mut</b> TxContext,
) {
    <b>let</b> ty = type_name::get_with_original_ids&lt;T&gt;().into_string().into_bytes();
    deny_list.add(<a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>, ty, addr, ctx)
}
</code></pre>



</details>

<a name="iota_coin_deny_list_v1_remove"></a>

## Function `deny_list_v1_remove`

Removes an address from the deny list. Similar to <code><a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_add">deny_list_v1_add</a></code>, the effect for input
objects will be immediate, but the effect for receiving objects will be delayed until the
next epoch.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_remove">deny_list_v1_remove</a>&lt;T&gt;(deny_list: &<b>mut</b> <a href="../../dependencies/iota/deny_list.md#iota_deny_list_DenyList">iota::deny_list::DenyList</a>, _deny_cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">iota::coin::DenyCapV1</a>&lt;T&gt;, addr: <b>address</b>, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_remove">deny_list_v1_remove</a>&lt;T&gt;(
    deny_list: &<b>mut</b> DenyList,
    _deny_cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">DenyCapV1</a>&lt;T&gt;,
    addr: <b>address</b>,
    ctx: &<b>mut</b> TxContext,
) {
    <b>let</b> ty = type_name::get_with_original_ids&lt;T&gt;().into_string().into_bytes();
    deny_list.remove(<a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>, ty, addr, ctx)
}
</code></pre>



</details>

<a name="iota_coin_deny_list_v1_contains_current_epoch"></a>

## Function `deny_list_v1_contains_current_epoch`

Check if the deny list contains the given address for the current epoch. Denied addresses
in the current epoch will be unable to receive objects of this coin type.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_contains_current_epoch">deny_list_v1_contains_current_epoch</a>&lt;T&gt;(deny_list: &<a href="../../dependencies/iota/deny_list.md#iota_deny_list_DenyList">iota::deny_list::DenyList</a>, addr: <b>address</b>, ctx: &<a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_contains_current_epoch">deny_list_v1_contains_current_epoch</a>&lt;T&gt;(
    deny_list: &DenyList,
    addr: <b>address</b>,
    ctx: &TxContext,
): bool {
    <b>let</b> ty = type_name::get_with_original_ids&lt;T&gt;().into_string().into_bytes();
    deny_list.contains_current_epoch(<a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>, ty, addr, ctx)
}
</code></pre>



</details>

<a name="iota_coin_deny_list_v1_contains_next_epoch"></a>

## Function `deny_list_v1_contains_next_epoch`

Check if the deny list contains the given address for the next epoch. Denied addresses in
the next epoch will immediately be unable to use objects of this coin type as inputs. At the
start of the next epoch, the address will be unable to receive objects of this coin type.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_contains_next_epoch">deny_list_v1_contains_next_epoch</a>&lt;T&gt;(deny_list: &<a href="../../dependencies/iota/deny_list.md#iota_deny_list_DenyList">iota::deny_list::DenyList</a>, addr: <b>address</b>): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_contains_next_epoch">deny_list_v1_contains_next_epoch</a>&lt;T&gt;(deny_list: &DenyList, addr: <b>address</b>): bool {
    <b>let</b> ty = type_name::get_with_original_ids&lt;T&gt;().into_string().into_bytes();
    deny_list.contains_next_epoch(<a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>, ty, addr)
}
</code></pre>



</details>

<a name="iota_coin_deny_list_v1_enable_global_pause"></a>

## Function `deny_list_v1_enable_global_pause`

Enable the global pause for the given coin type. This will immediately prevent all addresses
from using objects of this coin type as inputs. At the start of the next epoch, all
addresses will be unable to receive objects of this coin type.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_enable_global_pause">deny_list_v1_enable_global_pause</a>&lt;T&gt;(deny_list: &<b>mut</b> <a href="../../dependencies/iota/deny_list.md#iota_deny_list_DenyList">iota::deny_list::DenyList</a>, deny_cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">iota::coin::DenyCapV1</a>&lt;T&gt;, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_enable_global_pause">deny_list_v1_enable_global_pause</a>&lt;T&gt;(
    deny_list: &<b>mut</b> DenyList,
    deny_cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">DenyCapV1</a>&lt;T&gt;,
    ctx: &<b>mut</b> TxContext,
) {
    <b>assert</b>!(deny_cap.allow_global_pause, <a href="../../dependencies/iota/coin.md#iota_coin_EGlobalPauseNotAllowed">EGlobalPauseNotAllowed</a>);
    <b>let</b> ty = type_name::get_with_original_ids&lt;T&gt;().into_string().into_bytes();
    deny_list.enable_global_pause(<a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>, ty, ctx)
}
</code></pre>



</details>

<a name="iota_coin_deny_list_v1_disable_global_pause"></a>

## Function `deny_list_v1_disable_global_pause`

Disable the global pause for the given coin type. This will immediately allow all addresses
to resume using objects of this coin type as inputs. However, receiving objects of this coin
type will still be paused until the start of the next epoch.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_disable_global_pause">deny_list_v1_disable_global_pause</a>&lt;T&gt;(deny_list: &<b>mut</b> <a href="../../dependencies/iota/deny_list.md#iota_deny_list_DenyList">iota::deny_list::DenyList</a>, deny_cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">iota::coin::DenyCapV1</a>&lt;T&gt;, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_disable_global_pause">deny_list_v1_disable_global_pause</a>&lt;T&gt;(
    deny_list: &<b>mut</b> DenyList,
    deny_cap: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_DenyCapV1">DenyCapV1</a>&lt;T&gt;,
    ctx: &<b>mut</b> TxContext,
) {
    <b>assert</b>!(deny_cap.allow_global_pause, <a href="../../dependencies/iota/coin.md#iota_coin_EGlobalPauseNotAllowed">EGlobalPauseNotAllowed</a>);
    <b>let</b> ty = type_name::get_with_original_ids&lt;T&gt;().into_string().into_bytes();
    deny_list.disable_global_pause(<a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>, ty, ctx)
}
</code></pre>



</details>

<a name="iota_coin_deny_list_v1_is_global_pause_enabled_current_epoch"></a>

## Function `deny_list_v1_is_global_pause_enabled_current_epoch`

Check if the global pause is enabled for the given coin type in the current epoch.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_is_global_pause_enabled_current_epoch">deny_list_v1_is_global_pause_enabled_current_epoch</a>&lt;T&gt;(deny_list: &<a href="../../dependencies/iota/deny_list.md#iota_deny_list_DenyList">iota::deny_list::DenyList</a>, ctx: &<a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_is_global_pause_enabled_current_epoch">deny_list_v1_is_global_pause_enabled_current_epoch</a>&lt;T&gt;(
    deny_list: &DenyList,
    ctx: &TxContext,
): bool {
    <b>let</b> ty = type_name::get_with_original_ids&lt;T&gt;().into_string().into_bytes();
    deny_list.is_global_pause_enabled_current_epoch(<a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>, ty, ctx)
}
</code></pre>



</details>

<a name="iota_coin_deny_list_v1_is_global_pause_enabled_next_epoch"></a>

## Function `deny_list_v1_is_global_pause_enabled_next_epoch`

Check if the global pause is enabled for the given coin type in the next epoch.


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_is_global_pause_enabled_next_epoch">deny_list_v1_is_global_pause_enabled_next_epoch</a>&lt;T&gt;(deny_list: &<a href="../../dependencies/iota/deny_list.md#iota_deny_list_DenyList">iota::deny_list::DenyList</a>): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_deny_list_v1_is_global_pause_enabled_next_epoch">deny_list_v1_is_global_pause_enabled_next_epoch</a>&lt;T&gt;(deny_list: &DenyList): bool {
    <b>let</b> ty = type_name::get_with_original_ids&lt;T&gt;().into_string().into_bytes();
    deny_list.is_global_pause_enabled_next_epoch(<a href="../../dependencies/iota/coin.md#iota_coin_DENY_LIST_COIN_INDEX">DENY_LIST_COIN_INDEX</a>, ty)
}
</code></pre>



</details>

<a name="iota_coin_mint_and_transfer"></a>

## Function `mint_and_transfer`

Mint <code>amount</code> of <code><a href="../../dependencies/iota/coin.md#iota_coin_Coin">Coin</a></code> and send it to <code>recipient</code>. Invokes <code><a href="../../dependencies/iota/coin.md#iota_coin_mint">mint</a>()</code>.


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_mint_and_transfer">mint_and_transfer</a>&lt;T&gt;(c: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, amount: u64, recipient: <b>address</b>, ctx: &<b>mut</b> <a href="../../dependencies/iota/tx_context.md#iota_tx_context_TxContext">iota::tx_context::TxContext</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_mint_and_transfer">mint_and_transfer</a>&lt;T&gt;(
    c: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;,
    amount: u64,
    recipient: <b>address</b>,
    ctx: &<b>mut</b> TxContext,
) {
    transfer::public_transfer(<a href="../../dependencies/iota/coin.md#iota_coin_mint">mint</a>(c, amount, ctx), recipient)
}
</code></pre>



</details>

<a name="iota_coin_update_name"></a>

## Function `update_name`

Update name of the coin in <code><a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a></code>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_update_name">update_name</a>&lt;T&gt;(_treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, metadata: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;, name: <a href="../../dependencies/std/string.md#std_string_String">std::string::String</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_update_name">update_name</a>&lt;T&gt;(
    _treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;,
    metadata: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;,
    name: string::String,
) {
    metadata.name = name;
}
</code></pre>



</details>

<a name="iota_coin_update_symbol"></a>

## Function `update_symbol`

Update the symbol of the coin in <code><a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a></code>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_update_symbol">update_symbol</a>&lt;T&gt;(_treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, metadata: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;, symbol: <a href="../../dependencies/std/ascii.md#std_ascii_String">std::ascii::String</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_update_symbol">update_symbol</a>&lt;T&gt;(
    _treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;,
    metadata: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;,
    symbol: ascii::String,
) {
    metadata.symbol = symbol;
}
</code></pre>



</details>

<a name="iota_coin_update_description"></a>

## Function `update_description`

Update the description of the coin in <code><a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a></code>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_update_description">update_description</a>&lt;T&gt;(_treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, metadata: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;, description: <a href="../../dependencies/std/string.md#std_string_String">std::string::String</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_update_description">update_description</a>&lt;T&gt;(
    _treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;,
    metadata: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;,
    description: string::String,
) {
    metadata.description = description;
}
</code></pre>



</details>

<a name="iota_coin_update_icon_url"></a>

## Function `update_icon_url`

Update the url of the coin in <code><a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a></code>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_update_icon_url">update_icon_url</a>&lt;T&gt;(_treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">iota::coin::TreasuryCap</a>&lt;T&gt;, metadata: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;, url: <a href="../../dependencies/std/ascii.md#std_ascii_String">std::ascii::String</a>)
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>entry</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_update_icon_url">update_icon_url</a>&lt;T&gt;(
    _treasury: &<a href="../../dependencies/iota/coin.md#iota_coin_TreasuryCap">TreasuryCap</a>&lt;T&gt;,
    metadata: &<b>mut</b> <a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;,
    url: ascii::String,
) {
    metadata.icon_url = option::some(url::new_unsafe(url));
}
</code></pre>



</details>

<a name="iota_coin_get_decimals"></a>

## Function `get_decimals`



<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_decimals">get_decimals</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;): u8
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_decimals">get_decimals</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;): u8 {
    metadata.decimals
}
</code></pre>



</details>

<a name="iota_coin_get_name"></a>

## Function `get_name`



<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_name">get_name</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;): <a href="../../dependencies/std/string.md#std_string_String">std::string::String</a>
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_name">get_name</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;): string::String {
    metadata.name
}
</code></pre>



</details>

<a name="iota_coin_get_symbol"></a>

## Function `get_symbol`



<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_symbol">get_symbol</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;): <a href="../../dependencies/std/ascii.md#std_ascii_String">std::ascii::String</a>
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_symbol">get_symbol</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;): ascii::String {
    metadata.symbol
}
</code></pre>



</details>

<a name="iota_coin_get_description"></a>

## Function `get_description`



<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_description">get_description</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;): <a href="../../dependencies/std/string.md#std_string_String">std::string::String</a>
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_description">get_description</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;): string::String {
    metadata.description
}
</code></pre>



</details>

<a name="iota_coin_get_icon_url"></a>

## Function `get_icon_url`



<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_icon_url">get_icon_url</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">iota::coin::CoinMetadata</a>&lt;T&gt;): <a href="../../dependencies/std/option.md#std_option_Option">std::option::Option</a>&lt;<a href="../../dependencies/iota/url.md#iota_url_Url">iota::url::Url</a>&gt;
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b> <b>fun</b> <a href="../../dependencies/iota/coin.md#iota_coin_get_icon_url">get_icon_url</a>&lt;T&gt;(metadata: &<a href="../../dependencies/iota/coin.md#iota_coin_CoinMetadata">CoinMetadata</a>&lt;T&gt;): Option&lt;Url&gt; {
    metadata.icon_url
}
</code></pre>



</details>
