Skip to content

Commit

Permalink
Merge pull request #981 from lukso-network/sync-main-with-develop
Browse files Browse the repository at this point in the history
Sync main with missing commits in `develop`
  • Loading branch information
CJ42 authored Jan 10, 2025
2 parents 8ee0f32 + 8d869a7 commit 20fd62c
Show file tree
Hide file tree
Showing 301 changed files with 52,189 additions and 18,570 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,60 +28,61 @@ jobs:

steps:
- name: Checkout base branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha }}
fetch-depth: 0

- name: Use Node.js '16.15.0'
uses: actions/setup-node@v2
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: "16.15.0"
node-version: "20.x"
cache: "npm"

- name: 📦 Install dependencies
run: npm ci

- name: 🏗️ Build contract artifacts
run: |
npm run build
npm run build:turbo
run: npm run build

- name: 🧪 Run Benchmark tests
working-directory: ./packages/lsp-smart-contracts
# Rename the file to be able to generate benchmark JSON report
run: |
npm run test:benchmark
mv gas_benchmark_result.json gas_benchmark_before.json
- name: Checkout current branch
uses: actions/checkout@v3
uses: actions/checkout@v4
# Do not run `git clean -ffdx && git reset --hard HEAD` to prevent removing `gas_benchmark_before.json`
with:
clean: false

- name: Use Node.js '16.15.0'
uses: actions/setup-node@v2
- name: Use Node.js '20.x'
uses: actions/setup-node@v4
with:
node-version: "16.15.0"
node-version: "20.x"
cache: "npm"

- name: 📦 Install dependencies
run: npm ci

- name: 🏗️ Build contract artifacts
run: npx hardhat compile
run: npm run build

- name: 🧪 Run Benchmark tests
working-directory: ./packages/lsp-smart-contracts
run: |
npm run test:benchmark
mv gas_benchmark_result.json gas_benchmark_after.json
- name: 📊 Generate Benchmark Report
working-directory: ./packages/lsp-smart-contracts
run: npx hardhat gas-benchmark --compare gas_benchmark_after.json --against gas_benchmark_before.json

- name: 💬 Add Gas Report as comment in PR
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body-file: "./gas_benchmark.md"
body-file: "./packages/lsp-smart-contracts/gas_benchmark.md"
19 changes: 4 additions & 15 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- name: Use Node.js v20
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
Expand All @@ -27,20 +27,9 @@ jobs:
- name: 🎨 Run ESLint on JS/TS files
run: npm run lint

- name: 📦 Test Building package for release
# Command `build:types` needs the folder structure generated
# by the `package` command to run successfully
run: |
npm run build
npm run build:js
npm run package
npm run build:types
# This will also generate the Typechain types used by the Chai tests
# This will also generate the Typechain types and the files with the constants used by the Chai tests
- name: 🏗️ Build contract artifacts
run: |
npm run build
npm run build:js
run: npm run build

# - name: 📚 generate ABI docs
# run: npm run build:docs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js v16
uses: actions/setup-node@v2
- name: Use Node.js v20.x
uses: actions/setup-node@v4
with:
node-version: "16.x"
node-version: "20.x"
cache: "npm"

- name: Install dependencies
Expand Down
25 changes: 7 additions & 18 deletions .github/workflows/deploy-verify.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow deploys and verify the lsp-smart-contracts and verify them on LUKSO Testnet.
name: Deploy + Verify Contracts on Testnet
# This workflow deploys and verify the lsp-smart-contracts and verify them on LUKSO Mainnet & Testnet.
name: Deploy + Verify Contracts

env:
# 0x983aBC616f2442bAB7a917E6bb8660Df8b01F3bF
Expand All @@ -21,10 +21,10 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js v20
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
Expand All @@ -38,21 +38,10 @@ jobs:
- name: Verify Deployer Balance
run: npx hardhat verify-balance --network ${{ matrix.network }}

# We do not deploy the standard contracts on mainnet for the following reasons:
# 1) standard contracts are expensive to deploy on mainnet
# 2) user's universal profiles use the minimal proxy pattern,
#
# therefore we only need the base contracts to be deployed on mainnet.
- name: Select tags based on network to deploy
run: |
TAGS="base"
if [[ ${{ matrix.network }} == "luksoTestnet"]]; then
TAGS+=",standard"
fi
- name: Deploy contracts on network
# The array of `tags` under each network in `hardhat.config.ts` specify which contracts to deploy
- name: Deploy contracts on ${{ matrix.network }}
run: npx hardhat deploy --network ${{ matrix.network }} --tags $TAGS --write true

# Loop through deployment files and recover address of deployed contracts to verify
- name: Verify deployed contracts on mainnet
- name: Verify deployed contracts on ${{ matrix.network }}
run: npx hardhat verify-all --network ${{ matrix.network }}
2 changes: 1 addition & 1 deletion .github/workflows/foundry-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
foundry-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/mythx-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Node.js '16.15.0'
uses: actions/setup-node@v2
- name: Setup Node.js '20.x'
uses: actions/setup-node@v4
with:
node-version: "16.15.0"
node-version: "20.x"
cache: "npm"

- name: Set up Python 3.8
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# The `if` statements ensure that a publication only occurs when
# a new release is created:

- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}

- name: Use Node.js v20
Expand All @@ -49,12 +49,14 @@ jobs:

# `npm run build:js` will also generate the auto-generated constants for methods, errors and events,
# including extracting their devdocs and userdocs
# `npm run build:types` will generate:
# - the artifacts with abis for release (artifacts/*.json)
# - the wagmi hooks (types/index.ts)
# - the typed abis (types/index.ts)
- name: Prepare artifacts to publish
if: ${{ steps.release.outputs.releases_created }}
run: |
npm run build
npm run build:js
npm run package
npm run build:types
- name: Publish on NPM
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/solc_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@ jobs:
"0.8.21",
"0.8.22",
"0.8.23",
"0.8.24",
"0.8.25",
"0.8.26",
"0.8.27",
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js '16.15.0'
uses: actions/setup-node@v2
- name: Use Node.js '20.x'
uses: actions/setup-node@v4
with:
node-version: "16.15.0"
node-version: "20.x"
cache: "npm"

- name: 📦 Install dependencies
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/spellcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow checks for common grammar and spelling mistake in markdown files.
name: Spellcheck
on: [pull_request]

jobs:
build:
name: Check Grammar and Spelling errors
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install ⚙️
run: npm ci

- name: Check spelling errors in code snippets 🔍
uses: codespell-project/actions-codespell@v2
with:
path: packages/lsp-smart-contracts/docs
check_filenames: true
ignore_words_list: datas

- name: Output Spellcheck Results 📝
uses: actions/upload-artifact@v3
with:
name: Spellcheck Output
path: spellcheck-output.txt
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ packages/**/typechain-types/

# Output of 'npm pack'
package/
*.tgz

# Yarn Integrity file
.yarn-integrity
Expand Down Expand Up @@ -149,3 +148,5 @@ gas_benchmark.md

# Custom setup
foundry_artifacts/

wagmi.config.bundled_*.mjs
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
/package
/module
packages/*/types/
packages/*/artifacts/
packages/*/artifacts/
packages/*/CHANGELOG.md
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"plugins": ["prettier-plugin-solidity"],
"overrides": [
{
"files": ["*.js", "*.ts"],
"files": ["*.js", "*.ts", "*.mjs"],
"options": {
"tabWidth": 2,
"printWidth": 100,
Expand Down
2 changes: 2 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"packages/lsp8-contracts": "0.15.0",
"packages/lsp9-contracts": "0.15.0",
"packages/lsp10-contracts": "0.15.0",
"packages/lsp11-contracts": "0.1.0",
"packages/lsp12-contracts": "0.15.0",
"packages/lsp14-contracts": "0.15.0",
"packages/lsp16-contracts": "0.15.0",
Expand All @@ -20,5 +21,6 @@
"packages/lsp20-contracts": "0.15.0",
"packages/lsp23-contracts": "0.15.0",
"packages/lsp25-contracts": "0.15.0",
"packages/lsp26-contracts": "0.1.0",
"packages/universalprofile-contracts": "0.15.0"
}
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nodejs 16.19.0
nodejs 20
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Since the `@lukso/lsp-smart-contracts` is an Open Source project, we welcome con
- report bug and issues.
- introduce new features or bug fixes.

Any non-trivial code contribution **must be first discussed with the maintainers and the developer community in an [issue](https://github.com/lukso-network/lsp-smart-contracts/issues/new/choose)**. Only very minor changes are accepted without prior discussion.

## **Clone project**

Our project uses submodules, we recommend you to clone our repository using the following command:
Expand Down Expand Up @@ -143,7 +145,7 @@ Which is is not the intended output.

3. `@return` tag is mandatory if the function has any return value.

4. Make sure to use one of the custom tags below to document any additional informations of different kinds:
4. Make sure to use one of the custom tags below to document any additional information of different kinds:

- Use `@custom:requirements` for all the requirements to use a function.
- Use `@custom:events` for all the emited events during the function execution.
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ The following audits and formal verification were conducted. All high-level issu
- MiloTruck, 2023-11-31, Final Result: [MiloTruck_audit_2023_11_31.pdf](./audits/MiloTruck_audit_2023_11_31.pdf)
- MiloTruck, 2024-01-24, Final Result: [MiloTruck_audit_2024_01_24.pdf](./audits/MiloTruck_audit_2024_01_24.pdf)

## Contribute

The implementation contracts of the [LSPs](https://github.com/lukso-network/LIPs) exist thanks to their contributors. There are many ways you can participate and help build high quality software. Check out the [contribution guidelines](./CONTRIBUTING.md)!

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down
2 changes: 1 addition & 1 deletion config/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint-config-prettier": "^8.8.0",
"eslint-config-turbo": "^1.9.3",
"eslint-config-turbo": "^2.0.12",
"eslint-plugin-prettier": "^4.2.1"
}
}
10 changes: 10 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ solc = "0.8.17"
runs = 10_000
max_test_rejects = 200_000

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

[profile.lsp2]
src = 'packages/lsp2-contracts/contracts'
test = 'packages/lsp2-contracts/foundry'
Expand All @@ -21,6 +26,11 @@ src = 'packages/lsp6-contracts/contracts'
test = 'packages/lsp6-contracts/foundry'
out = 'packages/lsp6-contracts/contracts/foundry_artifacts'

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

[profile.lsp16]
src = 'packages/lsp16-contracts/contracts'
test = 'packages/lsp16-contracts/foundry'
Expand Down
Loading

0 comments on commit 20fd62c

Please sign in to comment.