Skip to content

Commit

Permalink
Rename Token V2 to Digital Asset (DA) (#9730)
Browse files Browse the repository at this point in the history
* Rename Token V2 to Digital Asset (DA)

* Update glossary

* Update additional_dict.txt

* Update developer-docs-site/docs/reference/glossary.md

Co-authored-by: Matt <[email protected]>

* Update developer-docs-site/docs/reference/glossary.md

Co-authored-by: Matt <[email protected]>

* Update digital-asset.md

* Update developer-docs-site/docs/standards/digital-asset.md

Co-authored-by: Matt <[email protected]>

* Update fungible-asset.md

---------

Co-authored-by: Matt <[email protected]>
  • Loading branch information
saharct and xbtmatt authored Aug 24, 2023
1 parent 4d06553 commit fad6e81
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 72 deletions.
6 changes: 3 additions & 3 deletions developer-docs-site/docs/reference/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,13 @@ then there is a guarantee that T_N will never be included in the blockchain.
### Fungible Asset

- A **fungible asset** is an asset, such as a currency, share, in-game resource, etc., that is interchangeable with another identical asset without any loss in its value. For example, APT is a fungible asset because you can exchange one APT for another.
- Follow the [Digital Asset Standards](../standards/index.md#digital-asset-standards) to create fungible assets on the Aptos blockchain.
- Follow the [Asset Standards](../standards/index.md#asset-standards) to create fungible assets on the Aptos blockchain.
- Next generation of the Coin standard that addresses shortcomings of `aptos_framework::coin` such as lack of guaranteed enforcement of freeze and burn and advanced functionalities such as programmable transfers, e.g., approve in ERC-20.

### Fungible Token

- For TokenV1 (aptos_token::token), a **fungible token** is a token that is interchangeable with other identical tokens (i.e., tokens that share the same `TokenId`). This means the tokens have the same `creator address`, `collection name`, `token name`, and `property version`.
- For TokenV2 (aptos_token_objects::token), a **fungible token** is a fungible asset with metadata object includes a TokenV2 resource.
- For the legacy Aptos Token Standard (aptos_token::token), a **fungible token** is a token that is interchangeable with other identical tokens (i.e., tokens that share the same `TokenId`). This means the tokens have the same `creator address`, `collection name`, `token name`, and `property version`.
- For the Aptos Digital Asset Standard (aptos_token_objects::token), a **fungible token** is a fungible asset with metadata object that includes a Digital Asset resource.

### Fungible Unit

Expand Down
2 changes: 1 addition & 1 deletion developer-docs-site/docs/sdks/ts-sdk/sdk-plugins-layer.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A plugin is a component that can be added to the TypeScript SDK to extend or enh

## AptosToken class

The [AptosToken](https://github.com/aptos-labs/aptos-core/blob/main/ecosystem/typescript/sdk/src/plugins/aptos_token.ts) class is compatible with the [token V2 standard](../../standards/aptos-token-v2.md) and provides methods for creating and querying NFT collections and tokens.
The [AptosToken](https://github.com/aptos-labs/aptos-core/blob/main/ecosystem/typescript/sdk/src/plugins/aptos_token.ts) class is compatible with the [Aptos Digital Asset Standard](../../standards/digital-asset.md) and provides methods for creating and querying NFT collections and tokens.
It covers write methods that support creating, transferring, mutating, and burning tokens on-chain.

The main write methods supported by the AptosToken class are:
Expand Down
4 changes: 2 additions & 2 deletions developer-docs-site/docs/standards/aptos-coin.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Aptos Coin"
title: "Aptos Coin (Legacy)"
---
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Aptos Coin
# Aptos Coin (Legacy)

[Coin](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/coin.move) provides a standard, typesafe framework for simple, fungible tokens or coins.

Expand Down
2 changes: 1 addition & 1 deletion developer-docs-site/docs/standards/aptos-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct LiquidityPool has key {
}
```

In the above code, `token_a` and `token_b` are references to other objects. Specifically, `Object<T>` is a reference to an object stored at a given address that contains `T` resource. In this example, they're fungible assets (similar to coins). This will be covered in more detail in the fungible asset standard.
In the above code, `token_a` and `token_b` are references to other objects. Specifically, `Object<T>` is a reference to an object stored at a given address that contains `T` resource. In this example, they're fungible assets (similar to coins). This is covered in more detail in the [Aptos Fungible Asset Standard](./fungible-asset.md).
LiquidityPool resource is part of the ObjectGroup resource group. This means that the LiquidityPool resource is stored in the same storage slot as the ObjectCore resource. This is more storage and gas efficient for reading and writing data.

LiquidityPool resource can be added during construction of the object:
Expand Down
4 changes: 2 additions & 2 deletions developer-docs-site/docs/standards/aptos-token.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: "Aptos Token"
title: "Aptos Token (Legacy)"
---
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Aptos Token
# Aptos Token (Legacy)

:::tip Aptos Token standards compared
Also see the [comparison of Aptos Token standards](../guides/nfts/aptos-token-overview.md).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
title: "Aptos Token V2"
id: "aptos-token-v2"
title: "Aptos Digital Asset Standard"
---
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Aptos Token V2
# Aptos Digital Asset Standard

## Overview of NFTs
An [NFT](https://en.wikipedia.org/wiki/Non-fungible_token) is a non-fungible [token](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-token-objects/sources/token.move)
Expand All @@ -28,7 +27,7 @@ or minimally contract. Each collection has a similar set of attributes:
- `maximum`: The maximum number of NFTs that this collection can have. If `maximum` is set to 0, then supply is untracked.

## Design principles
The [Aptos token v2 standard](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-token-objects/sources/token.move)
The [Aptos Digital Asset Standard](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-token-objects/sources/token.move)
was developed with the following as an improvement on the Aptos Token standard. It has these ideas in mind:
* **Flexibility** - NFTs are flexible and can be customized to accommodate any creative designs.
* **Composability** - Multiple NFTs can be easily composed together, such that the final object is greater than the sum of its parts
Expand All @@ -39,9 +38,9 @@ functions are non-entry and thus not callable directly from off chain. Creators
these fuctionalities or use "no code" solutions also provided in the framework. One such solution is [aptos_token](#aptos-token)
which provides functionalities such as custom metadata (via PropertyMap) and soul bound.

## Comparison to Token V1
## Comparison to the legacy Aptos Token Standard

Token V2 uses Aptos [objects](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/object.move)
Digital Asset uses Aptos [objects](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-framework/sources/object.move)
rather than account resources traditionally used in Move. This allows for storing data outside the account and adding
flexibility in this way.
* Tokens can be easily extended with custom data and functionalities without requiring any changes in the framework
Expand Down Expand Up @@ -86,7 +85,7 @@ See [Aptos Token](#aptos-token) for examples on how Royalty's `MutatorRef` can b
Royalty can also be set directly on a token if it has a different royalty config than the collection's.

## Token lifecycle
All token v2 modules are deployed at `0x4`.
All Digital Asset modules are deployed at the reserved framework address `0x4`.

### Collection creation
Every token belongs to a collection. The developer first needs to create a collection with:
Expand Down Expand Up @@ -278,7 +277,7 @@ Tokens can be simply transferred as objects to any user via `object::transfer`

## Aptos Token
[Aptos Token](https://github.com/aptos-labs/aptos-core/blob/main/aptos-move/framework/aptos-token-objects/sources/aptos_token.move)
is a "no code" solution that builds on top of the base token v2 standard and provides a more complete solution that
is a "no code" solution that builds on top of the base Aptos Digital Asset Standard and provides a more complete solution that
allows creators to mint NFTs without writing any code. It provides the following main features:
* Soul bound tokens which are non-transferable by holders
* Custom defined properties stored in a [PropertyMap](#property-map), a simple map data structure of attribute name (string) -> values (bytes).
Expand Down Expand Up @@ -336,17 +335,17 @@ are entry functions and do not return any ref (constructor, mutator, etc.). The
the refs obtained from creating the collection and token objects and do not expose raw access to them.

If a creator wants more custom functionalities such as being able to forcefully transfer a soul bound token, they would
need to write their own custom module that builds on top of the base token v2 standard. They can of course borrow inspiration
need to write their own custom module that builds on top of the base Aptos Digital Asset Standard. They can of course borrow inspiration
and code from the Aptos Token module.

## Fungible Token
Similar to [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155), the Token v2 standard also supports fungible tokens
Similar to [EIP-1155](https://eips.ethereum.org/EIPS/eip-1155), the Aptos Digital Asset Standard also supports fungible tokens
(also known as semi-fungible tokens). An example of this would be armor tokens in a game. Each armor token represents a
type of armor and is a token in a collection with metadata (e.g. durability, defense, etc.) and can be minted and burned.
However, there are multiple instances of the same armor type. For example, a player can have 3 wooden armors, where wooden armor
is a token in the Armor collection.

This can be easily built by combining Token v2 and Fungible Assets. After the creator creates the Armor collection and the
This can be easily built by creating an asset that is both a Digital Asset (DA) and a Fungible Asset (FA), resulting in a Digital and Fungible Asset (DFA). After the creator creates the Armor collection and the
Wooden Armor token, they can make the Wooden Armor token "fungible":

```rust
Expand Down
Loading

0 comments on commit fad6e81

Please sign in to comment.