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

refactor: use new data location for LSP8 tokenId data #927

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2399ab6
fix: remove unused state variable in LSP8 (#827)
CJ42 Dec 6, 2023
0a951df
docs: update LSP16 description (#838)
fhildeb Jan 3, 2024
dc9fafa
chore: add `virtual` keyword in burn() in LSP8Burnable (#835)
YamenMerhi Jan 9, 2024
8da9698
refactor: [L-05] tokenIds and dataKeys can have different lengths in …
YamenMerhi Jan 9, 2024
62009fa
docs: [L-06] revokeOperator() does not protect against the double-spe…
YamenMerhi Jan 9, 2024
49a445f
chore: remove duplicated check in isOperatorFor in LSP8 (#837)
YamenMerhi Jan 9, 2024
9e1519f
refactor: adjust LSP16 natspec and parameter name (#839)
YamenMerhi Jan 9, 2024
afe4fd6
ci: change event triggers for benchmark CI to include forks (#840)
YamenMerhi Jan 9, 2024
8006a04
ci: revert changes related to Benchmark CI (#842)
YamenMerhi Jan 10, 2024
7538b89
fix: move _beforeTokenTransfer before balance check (#843)
skimaharvey Jan 11, 2024
e29f8c9
fix: add existence check before the _beforeTokenTransfer hook (#844)
skimaharvey Jan 11, 2024
a3560bc
fix: restrict owner change in _beforeTokenTransfer
skimaharvey Jan 10, 2024
de8325f
Merge branch 'develop' of https://github.com/lukso-network/lsp-smart-…
skimaharvey Jan 11, 2024
b2abc5d
docs: update auto-generated docs
CJ42 Jan 11, 2024
6dbeb53
Merge pull request #846 from lukso-network/restrict-beforeTokenHook
skimaharvey Jan 11, 2024
78b3cf0
refactor: remove LSP7 & LSP8 compatible contracts (#845)
b00ste Jan 12, 2024
31e072f
Update and rename LSP16UniversalFactory.md to README.md (#848)
YamenMerhi Jan 12, 2024
def913d
docs: add `TESTING.md` (#847)
YamenMerhi Jan 15, 2024
6255f70
ci: create deployment script to deploy + verify base contracts on mai…
CJ42 Jan 24, 2024
25cf82c
docs: add latest LSP7 + LSP8 Tokens audit report (#861)
CJ42 Jan 25, 2024
c08947c
feat: Add types for attributes (#870)
dzbo Feb 5, 2024
d3c5080
Make `attributes` optional (#872)
dzbo Feb 27, 2024
671c4cd
feat: Add contract asset type (#891)
dzbo Feb 27, 2024
f4b21eb
feat!: allow Operator to revoke himself (#893)
YamenMerhi Feb 28, 2024
0b9244e
Setup LSP Smart Contracts as Monorepo on develop (#902)
CJ42 Mar 4, 2024
2ca96b6
docs: improve documentation for releasing specific packages
CJ42 Mar 4, 2024
9130485
chore: release lsp-smart-contracts 0.15.0-rc.0 (#903)
CJ42 Mar 4, 2024
0d688d0
chore: release lsp7-contracts 0.15.0-rc.0 (#904)
CJ42 Mar 4, 2024
60fff7c
chore: release lsp8-contracts 0.15.0-rc.0 (#905)
CJ42 Mar 4, 2024
3f21c27
chore: try resolve merge conflicts for `package.json` from `develop` …
CJ42 Mar 5, 2024
abbe763
Merge branch 'main' into resolve-conflicts-main (as cherry-pick) (#908)
CJ42 Mar 6, 2024
4d58753
chore: sync develop with main
CJ42 Mar 7, 2024
a83b14d
Merge pull request #919 from lukso-network/sync-develop-with-main
CJ42 Mar 7, 2024
0def19d
chore: add LSP20, LSP25 and Universal Profile in release please manifest
CJ42 Mar 7, 2024
adfd9dd
Merge pull request #920 from lukso-network/chore/release-more-packages
CJ42 Mar 7, 2024
6e99730
refactor: use new data location for LSP8 tokenId data
YamenMerhi Mar 14, 2024
feeadfa
Add name to LSP4
dzbo Mar 19, 2024
b0e5369
Make `attributes` field optional
dzbo Mar 19, 2024
f4def52
Merge pull request #928 from dzbo/fix/add-name-to-lsp4
CJ42 Mar 19, 2024
79995fd
Merge branch 'develop' into tokenIdDataLocation
YamenMerhi Apr 2, 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
  •  
  •  
  •  
12 changes: 0 additions & 12 deletions .eslintrc.json

This file was deleted.

9 changes: 7 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

# compare gas diff only when editing Solidity smart contract code
paths:
- "contracts/**/*.sol"
- "packages/**/contracts/**/*.sol"

# do not run on releases (merging to main)
branches-ignore:
Expand All @@ -22,6 +22,9 @@ on:
jobs:
benchmark:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/lsp-smart-contracts

steps:
- name: Checkout base branch
Expand All @@ -40,7 +43,9 @@ jobs:
run: npm ci

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

- name: 🧪 Run Benchmark tests
# Rename the file to be able to generate benchmark JSON report
Expand Down
109 changes: 21 additions & 88 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ name: Node.js CI - Build + Lint + Test
on: pull_request

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

steps:
- uses: actions/checkout@v3

# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
- name: Use Node.js '16.15.0'
uses: actions/setup-node@v2
- name: Use Node.js v20
uses: actions/setup-node@v3
with:
node-version: "16.15.0"
node-version: "20.x"
cache: "npm"

- name: 📦 Install dependencies
Expand All @@ -29,87 +29,20 @@ jobs:

# This will also generate the Typechain types used by the Chai tests
- name: 🏗️ Build contract artifacts
run: npx hardhat compile

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

- name: 🧪 run import/requires tests
run: npm run test:importRequire

- 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

test-suites:
strategy:
matrix:
lsp:
[
"up",
"upinit",
"lsp1",
"lsp2",
"lsp6",
"lsp6init",
"lsp7",
"lsp7init",
"lsp8",
"lsp8init",
"lsp9",
"lsp9init",
"lsp11",
"lsp11init",
"lsp17",
"lsp17extensions",
"lsp20",
"lsp20init",
"lsp23",
"universalfactory",
"reentrancy",
"reentrancyinit",
"mocks",
]

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

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

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

- name: Install dependencies
if: steps.build-cache.outputs.cache-hit != 'true'
run: npm ci

- name: 🧪 run tests
run: npm run test:${{ matrix.lsp }}
run: |
npm run build
npm run build:js

# - 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 tests for each package
run: npm run test
98 changes: 31 additions & 67 deletions .github/workflows/deploy-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
name: Deploy + Verify Contracts on Testnet

env:
# 0x983aBC616f2442bAB7a917E6bb8660Df8b01F3bF
CONTRACT_VERIFICATION_TESTNET_PK: ${{ secrets.CONTRACT_VERIFICATION_TESTNET_PK }}
DEPLOYER_ADDRESS: "0x983aBC616f2442bAB7a917E6bb8660Df8b01F3bF"
# 0xF0efeD8d49c0FA6CFC861Bf0311b6B3a4414e4b7
CONTRACT_VERIFICATION_MAINNET_PK: ${{ secrets.CONTRACT_VERIFICATION_MAINNET_PK }}

on:
workflow_dispatch:
Expand All @@ -12,83 +14,45 @@ on:
- "main"

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

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

- name: Install dependencies
run: npm ci

# This will also generate the Typechain types used by the Chai tests
- name: Build contract artifacts
run: npx hardhat compile

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

deploy-verify:
runs-on: ubuntu-latest
needs: [build]
strategy:
# run each base contract verification one after the other to prevent submitting multiple transactions at the same time with the same nonce.
max-parallel: 1
matrix:
contracts: [
# Standard contracts
"UniversalProfile",
"LSP6KeyManager",
"LSP1UniversalReceiverDelegateUP",
"LSP1UniversalReceiverDelegateVault",
"LSP7Mintable",
"LSP8Mintable",
"LSP9Vault",
# Base contracts (for proxies)
"UniversalProfileInit",
"LSP6KeyManagerInit",
"LSP7MintableInit",
"LSP8MintableInit",
"LSP9VaultInit",
]
network: ["luksoTestnet", "luksoMainnet"]

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

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

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

- name: Install dependencies
if: steps.build-cache.outputs.cache-hit != 'true'
run: npm ci

- name: Verify Deployer Balance
run: npx ts-node ./scripts/ci/check-deployer-balance.ts
- name: Build contract artifacts
run: npm run build

- name: Deploy + Verify ${{ matrix.contracts }} on Testnet
run: sh ./scripts/ci/deploy-verify.sh -n luksoTestnet -c ${{ matrix.contracts }}
- 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
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
run: npx hardhat verify-all --network ${{ matrix.network }}
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 }}
Loading
Loading