Skip to content

Commit

Permalink
Merge pull request #1139 from lukso-network/smart-contracts-packages
Browse files Browse the repository at this point in the history
Add list of LSP smart contract packages + instruction to install with Foundry
  • Loading branch information
CJ42 authored Sep 4, 2024
2 parents 518ca22 + 493703e commit 37cdaae
Showing 1 changed file with 95 additions and 8 deletions.
103 changes: 95 additions & 8 deletions docs/contracts/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,62 @@ import {ContractCardsGallery} from '@site/src/components/ContractCardsGallery';

# Smart Contracts

> The smart contracts are public and open source on [GitHub](https://github.com/lukso-network/lsp-smart-contracts). <a href="https://github.com/lukso-network/lsp-smart-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="github badge" class="shield-badge" src="https://img.shields.io/github/v/release/lukso-network/lsp-smart-contracts?logo=github&label=Github"/></a>
>
> They are available as a npm package [`@lukso/lsp-smart-contracts`](https://www.npmjs.com/package/@lukso/lsp-smart-contracts). <a href="https://www.npmjs.com/package/@lukso/lsp-smart-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp-smart-contracts.svg?style=flat&label=NPM&logo=npm"/></a>
<br/>

**Welcome to the LUKSO Smart Contracts documentation!**

In this section, you will find all the documentation and resources related to the `@lukso/lsp-smart-contracts`, the reference contract implementations in Solidity of the **[LUKSO Standard Proposals](../standards/introduction.md)**.
You will find on this page all the documentation and resources related to the `@lukso/lsp-smart-contracts`, the reference implementation in Solidity of the **[LSPs (LUKSO Standard Proposals)](../standards/introduction.md)**.

The `@lukso/lsp-smart-contracts` codebase is modular, with each LSP standard and features implemented in separate contracts. This allows smart contract developers to _"pick and choose"_ the contracts for the requirements and behaviors they need for their protocols and applications.
Each LSP standard and features are implemented in separate contracts under their own package. This allows developers to *"pick and choose"* the contracts for the requirements and behaviours they need for their protocols and applications. The `@lukso/lsp-smart-contracts` package also contains all the LSPs implementations listed below.

This modular design also helps in making the codebase easier to navigate and understand for developers using it.

<div style={{display: "flex", justifyContent: "space-between"}}>

<div style={{width: "**46**%"}}>

| Package | Version |
| :----------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`@lukso/lsp-smart-contracts`](https://github.com/lukso-network/lsp-smart-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp-smart-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp-smart-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp0-contracts`](https://github.com/lukso-network/lsp0-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp0-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp0-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp1-contracts`](https://github.com/lukso-network/lsp1-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp1-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp1-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp1delegate-contracts`](https://github.com/lukso-network/lsp1delegate-contracts) | <a href="https://www.npmjs.com/package/@lukso/lspdelegate-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lspdelegate-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp2-contracts`](https://github.com/lukso-network/lsp2-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp2-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp2-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp3-contracts`](https://github.com/lukso-network/lsp3-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp3-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp3-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp4-contracts`](https://github.com/lukso-network/lsp4-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp4-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp4-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp5-contracts`](https://github.com/lukso-network/lsp5-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp5-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp5-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp6-contracts`](https://github.com/lukso-network/lsp6-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp6-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp6-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp7-contracts`](https://github.com/lukso-network/lsp7-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp7-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp7-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp8-contracts`](https://github.com/lukso-network/lsp8-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp8-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp8-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp9-contracts`](https://github.com/lukso-network/lsp9-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp9-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp9-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |

</div>

<div style={{width: "50%"}}>

| Package | Version |
| :------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`@lukso/lsp10-contracts`](https://github.com/lukso-network/lsp10-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp10-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp10-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp11-contracts`](https://github.com/lukso-network/lsp11-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp11-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp11-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp12-contracts`](https://github.com/lukso-network/lsp12-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp12-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp12-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp14-contracts`](https://github.com/lukso-network/lsp14-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp14-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp14-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp16-contracts`](https://github.com/lukso-network/lsp16-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp16-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp16-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp17-contracts`](https://github.com/lukso-network/lsp17-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp17-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp17-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp17contractextension-contracts`](https://github.com/lukso-network/lsp17contractextension-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp17contractextension-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp17contractextension-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp20-contracts`](https://github.com/lukso-network/lsp20-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp20-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp20-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp23-contracts`](https://github.com/lukso-network/lsp23-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp23-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp23-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp25-contracts`](https://github.com/lukso-network/lsp25-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp25-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp25-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/lsp26-contracts`](https://github.com/lukso-network/lsp26-contracts) | <a href="https://www.npmjs.com/package/@lukso/lsp26-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/lsp26-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |
| [`@lukso/universalprofile-contracts`](https://github.com/lukso-network/universalprofile-contracts) | <a href="https://www.npmjs.com/package/@lukso/universalprofile-contracts" target="_blank" rel="noopener noreferrer"><img style={{verticalAlign: 'middle'}} alt="npm badge" class="shield-badge" src="https://img.shields.io/npm/v/@lukso/universalprofile-contracts.svg?style=flat&label=NPM&logo=npm"/></a> |

</div>

</div>

## Installation

### with npm, yarn or pnpm

To get all the LSP smart contracts, install the `@lukso/lsp-smart-contracts`.

<Tabs>
<TabItem value="npm" label="npm">

Expand Down Expand Up @@ -52,6 +92,53 @@ pnpm add @lukso/lsp-smart-contracts

</Tabs>

You can also install individual package based on the LSP that you need (see table above). For instance, if you only need the LSP7 Digital Asset contract implementation for your project, simply install the `@lukso/lsp7-contracts` package.

<Tabs>
<TabItem value="npm" label="npm">

```bash
npm install @lukso/lsp7-contracts
```

</TabItem>

<TabItem value="yarn" label="yarn">

```bash
yarn add @lukso/lsp7-contracts
```

</TabItem>

<TabItem value="pnpm" label="pnpm">

```bash
pnpm add @lukso/lsp7-contracts
```

</TabItem>

</Tabs>

### with Foundry

Currently, the monorepo structure of the LSP Smart Contracts create issues when installing via Foundry and forge. As a workaround, it is recommend to use the following method:

1. install the smart contract package with your preferred package manager as shown above (npm, yarn or pnpm).

```bash
npm i @lukso/lsp7-contracts
```

2. add the following in your `remappings.txt` or `foundry.toml`.

```txt title="remappings.txt"
@lukso/=node_modules/@lukso/
```

This will install the LUKSO LSP Solidity contracts in your `node_modules/` folder and forge will remap your `import @lukso/...` statements in your `.sol` files by locating the LSP contracts in the `node_modules/` folder.

## Overview

Overall the contracts can be divided by their usage.
Expand Down

0 comments on commit 37cdaae

Please sign in to comment.