-
Notifications
You must be signed in to change notification settings - Fork 69
docs: Add comprehensive Setting your Grid guide (LSP28) #1318
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
Conversation
- Full LSP28 Grid specification coverage with all element types - VerifiableURI encoding breakdown with header format table - Encoding examples using erc725.js (IPFS and on-chain base64 tabs) - Setting data on-chain in 3 tabs: viem, ethers, web3.js - Reading Grid data back with erc725.js - Troubleshooting section for common errors - Links to LSP28 spec, LSP2, and related guides
6a66831 to
08b262b
Compare
Deployed with Cloudflare Pages ☁️ 🚀 🆗 |
| <br /><br /> | ||
| </div> | ||
|
|
||
| The **Grid** ([LSP28](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-28-TheGrid.md)) is a standard that lets Universal Profiles display **customizable, modular layouts** made of mini-apps, social media embeds, images, text, and other interactive content. Think of it as a personal dashboard you can attach to any Universal Profile — or even to [LSP7](/standards/tokens/LSP7-Digital-Asset.md) and [LSP8](/standards/tokens/LSP8-Identifiable-Digital-Asset.md) token contracts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line as not implemented in ue.io yet
| The **Grid** ([LSP28](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-28-TheGrid.md)) is a standard that lets Universal Profiles display **customizable, modular layouts** made of mini-apps, social media embeds, images, text, and other interactive content. Think of it as a personal dashboard you can attach to any Universal Profile — or even to [LSP7](/standards/tokens/LSP7-Digital-Asset.md) and [LSP8](/standards/tokens/LSP8-Identifiable-Digital-Asset.md) token contracts. | |
| The **Grid** ([LSP28](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-28-TheGrid.md)) is a standard that lets Universal Profiles display **customizable, modular layouts** made of mini-apps, social media embeds, images, text, and other interactive content. Think of it as a personal dashboard you can attach to any Universal Profile. |
|
|
||
| 1. Understanding the Grid JSON structure and all available element types | ||
| 2. Encoding the Grid as a [VerifiableURI](/standards/metadata/lsp2-json-schema.md#verifiableuri) | ||
| 3. Writing the encoded data on-chain to your Universal Profile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. Writing the encoded data on-chain to your Universal Profile | |
| 3. encode the grid data either on-chain as base64 or off-chain on IPFS | |
| 4. set it on your Universal Profile via `setData(bytes32,bytes)` |
| ## Prerequisites | ||
|
|
||
| - A **Universal Profile** on LUKSO (mainnet or testnet) | ||
| - A **controller EOA** private key with [`SETDATA` permission](/standards/access-control/lsp6-key-manager.md#permissions) on the profile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for that, as this is a dApp guide. It will be run through the UP Browser extension. So you don't need the controller private key.
You will just use { from: upAddress } in the tx.
|
|
||
| - A **Universal Profile** on LUKSO (mainnet or testnet) | ||
| - A **controller EOA** private key with [`SETDATA` permission](/standards/access-control/lsp6-key-manager.md#permissions) on the profile | ||
| - **Node.js** ≥ 18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to remove
|
|
||
| ## The LSP28 Data Key | ||
|
|
||
| The Grid data is stored under a single [ERC725Y](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md) data key: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The Grid data is stored under a single [ERC725Y](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-725.md) data key: | |
| The Grid data is stored under a single [ERC725Y](http://docs.lukso.tech/standards/erc725/#erc725y-generic-data-keyvalue-store) data key: |
|
|
||
| Once you have the encoded key-value pair, call [`setData`](/contracts/contracts/ERC725/ERC725.md) on the Universal Profile contract. Modern Universal Profiles have the [Key Manager (LSP6)](/standards/access-control/lsp6-key-manager.md) built-in, so you call `setData` directly on the UP from a controller address. | ||
|
|
||
| :::warning Do NOT Wrap in `execute()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this callout
| <TabItem value="viem" label="viem + wagmi" default> | ||
|
|
||
| ```shell | ||
| npm install viem @erc725/erc725.js @lukso/lsp-smart-contracts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| npm install viem @erc725/erc725.js @lukso/lsp-smart-contracts | |
| npm install wagmi viem@2.x @tanstack/react-query @erc725/erc725.js @lukso/lsp-smart-contracts |
| // --- Configuration --- | ||
| const PRIVATE_KEY = '0x...'; // Controller EOA private key (with SETDATA permission) | ||
| const UP_ADDRESS = '0x...'; // Your Universal Profile address | ||
| const RPC_URL = 'https://rpc.lukso.network'; // Use https://rpc.testnet.lukso.network for testnet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const RPC_URL = 'https://rpc.lukso.network'; // Use https://rpc.testnet.lukso.network for testnet | |
| const RPC_URL = 'https://rpc.mainnet.lukso.network'; // Use https://rpc.testnet.lukso.network for testnet |
| import UniversalProfile from '@lukso/lsp-smart-contracts/artifacts/UniversalProfile.json'; | ||
|
|
||
| // --- Configuration --- | ||
| const PRIVATE_KEY = '0x...'; // Controller EOA private key (with SETDATA permission) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code snippet needs to be refactored. We don't use a private key and wallet, we call the UP contract directly with the UP address retrieved from the Browser extension.
in wagmi + viem
const { address: UP_ADDRESS } = useAccount()See other guides for ethers + web3.js examples
| <details> | ||
| <summary><strong>❌ Grid doesn't show up on Universal Everything</strong></summary> | ||
|
|
||
| 1. Verify the data was written correctly by reading it back (see [Reading the Grid](#reading-the-grid)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. Verify the data was written correctly by reading it back (see [Reading the Grid](#reading-the-grid)) | |
| 1. Verify the data was written correctly by reading it back. Use [**ERC725 Inspect Tool**](https://erc725-inspect.lukso.tech/inspector?address=0x26e7Da1968cfC61FB8aB2Aad039b5A083b9De21e) or see the [Reading the Grid guide](#reading-the-grid)) |
- Replace image with updated screenshot - Remove LSP7/LSP8 mention (not implemented in ue.io yet) - Simplify prerequisites (UP Browser Extension, no private key needed) - Add wagmi + @tanstack/react-query to viem dependencies - Add full LSP28TheGrid JSON template in collapsible block - Convert all element types to collapsible <details> sections - Update VerifiableURI table with both off-chain and on-chain methods - Add separate paragraphs for IPFS vs on-chain header formats - Move gas cost callout under Encoding section heading - Move IPFS upload tip above code example - Simplify Setting Data intro, remove execute() warning - Refactor all code examples to use UP Browser Extension pattern (wagmi hooks, ethers BrowserProvider, web3 window.lukso) - Update RPC URL to rpc.mainnet.lukso.network - Update troubleshooting with ERC725 Inspect Tool link
…ction and improve descriptions
Summary
Adds a production-ready guide for setting up LSP28 Grid on Universal Profiles at
docs/learn/mini-apps/setting-your-grid.md.What's Included
Content Coverage
0x00006f357c6a0020)Code Examples
fetchData()Developer Experience
Technical Accuracy
setData()called directly on UP (not wrapped inexecute())Related