Skip to content
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

build!: move @lukso/lsp-smart-contracts as its own package #894

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
49af5a2
build!: upgrade hardhat and ethers to v6
CJ42 Feb 14, 2024
131972c
chore: update test helper and fixtures to ethers v6
CJ42 Feb 15, 2024
19081a7
test: refactor tests for UP, LSP3, LSP14 and LSP17
CJ42 Feb 15, 2024
c4a9450
test: refactor LSP2 and LSP11 for ethers v6
CJ42 Feb 15, 2024
eff3f26
test: refactor tests to ethers v6 for LSP9 and LSP14
CJ42 Feb 15, 2024
2631961
test: refactor tests to ethers v6 for LSP7 and LSP8
CJ42 Feb 16, 2024
54296ee
test: refactor LSP11 tests to ethers v6
CJ42 Feb 17, 2024
1ade771
test: refactor LSP1 tests for ethers v6
CJ42 Feb 17, 2024
3771bd4
test: refactor LSP6 + LSP20 tests for ethers v6
CJ42 Feb 17, 2024
993f9d9
test: refactor Reentrancy tests for ethers v6
CJ42 Feb 17, 2024
3a772c8
test: refactor LSP1, Mocks and generic scripts
CJ42 Feb 17, 2024
83c1db1
chore: replace paths and `getSigHash` by `getFunction`
CJ42 Feb 18, 2024
07a60f9
test: fix more failing ethers v6 types and functions
CJ42 Feb 18, 2024
9dd9fc4
Merge branch 'lsp-monorepo' into build/upgrade-dependencies
CJ42 Feb 19, 2024
adb776e
chore: remove user/dev docs from `package.json`
CJ42 Feb 19, 2024
b88acfc
chore: fix remaining failing tests in CI
CJ42 Feb 19, 2024
462a5de
chore: fix remaining failing tests in CI
CJ42 Feb 19, 2024
f74db97
chore: fix tests for missing LSP1 Delegate permissions
CJ42 Feb 20, 2024
57f818d
chore: update incorrect path for contract artifact
CJ42 Feb 20, 2024
77bb2c5
chore: fix remaining tests
CJ42 Feb 20, 2024
4d7bf33
refactor: migrate `Create2Factory` to ethers v6
b00ste Feb 22, 2024
a16853e
Merge branch 'lsp-monorepo' into build/upgrade-dependencies
CJ42 Feb 27, 2024
f38759f
test: skip `lsp17extensions` test because of NickFactory deployment e…
CJ42 Feb 27, 2024
175ae97
chore: upgrade deployment scripts to ethers v6
CJ42 Feb 27, 2024
2a6c777
build: resolve dependency resolution for `hardhat-packager` and `@typ…
CJ42 Feb 28, 2024
17bba8d
chore: delete dev-dependency in packages to keep only those at root
CJ42 Feb 28, 2024
e3d6324
chore!: move `@lukso/lsp-smart-contracts` in its own package
CJ42 Feb 28, 2024
a83a12b
build: move all the build and config files into `packages/lsp-smart-c…
CJ42 Feb 28, 2024
f4fc047
test: move all the tests/ under `packages/lsp-smart-contracts`
CJ42 Feb 28, 2024
3f716dc
build: organise `package.json` for root and `@lukso/lsp-smart-contracts`
CJ42 Feb 28, 2024
2e912fc
build: cleanup test and scripts commands from root to package
CJ42 Feb 28, 2024
1445310
ci: adjust CI for build lint test for all packages
CJ42 Feb 28, 2024
e2e2d30
chore: remap import paths for `LSP0ERC725Account` to `@lukso/lsp0-con…
CJ42 Feb 28, 2024
e7197ce
chore: remap import paths for `LSP2ERC75YJSONSchema` to `@lukso/lsp2-…
CJ42 Feb 28, 2024
906f3b9
ci: update CI job path runner for `solc_version`
CJ42 Feb 28, 2024
9b10b45
build: tmp turn off global import disallowed in `.sol` file for `lsp-…
CJ42 Feb 28, 2024
d3b06ba
chore: remap import paths
b00ste Feb 28, 2024
1873dc9
test: fix Benchmark tests for ethers v6 syntax
CJ42 Feb 28, 2024
131cbc5
chore: fix some Solidity import path compiler errors
CJ42 Feb 28, 2024
44f199a
build: update `package-lock.json`
CJ42 Feb 28, 2024
0fc6d7b
test: update foundry tests setting for `@lukso/lsp-smart-contracts`
CJ42 Feb 28, 2024
bd41894
chore: add missing environnement variable in `turbo.json`
CJ42 Feb 28, 2024
5378c3a
test: repair tests that import helpers from root
b00ste Feb 28, 2024
44841fc
chore: fix types imports in tests
b00ste Feb 28, 2024
25ba134
build: adjust foundry build settings to prevent race condition when i…
CJ42 Feb 28, 2024
c1b5ad2
chore: ignore temporarily lsp16 package for foundry tests
CJ42 Feb 29, 2024
207b816
ci: disable temporarily foundry gas report in CI
CJ42 Feb 29, 2024
1a00ad2
Merge branch 'lsp-monorepo' into package/lukso-lsp-smart-contracts
CJ42 Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 0 additions & 9 deletions .eslintrc.js

This file was deleted.

108 changes: 14 additions & 94 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Node.js CI - Build + Lint + Test
on: pull_request

jobs:
build:
build-lint-test:
runs-on: ubuntu-latest

steps:
Expand All @@ -22,107 +22,27 @@ jobs:
run: npm ci

- name: 🔍 Run Solidity Linter
run: |
npm run lint:solidity
npm run lint:turbo:solidity
run: npm run lint:solidity

- name: 🎨 Run ESLint on JS/TS files
run: |
npm run lint
npm run lint:turbo
run: npm run lint

# This will also generate the Typechain types used by the Chai tests
- name: 🏗️ Build contract artifacts
run: |
npm run build
npm run build:turbo
npm run build:js
npm run build:js:turbo

- name: 📤 cache dependencies + build
uses: actions/cache@v4
with:
path: |
artifacts
node_modules
dist
types
contracts.ts
packages/**/types
packages/**/dist
key: ${{ github.run_id }}

- name: 📚 generate ABI docs
run: npm run build:docs

- name: 🔍 check if ABI auto-generated docs need to be updated
run: |-
if [[ $(git diff --name-only) != "" ]];
then
echo "Error: Please generate ABI docs after making changes to Solidity code and Natspec comments!"
exit 1
fi

- name: 🧪 Run Turbo tests
run: npm run test:turbo

test-suites:
strategy:
matrix:
lsp: [
"up",
"upinit",
"lsp1",
"lsp6",
"lsp6init",
"lsp7",
"lsp7init",
"lsp8",
"lsp8init",
"lsp9",
"lsp9init",
"lsp11",
"lsp11init",
"lsp17",
# Deploying NickFactory currently fails with latest Hardhat version. Commenting out temporarily until resolved
# See following issue: https://github.com/NomicFoundation/hardhat/issues/4939
# "lsp17extensions",
"lsp20",
"lsp20init",
"lsp23",
"reentrancy",
"reentrancyinit",
"mocks",
]

runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3

- name: 📥 restore cache
uses: actions/cache@v4
id: "build-cache"
with:
path: |
artifacts
node_modules
dist
types
contracts.ts
packages/**/types
packages/**/dist
key: ${{ github.run_id }}

- name: Use Node.js v20
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "npm"
# - name: 📚 generate ABI docs
# run: npm run build:docs

- name: Install dependencies
if: steps.build-cache.outputs.cache-hit != 'true'
run: npm ci
# - name: 🔍 check if ABI auto-generated docs need to be updated
# run: |-
# if [[ $(git diff --name-only) != "" ]];
# then
# echo "Error: Please generate ABI docs after making changes to Solidity code and Natspec comments!"
# exit 1
# fi

- name: 🧪 run tests
run: npm run test:${{ matrix.lsp }}
- name: 🧪 Run tests for each package
run: npm run test
38 changes: 20 additions & 18 deletions .github/workflows/foundry-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:
# compare gas diff only when editing Solidity smart contract code
paths:
- "contracts/**/*.sol"
- "tests/foundry/**/*.sol"
- "packages/**/*.sol"
- "packages/lsp-smart-contracts/tests/foundry/**/*.sol"

jobs:
foundry-tests:
Expand All @@ -24,7 +24,9 @@ jobs:
run: npm ci

- name: NPM build
run: npx hardhat compile
run: |
npm run build
npm run build:foundry

- name: Run Foundry tests
run: npm run test:foundry
Expand All @@ -34,18 +36,18 @@ jobs:
# due to non-deterministic fuzzing (but still use pseudo-random fuzzing seeds)
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}

- name: Compare gas reports
uses: Rubilmax/foundry-gas-diff@v3.13.1
with:
summaryQuantile: 0.9 # only display the 10% most significant gas diffs in the summary (defaults to 20%)
sortCriteria: avg,max # sort diff rows by criteria
sortOrders: desc,asc # and directions
id: gas_diff

- name: Add gas diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
# delete the comment in case changes no longer impact gas costs
delete: ${{ !steps.gas_diff.outputs.markdown }}
message: ${{ steps.gas_diff.outputs.markdown }}
# - name: Compare gas reports
# uses: Rubilmax/foundry-gas-diff@v3.13.1
# with:
# summaryQuantile: 0.9 # only display the 10% most significant gas diffs in the summary (defaults to 20%)
# sortCriteria: avg,max # sort diff rows by criteria
# sortOrders: desc,asc # and directions
# id: gas_diff

# - name: Add gas diff to sticky comment
# if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
# uses: marocchino/sticky-pull-request-comment@v2
# with:
# # delete the comment in case changes no longer impact gas costs
# delete: ${{ !steps.gas_diff.outputs.markdown }}
# message: ${{ steps.gas_diff.outputs.markdown }}
7 changes: 5 additions & 2 deletions .github/workflows/solc_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ on:
- "develop"
# Only run when `.sol` files have been changed
paths:
- "contracts/**/*.sol"
- "*.sol"

pull_request:
paths:
- "contracts/**/*.sol"
- "*.sol"

jobs:
solc_version:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/lsp-smart-contracts
strategy:
matrix:
solc: [
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ forge-cache/
gas_benchmark.md

# Exclude build output folders
/**/dist
/**/contracts.ts
/devdocs
/userdocs
/**/devdocs
/**/userdocs

# test temporary folder
/.test
Expand Down
11 changes: 0 additions & 11 deletions config/tsconfig/contracts.module.json

This file was deleted.

43 changes: 0 additions & 43 deletions contracts/Imports.sol

This file was deleted.

17 changes: 0 additions & 17 deletions contracts/Version.sol

This file was deleted.

23 changes: 14 additions & 9 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ runs = 10_000
max_test_rejects = 200_000

[profile.lsp2]
src = 'packages/LSP2ERC725YJSONSchema/contracts'
test = 'packages/LSP2ERC725YJSONSchema/foundry'
out = 'packages/LSP2ERC725YJSONSchema/contracts/foundry_artifacts'
src = 'packages/lsp2-contracts/contracts'
test = 'packages/lsp2-contracts/foundry'
out = 'packages/lsp2-contracts/contracts/foundry_artifacts'

[profile.lsp6]
src = 'packages/LSP6KeyManager/contracts'
test = 'packages/LSP6KeyManager/foundry'
out = 'packages/LSP6KeyManager/contracts/foundry_artifacts'
src = 'packages/lsp6-contracts/contracts'
test = 'packages/lsp6-contracts/foundry'
out = 'packages/lsp6-contracts/contracts/foundry_artifacts'

[profile.lsp16]
src = 'packages/LSP16UniversalFactory/contracts'
test = 'packages/LSP16UniversalFactory/foundry'
out = 'packages/LSP16UniversalFactory/contracts/foundry_artifacts'
src = 'packages/lsp16-contracts/contracts'
test = 'packages/lsp16-contracts/foundry'
out = 'packages/lsp16-contracts/contracts/foundry_artifacts'

[profile.lsp_smart_contracts]
src = 'packages/lsp-smart-contracts/contracts'
test = 'packages/lsp-smart-contracts/tests/foundry'
out = 'packages/lsp-smart-contracts/contracts/foundry_artifacts'
Loading
Loading