Skip to content

Commit

Permalink
chore: refactor settings of LSP16 package
Browse files Browse the repository at this point in the history
  • Loading branch information
YamenMerhi committed Jan 24, 2024
1 parent e23092f commit 3d7eb81
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 64 deletions.
2 changes: 1 addition & 1 deletion dodoc/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const dodocConfig = {
'contracts/LSP9Vault/LSP9Vault.sol',
'contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol',
'contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol',
'contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol',
'packages/LSP16UniversalFactory/contracts/LSP16UniversalFactory.sol',
'contracts/LSP17ContractExtension/LSP17Extendable.sol',
'contracts/LSP17ContractExtension/LSP17Extension.sol',
'contracts/LSP17Extensions/Extension4337.sol',
Expand Down
1 change: 0 additions & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ const config: HardhatUserConfig = {
// Tools
// ------------------
'Create2Factory',
'LSP16UniversalFactory',
'LSP23LinkedContractsFactory',
],
// Whether to include the TypeChain factories or not.
Expand Down
52 changes: 2 additions & 50 deletions packages/LSP16UniversalFactory/README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,3 @@
# LSP Package Template
# LSP16 Universal Factory

This project can be used as a skeleton to build a package for a LSP implementation in Solidity (LUKSO Standard Proposal)

It is based on Hardhat.

## How to setup a LSP as a package?

1. Copy the `template/` folder and paste it under the `packages/` folder. Then rename this `template/` folder that you copied with the LSP name.

You can do so either:

- manually, by copying the folder and pasting it inside `packages` and then renaming it.
or
- by running the following command from the root of the repository.

```bash
cp -r template packages/lsp-name
```

2. Update the `"name"` and `"description"` field inside the `package.json` for this LSP package you just created.

3. Setup the dependencies

If this LSP uses external dependencies like `@openzeppelin/contracts`, put them under `dependencies` with the version number.

```json
"@openzeppelin/contracts": "^4.9.3"
```

If this LSP uses other LSP as dependencies, put each LSP dependency as shown below. This will use the current code in the package:

```json
"@lsp2": "*"
```

4. Setup the npm commands for linting, building, testing, etc... under the `"scripts"` in the `package.json`

5. Test that all commands you setup run successfully

By running the commands below, your LSP package should come up in the list of packages that Turbo is running this command for.

```bash
turbo build
turbo lint
turbo lint:solidity
turbo test
turbo test:foundry
```

6. Finally update the relevant information in the `README.md` file in the folder of the newly created package, such as the title at the top, some description, etc...
Package for the [LSP16-UniversalFactory](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-16-UniversalFactory.md) standard, contains a contract that allows deploying contracts on multiple chains with the same address.
4 changes: 3 additions & 1 deletion packages/LSP16UniversalFactory/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ const config: HardhatUserConfig = {
},
packager: {
// What contracts to keep the artifacts and the bindings for.
contracts: [],
contracts: [

Check failure on line 116 in packages/LSP16UniversalFactory/hardhat.config.ts

View workflow job for this annotation

GitHub Actions / build

Replace `⏎······"LSP16UniversalFactory"⏎····` with `'LSP16UniversalFactory'`
"LSP16UniversalFactory"
],
// Whether to include the TypeChain factories or not.
// If this is enabled, you need to run the TypeChain files through the TypeScript compiler before shipping to the registry.
includeFactories: true,
Expand Down
9 changes: 0 additions & 9 deletions packages/LSP16UniversalFactory/remappings.txt

This file was deleted.

7 changes: 5 additions & 2 deletions tests/LSP16UniversalFactory/LSP16UniversalFactory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { FakeContract, smock } from '@defi-wonderland/smock';

import {
LSP1UniversalReceiverDelegateUP__factory,
LSP16UniversalFactory,
LSP16UniversalFactory__factory,
UniversalProfileInit,
UniversalProfileInit__factory,
LSP1UniversalReceiverDelegateUP,
Expand All @@ -20,6 +18,11 @@ import {
LSP6KeyManager__factory,
} from '../../types';

import {
LSP16UniversalFactory,
LSP16UniversalFactory__factory,
} from '../../packages/LSP16UniversalFactory/types';

import web3 from 'web3';

import type { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers';
Expand Down

0 comments on commit 3d7eb81

Please sign in to comment.