Skip to content

Commit

Permalink
Merge pull request #601 from lukso-network/revert-595-lsp3SupportedSt…
Browse files Browse the repository at this point in the history
…andard

Revert "Update LSP3 Standard to `SupportedStandards:LSP3Profile`"
  • Loading branch information
CJ42 authored Aug 14, 2023
2 parents c54425c + 363e705 commit 927b678
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
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/LSP3ProfileMetadata.json';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.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/LSP3ProfileMetadata.json';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.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/LSP3ProfileMetadata.json';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.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/LSP3ProfileMetadata.json';
import UniversalProfileSchema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.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:LSP3Profile',
name: 'SupportedStandards:LSP3UniversalProfile',
key: '0xeafec4d89fa9619884b6b89135626455000000000000000000000000abe425d6',
keyType: 'Mapping',
valueContent: '0x5ef83ad9',
valueContent: '0xabe425d6',
valueType: 'bytes',
},
{
Expand Down Expand Up @@ -148,7 +148,7 @@ console.log(data);

```json title="console.log(data)"
{
"SupportedStandards:LSP3Profile": "0x5ef83ad9",
"SupportedStandards:LSP3UniversalProfile": "0xabe425d6",
"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 `LSP3Profile-Metadata` standard. For this we need to call `getData` with the `SupportedStandards:LSP3Profile` key.
Last but not least we should perform a check over `LSP3UniversalProfile` standard. For this we need to call `getData` with the `SupportedStandards:LSP3UniversalProfile` 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.LSP3Profile.key).call();
const supportedStandard = await universalProfile.methods['getData(bytes32)'](SupportedStandards.LSP3UniversalProfile.key).call();

if (supportedStandard !== SupportedStandards.LSP3Profile.value) {
throw new Error('Address does not support LSP3Profile-Metadata standard');
if (supportedStandard !== SupportedStandards.LSP3UniversalProfile.value) {
throw new Error('Address does not support LSP3UniversalProfile 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.LSP3Profile.key);
const supportedStandard = await universalProfile['getData(bytes32)'](SupportedStandards.LSP3UniversalProfile.key);

if (supportedStandard !== SupportedStandards.LSP3Profile.value) {
throw new Error('Address does not support LSP3Profile-Metadata standard');
if (supportedStandard !== SupportedStandards.LSP3UniversalProfile.value) {
throw new Error('Address does not support LSP3UniversalProfile 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.LSP3Profile.key).call();
const supportedStandard = await universalProfile.methods['getData(bytes32)'](SupportedStandards.LSP3UniversalProfile.key).call();

if (supportedStandard !== SupportedStandards.LSP3Profile.value) {
throw new Error('Address does not support LSP3Profile-Metadata standard');
if (supportedStandard !== SupportedStandards.LSP3UniversalProfile.value) {
throw new Error('Address does not support LSP3UniversalProfile 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.LSP3Profile.key);
const supportedStandard = await universalProfile['getData(bytes32)'](SupportedStandards.LSP3UniversalProfile.key);

if (supportedStandard !== SupportedStandards.LSP3Profile.value) {
throw new Error('Address does not support LSP3Profile-Metadata standard');
if (supportedStandard !== SupportedStandards.LSP3UniversalProfile.value) {
throw new Error('Address does not support LSP3UniversalProfile 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:LSP3Profile` 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:LSP3UniversalProfile` 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/LSP3ProfileMetadata.json';
import erc725schema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.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:LSP3Profile",
"name": "SupportedStandards:LSP3UniversalProfile",
"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:LSP3Profile`: Check if the smart contract is an LSP3 Universal Profile
- `SupportedStandards:LSP3UniversalProfile`: 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/LSP3ProfileMetadata.json';
import erc725schema from '@erc725/erc725.js/schemas/LSP3UniversalProfileMetadata.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:LSP3Profile`, `SupportedStandards:LSP4DigitalAsset`, `SupportedStandards:LSP{N}{StandardName}`, etc...
- mapping to **words:** `SupportedStandards:LSP3UniversalProfile`, `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:LSP3Profile",
"key": "0xeafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce616347",
"name": "SupportedStandards:LSP3UniversalProfile",
"key": "0xeafec4d89fa9619884b60000abe425d64acd861a49b8ddf5c0b6962110481f38",
"keyType": "Mapping",
"valueType": "bytes4",
"valueContent": "0x5ef83ad9"
"valueContent": "0xabe425d6"
}
```

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:LSP3Profile`
### `SupportedStandards:LSP3UniversalProfile`

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

Expand Down

0 comments on commit 927b678

Please sign in to comment.