-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sync-playground-w-docs
- Loading branch information
Showing
27 changed files
with
363 additions
and
80 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"], | ||
"plugins": ["@typescript-eslint", "prettier"], | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 12, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"@typescript-eslint/no-explicit-any": "off" | ||
}, | ||
"ignorePatterns": ["smart-contracts-hardhat/"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
smart-contract-hardhat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,6 @@ | ||
{ | ||
"plugins": ["prettier-plugin-solidity"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.js", "*.ts"], | ||
"options": { | ||
"tabWidth": 2, | ||
"printWidth": 100, | ||
"trailingComma": "all", | ||
"singleQuote": true, | ||
"semi": true | ||
} | ||
}, | ||
{ | ||
"files": "*.sol", | ||
"options": { | ||
"tabWidth": 4, | ||
"printWidth": 80, | ||
"compiler": "0.8.15" | ||
} | ||
} | ||
] | ||
"trailingComma": "all", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# 💁♂️ Contributing to LUKSO Playground | ||
|
||
We're thrilled you're interested in contributing to the LUKSO Playground! This space is dedicated to providing developers with code snippets and tools for interacting with LUKSO standards efficiently. | ||
|
||
## Getting Started | ||
|
||
1. Create a fork of this repository. | ||
2. Clone your repository to make changes. | ||
3. Follow the installation within the [README.md](./README.md) | ||
|
||
## Making Changes | ||
|
||
1. **Create a separate branch**: For each new feature, docs, or fix, create a new branch in your fork like the following structure: `feature/feature-name` or `fix/issue-fix`, `docs/added-content`. The naming helps organize your contributions and separates them from your main branch. | ||
2. **Commit your changes**: After running `npm run build` and applying styles using `prettier`, you can commit your local changes to your branch. Please ensure that changes are regularly pulled from the `main` branch of the original repository to stay up-to-date and avoid conflicts. | ||
3. **Submit a pull request**: Once your changes are ready and tested, you can push the latest changes to your GitHub fork and `submit a pull request` to this repository. Please provide a clear and detailed explanation of the changes and why they are needed. Include any relevant `issue numbers`. | ||
4. **Review Process**: The project maintainers will review your pull request. Be open to feedback and be prepared to make further changes if requested. Once approved, a maintainer will `merge` your changes into the `main` branch. | ||
|
||
## Contribution Guidelines | ||
|
||
To ensure a smooth contribution process for everyone, please follow these guidelines: | ||
|
||
- **Maintain Generality**: This repository is designed as a generic foundation for developers to start building with LSPs efficiently. Contributions should not introduce features too specific or outside of the LSP ecosystem. | ||
- **Follow Code Styles**: Follow the coding conventions used throughout the project, including indentation, naming conventions, and comments. | ||
- **Build and Test**: Ensure your code does not break the existing functionality. Add tests for any new features or fixes when possible. Any upcoming features should not break existing scripts or contracts. | ||
- **Create Documentation**: Add or update any relevant documentation with your changes, especially if adding new features. | ||
|
||
## Report Bugs | ||
|
||
If you've found issues within contracts or scripts, please [open a new issue](https://github.com/lukso-network/lukso-playground/issues). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { ERC725 } from '@erc725/erc725.js'; | ||
import { EncodeDataInput } from '@erc725/erc725.js/build/main/src/types/decodeData.js'; | ||
import LSP4DigitalAssetSchema from '@erc725/erc725.js/schemas/LSP4DigitalAsset.json'; | ||
|
||
const LSP4SampleJSON = { | ||
LSP4Metadata: { | ||
name: 'CHILL', | ||
description: 'introducing $chill', | ||
links: [ | ||
{ | ||
title: 'X', | ||
url: 'https://twitter.com/chillwhales', | ||
}, | ||
{ | ||
title: 'Common Ground', | ||
url: 'https://app.cg/c/bZe26yK9Uh/', | ||
}, | ||
{ | ||
title: 'Chillwhales', | ||
url: 'https://chillwhales.com/', | ||
}, | ||
], | ||
icon: [ | ||
{ | ||
width: 1614, | ||
height: 1614, | ||
url: 'ipfs://bafkreigiidxipuk3y5ep5jygsfcs5pdqtfjhkges7hlpimt3mqksznoeyu', | ||
verification: { | ||
method: 'keccak256(bytes)', | ||
data: '0x583d661aed68417e9fd1500f629c8d9cd6fadd9c31e948b2a6870b66c4f3bc03', | ||
}, | ||
}, | ||
], | ||
images: [ | ||
[ | ||
{ | ||
width: 480, | ||
height: 480, | ||
url: 'ipfs://bafybeihejctjezrjiid3ed4aw5dq3vxlwqfvigdu77ucpszgtmitlza5ty', | ||
verification: { | ||
method: 'keccak256(bytes)', | ||
data: '0xd1ee7a4fe6d0a05f2929a8e47a68f1828d0145d113567a432391becf2ba83cbf', | ||
}, | ||
}, | ||
], | ||
], | ||
backgroundImage: [ | ||
{ | ||
width: 1200, | ||
height: 400, | ||
url: 'ipfs://bafybeiglmtsb7k7bhchfxphazb6lqln45uaox3lqvx557dk5he5wqxqp2i', | ||
verification: { | ||
method: 'keccak256(bytes)', | ||
data: '0xd22f654e7dee3971ff32220b8c91ddd3427842392087a9bcae8d218915859eee', | ||
}, | ||
}, | ||
], | ||
assets: [], | ||
}, | ||
}; | ||
|
||
const lsp4SampleMetadata: EncodeDataInput[] = [ | ||
{ | ||
keyName: 'LSP4Metadata', | ||
value: { | ||
json: LSP4SampleJSON, | ||
url: 'ipfs://QmQTqheBLZFnQUxu5RDs8tA9JtkxfZqMBcmGd9sukXxwRm', // replace with example IPFS url | ||
}, | ||
}, | ||
]; | ||
|
||
// Encode the new LSP4 metadata as Verifiable URI | ||
// https://docs.lukso.tech/tools/erc725js/classes/ERC725#encodedata | ||
const encodedLSP4Metadata = ERC725.encodeData( | ||
lsp4SampleMetadata, | ||
LSP4DigitalAssetSchema, | ||
); | ||
console.log(encodedLSP4Metadata); | ||
|
||
const decodedLSP4Metadata = ERC725.decodeData( | ||
[ | ||
{ | ||
keyName: encodedLSP4Metadata.keys[0], | ||
value: encodedLSP4Metadata.values[0], | ||
}, | ||
], | ||
LSP4DigitalAssetSchema, | ||
); | ||
|
||
console.log(JSON.stringify(decodedLSP4Metadata, undefined, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.