Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update LSP3 Standard to SupportedStandards:LSP3Profile #595

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/guides/digital-assets/read-asset-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If using erc725.js in a NodeJS environment you may need to install and import [`
```javascript title="read_assets.js"
// Import and network setup
import { ERC725 } from '@erc725/erc725.js';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.json';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3ProfileMetadata.json';
import Web3 from 'web3';

// Static variables
Expand Down Expand Up @@ -100,7 +100,7 @@ If using erc725.js in a NodeJS environment you may need to install and import [`
```javascript title="read_assets.js"
// Import and network setup
import { ERC725 } from '@erc725/erc725.js';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.json';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3ProfileMetadata.json';
import Web3 from 'web3';

// Static variables
Expand Down Expand Up @@ -224,7 +224,7 @@ Below is the complete code snippet of this guide, with all the steps compiled to
```javascript title="read_assets.js"
// Import and network setup
import { ERC725 } from '@erc725/erc725.js';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.json';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3ProfileMetadata.json';
import LSP4Schema from '@erc725/erc725.js/schemas/LSP4DigitalAsset.json';
import Web3 from 'web3';

Expand Down Expand Up @@ -289,7 +289,7 @@ console.log(ownedAssetsMetadata);
```javascript title="read_assets.js"
// Import and network setup
import { ERC725 } from '@erc725/erc725.js';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.json';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3ProfileMetadata.json';
import LSP4Schema from '@erc725/erc725.js/schemas/LSP4DigitalAsset.json';
import Web3 from 'web3';
import LSP1MinimalABI from './lsp1_legacy_minimal_abi.json';
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ import { ERC725 } from '@erc725/erc725.js';
// https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-3-UniversalProfile.md
const schema = [
{
name: 'SupportedStandards:LSP3UniversalProfile',
name: 'SupportedStandards:LSP3Profile',
key: '0xeafec4d89fa9619884b6b89135626455000000000000000000000000abe425d6',
keyType: 'Mapping',
valueContent: '0xabe425d6',
valueContent: '0x5ef83ad9',
valueType: 'bytes',
},
{
Expand Down Expand Up @@ -148,7 +148,7 @@ console.log(data);

```json title="console.log(data)"
{
"SupportedStandards:LSP3UniversalProfile": "0xabe425d6",
"SupportedStandards:LSP3Profile": "0x5ef83ad9",
"LSP3Profile": {
"LSP3Profile": {
"name": "My Universal Profile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ if (!supportsLSP0Interface) {

## Step 3 - Check supported standard

Last but not least we should perform a check over `LSP3UniversalProfile` standard. For this we need to call `getData` with the `SupportedStandards:LSP3UniversalProfile` key.
Last but not least we should perform a check over `LSP3Profile-Metadata` standard. For this we need to call `getData` with the `SupportedStandards:LSP3Profile` key.

:::info

Expand All @@ -165,10 +165,10 @@ const web3 = new Web3('https://rpc.testnet.lukso.network');
const universalProfileAddress = "0x..."; // The address of the contract that you are verifying
const universalProfile = new web3.eth.Contract(UniversalProfile.abi, universalProfileAddress);

const supportedStandard = await universalProfile.methods['getData(bytes32)'](SupportedStandards.LSP3UniversalProfile.key).call();
const supportedStandard = await universalProfile.methods['getData(bytes32)'](SupportedStandards.LSP3Profile.key).call();

if (supportedStandard !== SupportedStandards.LSP3UniversalProfile.value) {
throw new Error('Address does not support LSP3UniversalProfile standard');
if (supportedStandard !== SupportedStandards.LSP3Profile.value) {
throw new Error('Address does not support LSP3Profile-Metadata standard');
}
```

Expand All @@ -190,10 +190,10 @@ const provider = new ethers.JsonRpcProvider('https://rpc.testnet.lukso.network')
const universalProfileAddress = '0x...'; // The address of the contract that you are verifying
const universalProfile = new ethers.Contract(universalProfileAddress, UniversalProfile.abi, provider);

const supportedStandard = await universalProfile['getData(bytes32)'](SupportedStandards.LSP3UniversalProfile.key);
const supportedStandard = await universalProfile['getData(bytes32)'](SupportedStandards.LSP3Profile.key);

if (supportedStandard !== SupportedStandards.LSP3UniversalProfile.value) {
throw new Error('Address does not support LSP3UniversalProfile standard');
if (supportedStandard !== SupportedStandards.LSP3Profile.value) {
throw new Error('Address does not support LSP3Profile-Metadata standard');
}
```

Expand Down Expand Up @@ -232,10 +232,10 @@ if (!supportsLSP0Interface) {
throw new Error('Contract does not support LSP0ERC725Account interface');
}

const supportedStandard = await universalProfile.methods['getData(bytes32)'](SupportedStandards.LSP3UniversalProfile.key).call();
const supportedStandard = await universalProfile.methods['getData(bytes32)'](SupportedStandards.LSP3Profile.key).call();

if (supportedStandard !== SupportedStandards.LSP3UniversalProfile.value) {
throw new Error('Address does not support LSP3UniversalProfile standard');
if (supportedStandard !== SupportedStandards.LSP3Profile.value) {
throw new Error('Address does not support LSP3Profile-Metadata standard');
}
```

Expand Down Expand Up @@ -268,10 +268,10 @@ if (!supportsLSP0Interface) {
throw new Error('Contract does not support LSP0ERC725Account interface');
}

const supportedStandard = await universalProfile['getData(bytes32)'](SupportedStandards.LSP3UniversalProfile.key);
const supportedStandard = await universalProfile['getData(bytes32)'](SupportedStandards.LSP3Profile.key);

if (supportedStandard !== SupportedStandards.LSP3UniversalProfile.value) {
throw new Error('Address does not support LSP3UniversalProfile standard');
if (supportedStandard !== SupportedStandards.LSP3Profile.value) {
throw new Error('Address does not support LSP3Profile-Metadata standard');
}
```

Expand Down
10 changes: 5 additions & 5 deletions docs/guides/universal-profile/read-profile-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To inspect the address and check if it has an ERC725 contract, we can call its i

- [LSP3 - Profile Metadata](../../standards/universal-profile/lsp3-profile-metadata) describes the data in the Universal Profile contract storage, and which data keys to use to retrieve it. We can import the schema directly from the [erc725.js](../../tools/erc725js/schemas#standard-lsp-schemas) library.

- `SupportedStandards` shows the interface using a Metadata Standard with a key. In our case we use `SupportedStandards:LSP3UniversalProfile` from to check if the contract is a Universal Profile.
- `SupportedStandards` shows the interface using a Metadata Standard with a key. In our case we use `SupportedStandards:LSP3Profile` from to check if the contract is a Universal Profile.
- `LSP3Profile` shows the data of the Universal Profile.
- `LSP12IssuedAssets[]` shows assets the Universal Profile issued.
- `LSP5ReceivedAssets[]` shows assets the Universal Profile received.
Expand Down Expand Up @@ -72,7 +72,7 @@ We will use the convenient `fetchData()` function since we only need one command
import Web3 from 'web3';
import { ERC725 } from '@erc725/erc725.js';
import 'isomorphic-fetch';
import erc725schema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.json';
import erc725schema from '@erc725/erc725.js/schemas/LSP3ProfileMetadata.json';

// Our static variables
const SAMPLE_PROFILE_ADDRESS = '0xa907c1904c22DFd37FF56c1f3c3d795682539196';
Expand Down Expand Up @@ -113,7 +113,7 @@ If everything went fine, we now have the profile's [LSP3 - Universal Profile Met
[
{
"key": "...",
"name": "SupportedStandards:LSP3UniversalProfile",
"name": "SupportedStandards:LSP3Profile",
"value": null
},
{
Expand Down Expand Up @@ -181,7 +181,7 @@ If everything went fine, we now have the profile's [LSP3 - Universal Profile Met

With the JSON response, we can fetch all sorts of data including:

- `SupportedStandards:LSP3UniversalProfile`: Check if the smart contract is an LSP3 Universal Profile
- `SupportedStandards:LSP3Profile`: Check if the smart contract is an LSP3 Universal Profile
- `LSP3Profile`: The data of the Universal Profile (name, description, tags, links, pictures)
- `LSP12IssuedAssets[]`: Assets the Universal Profile issued
- `LSP5ReceivedAssets[]`: Assets the Universal Profile received
Expand Down Expand Up @@ -227,7 +227,7 @@ Below is the complete code snippet of this guide, with all the steps compiled to
import Web3 from 'web3';
import { ERC725 } from '@erc725/erc725.js';
import 'isomorphic-fetch';
import erc725schema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.json';
import erc725schema from '@erc725/erc725.js/schemas/LSP3ProfileMetadata.json';

// Our static variables
const SAMPLE_PROFILE_ADDRESS = '0x0C03fBa782b07bCf810DEb3b7f0595024A444F4e';
Expand Down
8 changes: 4 additions & 4 deletions docs/standards/generic-standards/lsp2-json-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,19 @@ The data being mapped can be words that have a specific meaning for the protocol

Below are some examples of the **Mapping** key type.

- mapping to **words:** `SupportedStandards:LSP3UniversalProfile`, `SupportedStandards:LSP4DigitalAsset`, `SupportedStandards:LSP{N}{StandardName}`, etc...
- mapping to **words:** `SupportedStandards:LSP3Profile`, `SupportedStandards:LSP4DigitalAsset`, `SupportedStandards:LSP{N}{StandardName}`, etc...
- mapping to **`<mixed type>`**, like an `address`: `LSP5ReceivedAssetsMap:<address>`
- mapping to **`<mixed type>`**, like a `bytes32`: `LSP8MetadataAddress:<bytes32>`

#### Example 1: Mapping as `FirstWord:SecondWord`

```json
{
"name": "SupportedStandards:LSP3UniversalProfile",
"key": "0xeafec4d89fa9619884b60000abe425d64acd861a49b8ddf5c0b6962110481f38",
"name": "SupportedStandards:LSP3Profile",
"key": "0xeafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce616347",
"keyType": "Mapping",
"valueType": "bytes4",
"valueContent": "0xabe425d6"
"valueContent": "0x5ef83ad9"
}
```

Expand Down
8 changes: 4 additions & 4 deletions docs/standards/universal-profile/lsp3-profile-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ Make sure to understand the **[ERC725Y Generic Key/Value Store](../lsp-backgroun

:::

### `SupportedStandards:LSP3UniversalProfile`
### `SupportedStandards:LSP3Profile`

```json
{
"name": "SupportedStandards:LSP3UniversalProfile",
"key": "0xeafec4d89fa9619884b60000abe425d64acd861a49b8ddf5c0b6962110481f38",
"name": "SupportedStandards:LSP3Profile",
"key": "0xeafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce616347",
"keyType": "Mapping",
"valueType": "bytes4",
"valueContent": "0xabe425d6"
"valueContent": "0x5ef83ad9"
}
```

Expand Down