Skip to content

Commit

Permalink
[framework] Add support for compressing and decompressing TokenV2
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-aptos committed Jan 10, 2025
1 parent ce087e2 commit fe87fea
Show file tree
Hide file tree
Showing 6 changed files with 592 additions and 11 deletions.
50 changes: 50 additions & 0 deletions aptos-move/framework/aptos-token-objects/doc/property_map.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ represent types and storing values in bcs format.
- [Function `update_typed`](#0x4_property_map_update_typed)
- [Function `update_internal`](#0x4_property_map_update_internal)
- [Function `remove`](#0x4_property_map_remove)
- [Function `exists_at`](#0x4_property_map_exists_at)
- [Function `delete`](#0x4_property_map_delete)
- [Function `assert_end_to_end_input`](#0x4_property_map_assert_end_to_end_input)


Expand Down Expand Up @@ -1262,6 +1264,54 @@ Removes a property from the map, ensuring that it does in fact exist



</details>

<a id="0x4_property_map_exists_at"></a>

## Function `exists_at`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="property_map.md#0x4_property_map_exists_at">exists_at</a>(addr: <b>address</b>): bool
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="property_map.md#0x4_property_map_exists_at">exists_at</a>(addr: <b>address</b>): bool {
<b>exists</b>&lt;<a href="property_map.md#0x4_property_map_PropertyMap">PropertyMap</a>&gt;(addr)
}
</code></pre>



</details>

<a id="0x4_property_map_delete"></a>

## Function `delete`



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="property_map.md#0x4_property_map_delete">delete</a>(addr: <b>address</b>): <a href="property_map.md#0x4_property_map_PropertyMap">property_map::PropertyMap</a>
</code></pre>



<details>
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="property_map.md#0x4_property_map_delete">delete</a>(addr: <b>address</b>): <a href="property_map.md#0x4_property_map_PropertyMap">PropertyMap</a> <b>acquires</b> <a href="property_map.md#0x4_property_map_PropertyMap">PropertyMap</a> {
<b>move_from</b>&lt;<a href="property_map.md#0x4_property_map_PropertyMap">PropertyMap</a>&gt;(addr)
}
</code></pre>



</details>

<a id="0x4_property_map_assert_end_to_end_input"></a>
Expand Down
8 changes: 4 additions & 4 deletions aptos-move/framework/aptos-token-objects/doc/royalty.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ by (numerator / denominator) * 100%


<pre><code>#[resource_group_member(#[group = <a href="../../aptos-framework/doc/object.md#0x1_object_ObjectGroup">0x1::object::ObjectGroup</a>])]
<b>struct</b> <a href="royalty.md#0x4_royalty_Royalty">Royalty</a> <b>has</b> <b>copy</b>, drop, key
<b>struct</b> <a href="royalty.md#0x4_royalty_Royalty">Royalty</a> <b>has</b> <b>copy</b>, drop, store, key
</code></pre>


Expand Down Expand Up @@ -277,7 +277,7 @@ Creates a new royalty, verifying that it is a valid percentage



<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="royalty.md#0x4_royalty_delete">delete</a>(addr: <b>address</b>)
<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="royalty.md#0x4_royalty_delete">delete</a>(addr: <b>address</b>): <a href="royalty.md#0x4_royalty_Royalty">royalty::Royalty</a>
</code></pre>


Expand All @@ -286,9 +286,9 @@ Creates a new royalty, verifying that it is a valid percentage
<summary>Implementation</summary>


<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="royalty.md#0x4_royalty_delete">delete</a>(addr: <b>address</b>) <b>acquires</b> <a href="royalty.md#0x4_royalty_Royalty">Royalty</a> {
<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="royalty.md#0x4_royalty_delete">delete</a>(addr: <b>address</b>): <a href="royalty.md#0x4_royalty_Royalty">Royalty</a> <b>acquires</b> <a href="royalty.md#0x4_royalty_Royalty">Royalty</a> {
<b>assert</b>!(<b>exists</b>&lt;<a href="royalty.md#0x4_royalty_Royalty">Royalty</a>&gt;(addr), <a href="../../aptos-framework/../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_not_found">error::not_found</a>(<a href="royalty.md#0x4_royalty_EROYALTY_DOES_NOT_EXIST">EROYALTY_DOES_NOT_EXIST</a>));
<b>move_from</b>&lt;<a href="royalty.md#0x4_royalty_Royalty">Royalty</a>&gt;(addr);
<b>move_from</b>&lt;<a href="royalty.md#0x4_royalty_Royalty">Royalty</a>&gt;(addr)
}
</code></pre>

Expand Down
Loading

0 comments on commit fe87fea

Please sign in to comment.