diff --git a/docs/content/developer/getting-started/simple-token-transfer.mdx b/docs/content/developer/getting-started/simple-token-transfer.mdx index 6606c809b8c..1a53769c2a8 100644 --- a/docs/content/developer/getting-started/simple-token-transfer.mdx +++ b/docs/content/developer/getting-started/simple-token-transfer.mdx @@ -51,7 +51,7 @@ Run the following command to create a Move package iota move new token_transfer ``` -This will generate a new Move package in a folder named token-transfer. +This will generate a new Move package in a folder named token_transfer. ## Configure the IOTA CLI @@ -59,7 +59,7 @@ To run the `mint` function from the frontend app, you must be the owner of the p Before publishing the package, you need to configure your IOTA CLI with your wallet details. -### Navigate to the IOTA configuration directory +### Navigate to the IOTA Configuration Directory ```bash cd ~/.iota/iota_config/ @@ -76,10 +76,10 @@ cd ~/.iota/iota_config/ #### [`init`](https://github.com/iota-community/token-transfer-tutorial/blob/ea71112c1156d1885567353fee0a03e09308e293/sources/token_transfer.move#L9-L13) - Executes at the time of publication of the package. -- Takes `MY_TOKEN` as a witness and the transaction context (ctx). -- Uses the `coin::create_currency` function to create the token by specifying the name, symbol, and decimal precision of the token. -- The `coin::create_currency` function returns a TreasuryCap, which allows the owner to mint and transfer the token, and the metadata of the token. -- Transfers the metadata to the owner of the contract using `transfer::public_freeze_object(metadata)` and `transfer::public_transfer(treasury, ctx.sender())`. +- Takes `MY_TOKEN` as a witness and the transaction context ([ctx](https://docs.iota.org/references/framework/iota-framework/tx_context#0x2_tx_context_sender)). +- Uses the [`coin::create_currency`](https://docs.iota.org/references/framework/iota-framework/coin#0x2_coin_create_currency) function to create the token by specifying the name, symbol, and decimal precision of the token. +- The [`coin::create_currency`](https://docs.iota.org/references/framework/iota-framework/coin#0x2_coin_create_currency) function returns a TreasuryCap, which allows the owner to mint and transfer the token, and the metadata of the token. +- Transfers the metadata to the owner of the contract using [`transfer::public_freeze_object(metadata)`](https://docs.iota.org/references/framework/iota-framework/transfer#0x2_transfer_public_freeze_object) and [`transfer::public_transfer(treasury, ctx.sender())`](https://docs.iota.org/references/framework/iota-framework/transfer#function-public_transfer). ```move reference https://github.com/iota-community/token-transfer-tutorial/blob/ea71112c1156d1885567353fee0a03e09308e293/sources/token_transfer.move#L9-L13 @@ -101,7 +101,7 @@ https://github.com/iota-community/token-transfer-tutorial/blob/ea71112c1156d1885 - Transfers the token from the caller address to the recipient address. - Requires the correct token object address that is owned by the caller. -- The function first uses the `coin::split` function to split the specified amount from the token and then uses `transfer::public_transfer` to transfer the split tokens to the recipient. +- The function first uses the [`coin::split`](https://docs.iota.org/references/framework/iota-framework/coin#function-split) function to split the specified amount from the token and then uses [`transfer::public_transfer`](https://docs.iota.org/references/framework/iota-framework/transfer#function-public_transfer) to transfer the split tokens to the recipient. ```move reference https://github.com/iota-community/token-transfer-tutorial/blob/ea71112c1156d1885567353fee0a03e09308e293/sources/token_transfer.move#L25-L33 @@ -111,7 +111,7 @@ https://github.com/iota-community/token-transfer-tutorial/blob/ea71112c1156d1885 - Returns the balance of the token for the specified owner. - Requires passing the token address to retrieve the balance.WW -- Uses `coin::balance` to query the balance and returns the value held by the coin object. +- Uses [`coin::balance`](https://docs.iota.org/references/framework/iota-framework/coin#function-balance) to query the balance and returns the value held by the coin object. ```move reference https://github.com/iota-community/token-transfer-tutorial/blob/ea71112c1156d1885567353fee0a03e09308e293/sources/token_transfer.move#L34-L37 @@ -123,7 +123,7 @@ Navigate to the [`source/token-transfer.move`](https://github.com/iota-community https://github.com/iota-community/token-transfer-tutorial/blob/ea71112c1156d1885567353fee0a03e09308e293/sources/token_transfer.move#L1-L38 ``` -### Build the Package +### [Build the Package](https://docs.iota.org/developer/getting-started/build-test) Once the contract is ready, build the package by running: @@ -131,7 +131,7 @@ Once the contract is ready, build the package by running: iota move build ``` -### Publish the Package +### [Publish the Package](https://docs.iota.org/developer/getting-started/publish) Publish the package to the IOTA testnet using the following command: @@ -319,7 +319,7 @@ pnpm add @iota/dapp-kit @iota/iota-sdk @tanstack/react-query ### Code Structure -- Components: Contains the components listed below for the UI : +- Components: It contains the separate react components for different operations such as check balance, minting tokens and transfer tokens. - [`Balance.tsx`](https://github.com/iota-community/token-transfer-tutorial/blob/3e2023a7c29aa5cf43305c6c42bd463a7a789750/frontend/src/components/Balance.tsx#L1-L27) - [`Buttons.tsx`](https://github.com/iota-community/token-transfer-tutorial/blob/3e2023a7c29aa5cf43305c6c42bd463a7a789750/frontend/src/components/Buttons.tsx#L1-L27) - [`Mint.tsx`](https://github.com/iota-community/token-transfer-tutorial/blob/3e2023a7c29aa5cf43305c6c42bd463a7a789750/frontend/src/components/Mint.tsx#L1-L144) @@ -383,7 +383,7 @@ This component allows users to mint new tokens to a specified address. Users can https://github.com/iota-community/token-transfer-tutorial/blob/0bbe1cc9cef5219c6f29b8cef9d1022ab0c5ddc5/frontend/src/components/Mint.tsx#L1-L79 ``` -## Usage example +## Usage Example ### Dashboard