An open API service indexing awesome lists of open source software.

https://github.com/lukso-network/lukso-playground

Code snippets to interact with Universal Profiles and other LSP standards
https://github.com/lukso-network/lukso-playground

solidity universalprofiles web3js

Last synced: 4 months ago
JSON representation

Code snippets to interact with Universal Profiles and other LSP standards

Awesome Lists containing this project

README

          

# ๐Ÿคน LUKSO Playground

A comprehensive set of code examples and development playground for building on the LUKSO blockchain with the LSP standards.

This repository contains Typescript and Solidity code examples to help you get started building dApps and smart contracts with LUKSO's [LSP](https://docs.lukso.tech/standards/standards-roadmap) standards.

## ๐Ÿš€ Getting Started

### Prerequisites

**This repository uses [bun](https://bun.sh) to manage packages and run scripts. Make sure to [install it](https://bun.sh/docs/installation) first.**

### Installation

Clone this repository and install its dependencies:

```bash
git clone https://github.com/lukso-network/lukso-playground.git
cd lukso-playground && bun install
```

## ๐Ÿ“ Project Structure

### ๐ŸŒ DApps (`/dapps`)

Interactive examples and scripts demonstrating LUKSO standards integration:

- **[`universal-profile`](./dapps/universal-profile)**: Universal Profile related scripts
- **[`digital-assets`](./dapps/digital-assets)**: Digital assets (LSP7/8) scripts
- **[`interface-detection`](./dapps/interface-detection)**: Verify EIP165 Standard Compatibility
- **[`key-manager`](./dapps/key-manager)**: Permission Management of Controller Keys
- **[`metadata-detection`](./dapps/metadata-detection)**: Verify ERC725Y Storage Compatibility
- **[`transfer-lyx`](./dapps/transfer-lyx)**: Coin Transfers for Backend and Extension
- **[`universal-factory`](./dapps/universal-factory)**: Universal Factory related scripts

#### Running DApp Examples

Run any DApp script from the root directory:

```bash
bun run dapps/universal-profile/fetch-json-data.ts
```

See the [DApps README](./dapps/README.md) for detailed usage instructions.

### ๐Ÿ”จ Smart Contracts (`/smart-contracts`)

Hardhat-based smart contract development environment with example contracts and deployment scripts:

- **Example Contracts**: LSP1 Universal Receivers, LSP25 Delegated Voting, NFT collections (basic & dynamic), digital tokens (LSP7/LSP8)
- **Deployment Scripts**: Deploy tokens and collections as EOA or Universal Profile, attach metadata, mint tokens
- **Verification Tools**: Blockscout contract verification setup

#### Working with Smart Contracts

Navigate to the smart-contracts directory for contract development:

```bash
cd smart-contracts
# Install smart contract-specific dependencies
bun install
# Compile contracts
bun run compile
# Deploy contracts by running one of the scripts
bun hardhat --network luksoTestnet run
```

See the [Smart Contracts README](./smart-contracts/README.md) for detailed development instructions.

## ๐Ÿ› ๏ธ Key Technologies

### LUKSO Libraries

- **[`@erc725/erc725.js`](https://docs.lukso.tech/tools/erc725js/getting-started)**: Library for interacting with ERC725 contracts
- **[`@lukso/lsp-smart-contracts`](https://docs.lukso.tech/tools/lsp-smart-contracts/getting-started)**: LUKSO Standard Proposals smart contract implementations

## ๐ŸŒ Network Configuration

### LUKSO Networks

- **Mainnet**: `https://rpc.mainnet.lukso.network`
- **Testnet**: `https://rpc.testnet.lukso.network`

### IPFS Gateway

For development purposes, this repository uses:

- **IPFS Gateway**: `https://api.universalprofile.cloud/ipfs`

> โš ๏ธ **Production Recommendation**: We highly recommend that developers use their own IPFS gateway solutions like [Pinata](https://docs.pinata.cloud/docs/welcome-to-pinata) or [Infura](https://docs.metamask.io/services/how-to/use-ipfs/access-ipfs-content/) for production applications.

## ๐Ÿ“– Documentation

- [LUKSO Tech Docs](https://docs.lukso.tech/)
- [LSP Standards](https://docs.lukso.tech/standards/introduction/)
- [Universal Profile](https://docs.lukso.tech/standards/accounts/introduction/)
- [Digital Assets](https://docs.lukso.tech/standards/tokens/introduction/)

## ๐Ÿค Contributing

Contributions are welcome! Please check out our [Contributing Guidelines](./CONTRIBUTING.md) for details on how to get started.