Skip to content

Commit

Permalink
Merge pull request #1140 from lukso-network/docs/tools-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 authored Sep 4, 2024
2 parents 37cdaae + 27d5756 commit a7a3a31
Show file tree
Hide file tree
Showing 67 changed files with 201 additions and 154 deletions.
2 changes: 1 addition & 1 deletion docs/faq/onboarding/tools-and-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you want to experiment with simple code snippets for LSPs, please look at the

## Which tools can be used to develop dApps on LUKSO?

We have a [full set of tools](../../tools/getting-started/) and libraries that you can use to build on LSPs and interact with Universal Profiles. You can also [install the latest Universal Profile Extension](/install-up-browser-extension) to connect Universal Profiles with dApps.
We have a [full set of tools](../../tools/libraries/getting-started/) and libraries that you can use to build on LSPs and interact with Universal Profiles. You can also [install the latest Universal Profile Extension](/install-up-browser-extension) to connect Universal Profiles with dApps.

## Where can I get LYXt for test deployments?

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/digital-assets/.assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ The `generateLSP4JSONVerifiableURI` will return you directly what needs to be se

## Encode the LSP4 Metadata

To encode the LSP4 Metadata with ease, you can use the 🛠️ [`erc725.js`](../../tools/erc725js/getting-started.md) library. The tool provides all necessary LSP Schemas and the `encodeData()` function.
To encode the LSP4 Metadata with ease, you can use the 🛠️ [`erc725.js`](../../tools/libraries/erc725js/getting-started.md) library. The tool provides all necessary LSP Schemas and the `encodeData()` function.

```js
import { ERC725 } from '@erc725/erc725.js';
Expand Down
2 changes: 1 addition & 1 deletion docs/learn/digital-assets/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';

# Getting started building Tokens & NFTs

The LUKSO ecosystem offers smart contract developers a lot of [new standards](../../standards/introduction.md) and [tools](../../tools/getting-started.md) to build **powerful, modular, and standardized** blockchain applications.
The LUKSO ecosystem offers smart contract developers a lot of [new standards](../../standards/introduction.md) and [tools](../../tools/libraries/getting-started.md) to build **powerful, modular, and standardized** blockchain applications.

This page will guide you in setting up your development environment to build and deploy tokens and NFTs on LUKSO.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ To implement Cascade and Sense support, you can reference [this](./cascade-and-s

:::tip Convenience Tool

You can use the 🛠️ [`erc725.js`](../../../tools/erc725js/getting-started.md) library
You can use the 🛠️ [`erc725.js`](../../../tools/libraries/erc725js/getting-started.md) library
to encode the LSP4 Metadata. The tool provides all necessary LSP schemas as well as the `encodeData()` function.

:::
Expand Down
14 changes: 7 additions & 7 deletions docs/learn/digital-assets/metadata-management/read-asset-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ npm i @lukso/lsp-smart-contracts @erc725/erc725.js

:::info

If you are using the 📃 [lsp-smart-contracts](../../../tools/lsp-smart-contracts/getting-started) library, you can fetch the list of `interfaceId` directly from the package's [constants](../../../tools/lsp-smart-contracts/constants) called `INTERFACE_IDS`.
If you are using the 📃 [lsp-smart-contracts](../../../tools/libraries/lsp-smart-contracts/getting-started) library, you can fetch the list of `interfaceId` directly from the package's [constants](../../../tools/libraries/lsp-smart-contracts/constants) called `INTERFACE_IDS`.

Optionally, you can also find a full list of interface IDs on the [Contracts > Interface ID](https://docs.lukso.tech/contracts/interface-ids/) page and input them manually.

Expand Down Expand Up @@ -176,7 +176,7 @@ The following data keys can be fetched 👇
| `LSP4TokenSymbol` | The utf8 hex characters of the string representing the asset's symbol. |
| `LSP4TokenName` | The utf8 hex characters of the string representing the asset's name. |

To retrieve and decode the value stored under this data keys, we will use [erc725.js](../../../tools/erc725js/getting-started.md) and instantiate the class with:
To retrieve and decode the value stored under this data keys, we will use [erc725.js](../../../tools/libraries/erc725js/getting-started.md) and instantiate the class with:

1. the LSP4 Schema that defines the data keys above and how to decode them
2. the address of your digital asset
Expand All @@ -200,9 +200,9 @@ const erc725js = new ERC725(

We can fetch the digital asset data in three ways:

1. using [`getData()`](../../../tools/erc725js/methods#getdata) without parameters. This will fetch the value of all data keys at once.
1. using [`getData()`](../../../tools/libraries/erc725js/methods#getdata) without parameters. This will fetch the value of all data keys at once.
2. using `getData("DataKeyName")` to fetch the value of a specific data key. For instance `getData("LSP4Metadata")`.
3. using [`fetchData('LSP4Metadata')`](../../../tools/erc725js/methods.md#fetchdata) which decodes the `VerifiableURI` to extract the JSON metadata file link and fetch its content from IPFS (or another storage service).
3. using [`fetchData('LSP4Metadata')`](../../../tools/libraries/erc725js/methods.md#fetchdata) which decodes the `VerifiableURI` to extract the JSON metadata file link and fetch its content from IPFS (or another storage service).

### Asset Name and Symbol

Expand Down Expand Up @@ -232,10 +232,10 @@ console.log(tokenSymbol);

### Global Token Information

To fetch the whole JSON file of the asset's metadata, you can use the following 2 functions of the [`erc725js`](../../../tools/erc725js/getting-started.md) library:
To fetch the whole JSON file of the asset's metadata, you can use the following 2 functions of the [`erc725js`](../../../tools/libraries/erc725js/getting-started.md) library:

- [`fetchData('LSP4Metadata')`](../../../tools/erc725js/methods.md#fetchdata): This will download and decode the content of `VerifiableURI` as JSON.
- [`getData(LSP4Metadata)`](../../../tools/erc725js/methods#getdata): This will retrieve the raw data value from the smart contract. You will then need to decode the `VerifiableURI` maunually using [`decodeData(...)`](../../../tools/erc725js/methods.md#decodedata).
- [`fetchData('LSP4Metadata')`](../../../tools/libraries/erc725js/methods.md#fetchdata): This will download and decode the content of `VerifiableURI` as JSON.
- [`getData(LSP4Metadata)`](../../../tools/libraries/erc725js/methods#getdata): This will retrieve the raw data value from the smart contract. You will then need to decode the `VerifiableURI` maunually using [`decodeData(...)`](../../../tools/libraries/erc725js/methods.md#decodedata).

```ts
// Download and verify the asset metadata JSON file
Expand Down
6 changes: 3 additions & 3 deletions docs/learn/digital-assets/nft/read-nft-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ If neither _Token ID Metadata_ nor _Base URI_ are set, you should fall back and

We will need the following dependencies to follow this guide:

- [`lsp-smart-contracts`](../../../tools/lsp-smart-contracts/getting-started.md) to import the LSP8 contract ABI.
- [`erc725.js`](../../../tools/erc725js/getting-started.md) to easily get [ERC725Y](../../../standards/lsp-background/erc725.md) data keys and decode their values.
- [`lsp-smart-contracts`](../../../tools/libraries/lsp-smart-contracts/getting-started.md) to import the LSP8 contract ABI.
- [`erc725.js`](../../../tools/libraries/erc725js/getting-started.md) to easily get [ERC725Y](../../../standards/lsp-background/erc725.md) data keys and decode their values.

<Tabs groupId="provider-lib">
<TabItem value="ethers" label="ethers" attributes={{className: "tab_ethers"}}>
Expand Down Expand Up @@ -385,7 +385,7 @@ After retrieving the metadata from the contract, you can continue to [retrieve t

:::caution Version Support

Assets created with LSP versions below 🛠️ [`@lukso/lsp-smart-contracts`](../../../tools/lsp-smart-contracts/getting-started.md) of `v0.14.0` lack support for retrieving token ID metadata from a Base URI. For previous LSP8 assets, the Base URI may be retrievable by calling the [`fetchData`](../../../tools/erc725js/methods.md#fetchdata) function as described in the [Global Token Information](#global-token-information) section.
Assets created with LSP versions below 🛠️ [`@lukso/lsp-smart-contracts`](../../../tools/libraries/lsp-smart-contracts/getting-started.md) of `v0.14.0` lack support for retrieving token ID metadata from a Base URI. For previous LSP8 assets, the Base URI may be retrievable by calling the [`fetchData`](../../../tools/libraries/erc725js/methods.md#fetchdata) function as described in the [Global Token Information](#global-token-information) section.

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/digital-assets/nft/set-nft-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ The next step is to encode the metadata. To do so, we need:
- a JSON file that contains all the metadata of the specific NFT. This metadata has the same format as the `LSP4Metadata`.
- the IPFS url where this JSON file has been uploaded

The value will be encoded as a `VerifiableURI`. We will use the `encodeData` function from the [_erc725.js_](../../../tools/erc725js/methods.md#encodedata) library to encode a `VerifiableURI` easily.
The value will be encoded as a `VerifiableURI`. We will use the `encodeData` function from the [_erc725.js_](../../../tools/libraries/erc725js/methods.md#encodedata) library to encode a `VerifiableURI` easily.

```js title="encodeVerifiableURI.ts"
import { ERC725 } from '@erc725/erc725.js';
Expand Down
4 changes: 2 additions & 2 deletions docs/learn/digital-assets/retrieve-token-type.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Token Types are beneficial because of the wide range of asset use cases. The [LS

:::tip Convenience Tools

You can use the ⚒️ [`erc725.js`](../../tools/erc725js/getting-started.md) library, which automatically decodes [ERC725Y](../../standards/lsp-background/erc725.md#erc725y-generic-data-keyvalue-store) storage keys for you.
You can use the ⚒️ [`erc725.js`](../../tools/libraries/erc725js/getting-started.md) library, which automatically decodes [ERC725Y](../../standards/lsp-background/erc725.md#erc725y-generic-data-keyvalue-store) storage keys for you.

If you are using a regular contract instance from Ethers or Web3, you can use the data keys from the [`lsp-smart-contracts`](../../tools/lsp-smart-contracts/getting-started.md) library by importing the `ERC725YDataKeys` constant.
If you are using a regular contract instance from Ethers or Web3, you can use the data keys from the [`lsp-smart-contracts`](../../tools/libraries/lsp-smart-contracts/getting-started.md) library by importing the `ERC725YDataKeys` constant.

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/digital-assets/token/create-lsp7-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';

# 🪙 Create a LSP7 Token

This guide will walk you through the process of creating and deploying a custom [LSP7 Digital Asset](../../../standards/tokens/LSP7-Digital-Asset.md) and pre-mint a certain amount of tokens to the token owner. To build a smart contract using LSPs, you can **inherit functionality** from modular and standardized presets in the [`@lukso/lsp-smart-contracts`](../../../tools/lsp-smart-contracts/getting-started.md) library. To learn more about the contract standards itself, please refer to the [Contracts section](../../../contracts/introduction.md) of our documentation.
This guide will walk you through the process of creating and deploying a custom [LSP7 Digital Asset](../../../standards/tokens/LSP7-Digital-Asset.md) and pre-mint a certain amount of tokens to the token owner. To build a smart contract using LSPs, you can **inherit functionality** from modular and standardized presets in the [`@lukso/lsp-smart-contracts`](../../../tools/libraries/lsp-smart-contracts/getting-started.md) library. To learn more about the contract standards itself, please refer to the [Contracts section](../../../contracts/introduction.md) of our documentation.

:::tip

Expand Down
4 changes: 2 additions & 2 deletions docs/learn/migrate/migrate-erc20-to-lsp7.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ const symbol = ethers.toUtf8String(symbolValue); // UP725

<TabItem value="erc725.js" label="erc725.js" attributes={{className: "tab_erc725"}}>

You can also obtain the full schema with all the definitions from our [`@erc725/erc725.js`](../../tools/erc725js/getting-started.md) library. **This library will also help you to [encode easily](../../tools/erc725js/methods.md#encodedata) data key value pairs.**
You can also obtain the full schema with all the definitions from our [`@erc725/erc725.js`](../../tools/libraries/erc725js/getting-started.md) library. **This library will also help you to [encode easily](../../tools/libraries/erc725js/methods.md#encodedata) data key value pairs.**

You can also import the [full schema definition](../../tools/erc725js/schemas.md) of the LSP4 Metadata from `@erc725/erc725.js`. The library can also provide convenience for fetching, encoding and decoding.
You can also import the [full schema definition](../../tools/libraries/erc725js/schemas.md) of the LSP4 Metadata from `@erc725/erc725.js`. The library can also provide convenience for fetching, encoding and decoding.

<!-- prettier-ignore-start -->

Expand Down
2 changes: 1 addition & 1 deletion docs/learn/migrate/migrate-erc721-to-lsp8.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const symbol = ethers.toUtf8String(symbolValue); // COOL

<TabItem value="erc725.js" label="erc725.js" attributes={{className: "tab_erc725"}}>

You can also obtain the [full schema definition](../../tools/erc725js/schemas.md) of the LSP4 Metadata from [`@erc725/erc725.js`](../../tools/erc725js/getting-started.md) library. **This library will also help you to [encode easily](../../tools/erc725js/methods.md#encodedata) data key value pairs.**
You can also obtain the [full schema definition](../../tools/libraries/erc725js/schemas.md) of the LSP4 Metadata from [`@erc725/erc725.js`](../../tools/libraries/erc725js/getting-started.md) library. **This library will also help you to [encode easily](../../tools/libraries/erc725js/methods.md#encodedata) data key value pairs.**

```javascript
import { ERC725 } from '@erc725/erc725.js';
Expand Down
4 changes: 2 additions & 2 deletions docs/learn/standard-detection.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ npm install web3 @erc725/erc725.js @lukso/lsp-smart-contracts

## Metadata Detection

You can verify if a contract contains a specific set of [ERC725Y](../standards/lsp-background/erc725#erc725y-generic-data-keyvalue-store) keys by checking the value stored under the ERC725Y storage key `SupportedStandards:{StandardName}` using the [erc725.js](../tools/erc725js/getting-started.md) library.
You can verify if a contract contains a specific set of [ERC725Y](../standards/lsp-background/erc725#erc725y-generic-data-keyvalue-store) keys by checking the value stored under the ERC725Y storage key `SupportedStandards:{StandardName}` using the [erc725.js](../tools/libraries/erc725js/getting-started.md) library.

:::note Example

**[LSP7DigitalAsset](../standards/tokens/LSP7-Digital-Asset.md)** is a contract that contains ERC725Y Data keys defined in **[LSP4 - Digital Asset Metadata](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-4-DigitalAsset-Metadata.md)**. Therefore, the contract **SHOULD** have the following ERC725Y Data keys set by default: `LSP4TokenName`, `LSP4TokenSymbol`, `LSP4Metadata`, `LSP4CreatorsMap:<address>` and `LSP4Creators[]`.

:::

Similar to the [Read Profile Data Guide](./universal-profile/metadata/read-profile-data.md), you can use the [`getData()`](../tools/erc725js/methods.md#getdata) function to check if the contract has a specific metadata standard like [LSP3 Profile](../standards/universal-profile/lsp3-profile-metadata), [LSP4 Digital Asset](../standards/tokens/LSP4-Digital-Asset-Metadata) or a [LSP9 Vault](../standards/universal-profile/lsp9-vault).
Similar to the [Read Profile Data Guide](./universal-profile/metadata/read-profile-data.md), you can use the [`getData()`](../tools/libraries/erc725js/methods.md#getdata) function to check if the contract has a specific metadata standard like [LSP3 Profile](../standards/universal-profile/lsp3-profile-metadata), [LSP4 Digital Asset](../standards/tokens/LSP4-Digital-Asset-Metadata) or a [LSP9 Vault](../standards/universal-profile/lsp9-vault).

### Example 1 - Detect LSP3 Profile data keys

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async function main() {

#### Create the permissions data keys and data values

In order to create all the permissions data keys and data values, we will use the [`@erc725/erc725.js`](../../../tools/erc725js/getting-started.md) library. This library is a JavaScript implementation to encode and decode data key and values easily from any ERC725Y contract storage.
In order to create all the permissions data keys and data values, we will use the [`@erc725/erc725.js`](../../../tools/libraries/erc725js/getting-started.md) library. This library is a JavaScript implementation to encode and decode data key and values easily from any ERC725Y contract storage.

```typescript
async function main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/learn/universal-profile/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ You can also create new [Universal Profiles](../../standards/universal-profile/i

:::tip Relayer API

If you want to deploy Universal Profiles for your users, please check out our [Relayer API](../../tools/relayer-developer.md).
If you want to deploy Universal Profiles for your users, please check out our [Relayer API](../../tools/services/relayer-developer.md).

:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ For this, we will encode the constructor parameters used when deploying the toke

2. set the metadata on the token contract.

For this we will first encode the `LSP4Metadata` using the [`erc725.js`](../../../tools/erc725js/getting-started.md) library. We will then generate the payload to call `setData` on the token contract using this encoded parameter.
For this we will first encode the `LSP4Metadata` using the [`erc725.js`](../../../tools/libraries/erc725js/getting-started.md) library. We will then generate the payload to call `setData` on the token contract using this encoded parameter.

> _"How can we set the token metadata if we don't know the deployed token address yet?"_
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ For more information regarding the construction of an LSP25 signature, see [**"S

The next step for the client side is to sign the transaction message. This is done using the private key of a controller that has some permission on the Universal Profile to execute the transaction on, without needing us to pay for the gas.

To do that, we will use our convenience library [_eip191-signer_](../../../tools/eip191-signerjs/getting-started.md) which make the signing for us.
To do that, we will use our convenience library [_eip191-signer_](../../../tools/libraries/eip191-signerjs/getting-started.md) which make the signing for us.

The transaction message is constructed by encoding and signing the following:

Expand Down
Loading

0 comments on commit a7a3a31

Please sign in to comment.