diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 336d708d3..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - ignorePatterns: ['artifacts/', 'cache/', 'dist/', 'types/', 'contracts.ts'], - extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], - plugins: ['@typescript-eslint/eslint-plugin', 'prettier'], - rules: { - 'prettier/prettier': 'error', - '@typescript-eslint/no-explicit-any': 'off', - }, -}; diff --git a/.github/workflows/build-lint-test.yml b/.github/workflows/build-lint-test.yml index f8ac31d63..94745231b 100644 --- a/.github/workflows/build-lint-test.yml +++ b/.github/workflows/build-lint-test.yml @@ -5,7 +5,7 @@ name: Node.js CI - Build + Lint + Test on: pull_request jobs: - build: + build-lint-test: runs-on: ubuntu-latest steps: @@ -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 diff --git a/.github/workflows/foundry-tests.yml b/.github/workflows/foundry-tests.yml index cbfbe8a99..0f450fc69 100644 --- a/.github/workflows/foundry-tests.yml +++ b/.github/workflows/foundry-tests.yml @@ -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: @@ -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 @@ -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 }} diff --git a/.github/workflows/solc_version.yml b/.github/workflows/solc_version.yml index beb70b73d..469cf228a 100644 --- a/.github/workflows/solc_version.yml +++ b/.github/workflows/solc_version.yml @@ -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: [ diff --git a/.gitignore b/.gitignore index 9f29c4817..085bc659e 100644 --- a/.gitignore +++ b/.gitignore @@ -135,9 +135,10 @@ forge-cache/ gas_benchmark.md # Exclude build output folders +/**/dist /**/contracts.ts -/devdocs -/userdocs +/**/devdocs +/**/userdocs # test temporary folder /.test diff --git a/config/tsconfig/contracts.module.json b/config/tsconfig/contracts.module.json deleted file mode 100755 index 83997ab57..000000000 --- a/config/tsconfig/contracts.module.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig", - "compilerOptions": { - "module": "esNext", - "target": "esNext", - "outDir": "module", - "declaration": true, - "skipLibCheck": false - }, - "files": ["./constants.ts"] -} diff --git a/contracts/Imports.sol b/contracts/Imports.sol deleted file mode 100644 index 1a5f4a3c8..000000000 --- a/contracts/Imports.sol +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.4; - -// solhint-disable no-unused-import -import { - UniversalProfileInit -} from "@lukso/universalprofile-contracts/contracts/UniversalProfileInit.sol"; -import { - LSP1UniversalReceiverDelegateUP -} from "@lukso/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol"; -import { - LSP1UniversalReceiverDelegateVault -} from "@lukso/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol"; - -import { - LSP7Mintable -} from "@lukso/lsp7-contracts/contracts/presets/LSP7Mintable.sol"; -import { - LSP7MintableInit -} from "@lukso/lsp7-contracts/contracts/presets/LSP7MintableInit.sol"; -import { - LSP8Mintable -} from "@lukso/lsp8-contracts/contracts/presets/LSP8Mintable.sol"; -import { - LSP8MintableInit -} from "@lukso/lsp8-contracts/contracts/presets/LSP8MintableInit.sol"; -import {LSP9Vault} from "@lukso/lsp9-contracts/contracts/LSP9Vault.sol"; -import {LSP9VaultInit} from "@lukso/lsp9-contracts/contracts/LSP9VaultInit.sol"; -import { - LSP23LinkedContractsFactory -} from "@lukso/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol"; -import { - UniversalProfileInitPostDeploymentModule -} from "@lukso/lsp23-contracts/contracts/modules/UniversalProfileInitPostDeploymentModule.sol"; -import { - UniversalProfilePostDeploymentModule -} from "@lukso/lsp23-contracts/contracts/modules/UniversalProfilePostDeploymentModule.sol"; -import { - IPostDeploymentModule -} from "@lukso/lsp23-contracts/contracts/IPostDeploymentModule.sol"; -import { - Extension4337 -} from "@lukso/lsp17-contracts/contracts/Extension4337.sol"; diff --git a/contracts/Version.sol b/contracts/Version.sol deleted file mode 100644 index 9227ca267..000000000 --- a/contracts/Version.sol +++ /dev/null @@ -1,17 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -pragma solidity ^0.8.4; - -abstract contract Version { - /** - * @dev Get the version of the contract. - * @notice Contract version. - * - * @return The version of the the contract. - */ - // DO NOT CHANGE - // Comments block below is used by release-please to automatically update the version in this file. - // x-release-please-start-version - string public constant VERSION = "0.12.1"; - - // x-release-please-end -} diff --git a/foundry.toml b/foundry.toml index 33efc9459..8271ca127 100644 --- a/foundry.toml +++ b/foundry.toml @@ -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' diff --git a/gas_benchmark_result.json b/gas_benchmark_result.json new file mode 100644 index 000000000..e21f05d3e --- /dev/null +++ b/gas_benchmark_result.json @@ -0,0 +1,204 @@ +{ + "deployment_costs": { + "UniversalProfile": "", + "KeyManager": "", + "LSP1DelegateUP": "", + "LSP7Mintable": "", + "LSP8Mintable": "" + }, + "runtime_costs": { + "EOA_owner": { + "execute": { + "case_1": { + "description": "Transfer 1 LYX to an EOA without data", + "gas_cost": "" + }, + "case_2": { + "description": "Transfer 1 LYX to a UP without data", + "gas_cost": "" + }, + "case_3": { + "description": "Transfer 1 LYX to an EOA with 256 bytes of data", + "gas_cost": "" + }, + "case_4": { + "description": "Transfer 1 LYX to a UP with 256 bytes of data", + "gas_cost": "" + }, + "case_5": { + "description": "Transfer 0.1 LYX to 3x EOA without data", + "gas_cost": "" + }, + "case_6": { + "description": "Transfer 0.1 LYX to 3x UP without data", + "gas_cost": "" + }, + "case_7": { + "description": "Transfer 0.1 LYX to 3x EOA with 256 bytes of data", + "gas_cost": "" + }, + "case_8": { + "description": "Transfer 0.1 LYX to 3x UPs with 256 bytes of data", + "gas_cost": "" + } + }, + "setData": { + "case_1": { + "description": "Set a 20 bytes long value", + "gas_cost": "" + }, + "case_2": { + "description": "Set a 60 bytes long value", + "gas_cost": "" + }, + "case_3": { + "description": "Set a 160 bytes long value", + "gas_cost": "" + }, + "case_4": { + "description": "Set a 300 bytes long value", + "gas_cost": "" + }, + "case_5": { + "description": "Set a 600 bytes long value", + "gas_cost": "" + }, + "case_6": { + "description": "Change the value of a data key already set", + "gas_cost": "" + }, + "case_7": { + "description": "Remove the value of a data key already set", + "gas_cost": "" + }, + "case_8": { + "description": "Set 2 data keys of 20 bytes long value", + "gas_cost": "" + }, + "case_9": { + "description": "Set 2 data keys of 100 bytes long value", + "gas_cost": "" + }, + "case_10": { + "description": "Set 3 data keys of 20 bytes long value", + "gas_cost": "" + }, + "case_11": { + "description": "Change the value of three data keys already set of 20 bytes long value", + "gas_cost": "" + }, + "case_12": { + "description": "Remove the value of three data keys already set", + "gas_cost": "" + } + }, + "tokens": { + "case_1": { + "description": "Minting a LSP7Token to a UP (No Delegate) from an EOA", + "gas_cost": "" + }, + "case_2": { + "description": "Minting a LSP7Token to an EOA from an EOA", + "gas_cost": "" + }, + "case_3": { + "description": "Transferring an LSP7Token from a UP to another UP (No Delegate)", + "gas_cost": "" + }, + "case_4": { + "description": "Minting a LSP8Token to a UP (No Delegate) from an EOA ", + "gas_cost": "" + }, + "case_5": { + "description": "Minting a LSP8Token to an EOA from an EOA ", + "gas_cost": "" + }, + "case_6": { + "description": "Transferring an LSP8Token from a UP to another UP (No Delegate)", + "gas_cost": "" + } + } + }, + "KeyManager_owner": { + "execute": { + "case_1": { + "description": "LYX transfer --> to an EOA", + "main_controller": "", + "restricted_controller": "" + }, + "case_2": { + "description": "LYX transfer --> to a UP", + "main_controller": "", + "restricted_controller": "" + }, + "case_3": { + "description": "LSP7 token transfer --> to an EOA", + "main_controller": "", + "restricted_controller": "" + }, + "case_4": { + "description": "LSP7 token transfer --> to a UP", + "main_controller": "", + "restricted_controller": "" + }, + "case_5": { + "description": "LSP8 NFT transfer --> to an EOA", + "main_controller": "", + "restricted_controller": "" + }, + "case_6": { + "description": "LSP8 NFT transfer --> to a UP", + "main_controller": "", + "restricted_controller": "" + } + }, + "setData": { + "case_1": { + "description": "Update Profile details (LSP3Profile Metadata)", + "main_controller": "", + "restricted_controller": "" + }, + "case_2": { + "description": "Add a new controller with permission to `SET_DATA` + 3x allowed data keys:
`AddressPermissions[]`
+ `AddressPermissions[index]`
+ `AddressPermissions:Permissions:`
+ `AddressPermissions:AllowedERC725YDataKeys: 1. decrease `AddressPermissions[]` Array length
2. remove the controller address at `AddressPermissions[index]`
3. set \"0x\" for the controller permissions under AddressPermissions:Permissions:", + "main_controller": "", + "restricted_controller": "" + }, + "case_5": { + "description": "Write 5x new LSP12 Issued Assets", + "main_controller": "", + "restricted_controller": "" + }, + "case_6": { + "description": "Update 3x data keys (first 3)", + "main_controller": "", + "restricted_controller": "" + }, + "case_7": { + "description": "Update 3x data keys (middle 3)", + "main_controller": "", + "restricted_controller": "" + }, + "case_8": { + "description": "Update 3x data keys (last 3)", + "main_controller": "", + "restricted_controller": "" + }, + "case_9": { + "description": "Set 2 x new data keys + add 3x new controllers", + "main_controller": "", + "restricted_controller": "" + } + } + } + } +} \ No newline at end of file diff --git a/gasreport.ansi b/gasreport.ansi deleted file mode 100644 index 5d07ee0fa..000000000 --- a/gasreport.ansi +++ /dev/null @@ -1 +0,0 @@ -Compiling 272 files with 0.8.17 diff --git a/package-lock.json b/package-lock.json index 3067c0d31..d8efb1989 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@lukso/lsp-smart-contracts", + "name": "@lukso/lsp-smart-contracts-monorepo", "version": "0.12.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@lukso/lsp-smart-contracts", + "name": "@lukso/lsp-smart-contracts-monorepo", "version": "0.12.1", "hasInstallScript": true, "license": "Apache-2.0", @@ -13,34 +13,6 @@ "config/*", "packages/*" ], - "dependencies": { - "@account-abstraction/contracts": "^0.6.0", - "@erc725/smart-contracts": "^7.0.0", - "@lukso/lsp0-contracts": "*", - "@lukso/lsp1-contracts": "*", - "@lukso/lsp10-contracts": "*", - "@lukso/lsp12-contracts": "*", - "@lukso/lsp14-contracts": "*", - "@lukso/lsp16-contracts": "*", - "@lukso/lsp17-contracts": "*", - "@lukso/lsp17contractextension-contracts": "*", - "@lukso/lsp1delegate-contracts": "*", - "@lukso/lsp2-contracts": "*", - "@lukso/lsp20-contracts": "*", - "@lukso/lsp23-contracts": "*", - "@lukso/lsp25-contracts": "*", - "@lukso/lsp3-contracts": "*", - "@lukso/lsp4-contracts": "*", - "@lukso/lsp5-contracts": "*", - "@lukso/lsp6-contracts": "*", - "@lukso/lsp7-contracts": "*", - "@lukso/lsp8-contracts": "*", - "@lukso/lsp9-contracts": "*", - "@lukso/universalprofile-contracts": "*", - "@openzeppelin/contracts": "^4.9.2", - "@openzeppelin/contracts-upgradeable": "^4.9.2", - "solidity-bytes-utils": "0.8.0" - }, "devDependencies": { "@b00ste/hardhat-dodoc": "^0.3.16", "@erc725/erc725.js": "0.23.0", @@ -139,6 +111,19 @@ "squirrelly": "^8.0.8" } }, + "node_modules/@b00ste/hardhat-dodoc/node_modules/@lukso/lsp-smart-contracts": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.14.0.tgz", + "integrity": "sha512-HjMpO/DfcAnL2YAoGSq4TazwsKof3CClyi33cwkOIdH7b81DMP5Z4LLjOjAGURrJlMj8wH4cLp5+4nvZ4NVSIA==", + "dev": true, + "dependencies": { + "@account-abstraction/contracts": "^0.6.0", + "@erc725/smart-contracts": "^7.0.0", + "@openzeppelin/contracts": "^4.9.2", + "@openzeppelin/contracts-upgradeable": "^4.9.2", + "solidity-bytes-utils": "0.8.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", @@ -1941,17 +1926,8 @@ } }, "node_modules/@lukso/lsp-smart-contracts": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@lukso/lsp-smart-contracts/-/lsp-smart-contracts-0.14.0.tgz", - "integrity": "sha512-HjMpO/DfcAnL2YAoGSq4TazwsKof3CClyi33cwkOIdH7b81DMP5Z4LLjOjAGURrJlMj8wH4cLp5+4nvZ4NVSIA==", - "dev": true, - "dependencies": { - "@account-abstraction/contracts": "^0.6.0", - "@erc725/smart-contracts": "^7.0.0", - "@openzeppelin/contracts": "^4.9.2", - "@openzeppelin/contracts-upgradeable": "^4.9.2", - "solidity-bytes-utils": "0.8.0" - } + "resolved": "packages/lsp-smart-contracts", + "link": true }, "node_modules/@lukso/lsp0-contracts": { "resolved": "packages/lsp0-contracts", @@ -20940,6 +20916,34 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "packages/lsp-smart-contracts": { + "name": "@lukso/lsp-smart-contracts", + "version": "0.12.1", + "license": "Apache-2.0", + "dependencies": { + "@lukso/lsp0-contracts": "*", + "@lukso/lsp1-contracts": "*", + "@lukso/lsp10-contracts": "*", + "@lukso/lsp12-contracts": "*", + "@lukso/lsp14-contracts": "*", + "@lukso/lsp16-contracts": "*", + "@lukso/lsp17-contracts": "*", + "@lukso/lsp17contractextension-contracts": "*", + "@lukso/lsp1delegate-contracts": "*", + "@lukso/lsp2-contracts": "*", + "@lukso/lsp20-contracts": "*", + "@lukso/lsp23-contracts": "*", + "@lukso/lsp25-contracts": "*", + "@lukso/lsp3-contracts": "*", + "@lukso/lsp4-contracts": "*", + "@lukso/lsp5-contracts": "*", + "@lukso/lsp6-contracts": "*", + "@lukso/lsp7-contracts": "*", + "@lukso/lsp8-contracts": "*", + "@lukso/lsp9-contracts": "*", + "@lukso/universalprofile-contracts": "*" + } + }, "packages/lsp0-contracts": { "name": "@lukso/lsp0-contracts", "version": "0.12.1", diff --git a/package.json b/package.json index c100deaf5..159682858 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,9 @@ { - "name": "@lukso/lsp-smart-contracts", - "version": "0.12.1", + "name": "@lukso/lsp-smart-contracts-monorepo", "description": "The reference smart contract implementation for the LUKSO LSP standards", + "version": "0.12.1", + "private": true, + "npmClient": "npm", "author": "", "license": "Apache-2.0", "bugs": { @@ -23,111 +25,41 @@ "Solidity", "Universal Profiles" ], - "directories": { - "test": "tests" - }, - "files": [ - "contracts/**/*.sol", - "!contracts/Mocks/**/*.sol", - "artifacts/*.json", - "dist", - "./README.md", - "./CONTRIBUTING.md", - "./LICENSE" - ], - "main": "./dist/constants.cjs", - "module": "./dist/constants.mjs", - "typings": "./dist/constants.d.ts", - "exports": { - ".": { - "require": "./dist/constants.cjs", - "import": "./dist/constants.mjs", - "types": "./dist/constants.d.ts" - }, - "./constants.js": { - "require": "./dist/constants.cjs", - "import": "./dist/constants.mjs", - "types": "./dist/constants.d.ts" - }, - "./constants": { - "require": "./dist/constants.cjs", - "import": "./dist/constants.mjs", - "types": "./dist/constants.d.ts" - }, - "./artifacts/*": "./artifacts/*", - "./dist/*": "./dist/*", - "./package.json": "./package.json" - }, "scripts": { "preinstall": "npx --yes force-resolutions", - "build": "hardhat compile", - "build:turbo": "turbo build", - "build:docs": "hardhat dodoc && prettier -w ./docs", - "build:js": "unbuild", - "build:js:turbo": "turbo build:js", - "clean": "hardhat clean && rm -rf module common", + "build": "turbo build", + "build:foundry": "turbo build:foundry", + "build:js": "turbo build:js", + "clean": "turbo clean", "format": "prettier --write .", - "lint": "eslint . --ext .ts,.js", - "lint:turbo": "turbo lint", - "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'", - "lint:turbo:solidity": "turbo lint:solidity", - "package": "hardhat prepare-package", - "remixd": "remixd -s . --remix-ide", - "test": "hardhat test", + "lint": "turbo lint", + "lint:solidity": "turbo lint:solidity", + "package": "turbo package", + "test": "turbo test", + "test:foundry": "turbo test:foundry --scope='!@lukso/lsp16-contracts'", "test:benchmark": "hardhat test --no-compile tests/Benchmark.test.ts", - "test:coverage": "hardhat coverage", - "test:parallel": "run-p test:mocks test:up test:lsp1 test:lsp2 test:lsp4 test:lsp6 test:lsp7 test:lsp8 test:lsp9 test:lsp11 test:universalfactory", - "test:mocks": "hardhat test --no-compile tests/Mocks/*.test.ts ", - "test:up": "hardhat test --no-compile tests/UniversalProfile.test.ts", - "test:upinit": "hardhat test --no-compile tests/UniversalProfileInit.test.ts", - "test:lsp1": "hardhat test --no-compile tests/LSP1UniversalReceiver/*.test.ts", - "test:lsp6": "hardhat test --no-compile tests/LSP6KeyManager/LSP6KeyManager.test.ts", - "test:lsp6init": "hardhat test --no-compile tests/LSP6KeyManager/LSP6KeyManagerInit.test.ts", - "test:lsp7": "hardhat test --no-compile tests/LSP7DigitalAsset/standard/*.test.ts", - "test:lsp7init": "hardhat test --no-compile tests/LSP7DigitalAsset/proxy/*.test.ts", - "test:lsp8": "hardhat test --no-compile tests/LSP8IdentifiableDigitalAsset/standard/*.test.ts", - "test:lsp8init": "hardhat test --no-compile tests/LSP8IdentifiableDigitalAsset/proxy/*.test.ts", - "test:lsp9": "hardhat test --no-compile tests/LSP9Vault/LSP9Vault.test.ts", - "test:lsp9init": "hardhat test --no-compile tests/LSP9Vault/LSP9VaultInit.test.ts", - "test:lsp11": "hardhat test --no-compile tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.test.ts", - "test:lsp11init": "hardhat test --no-compile tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.test.ts", - "test:lsp17": "hardhat test --no-compile tests/LSP17ContractExtension/LSP17Extendable.test.ts", - "test:lsp17extensions": "hardhat test --no-compile tests/LSP17Extensions/**/*.test.ts", - "test:lsp20": "hardhat test --no-compile tests/LSP20CallVerification/LSP6/LSP20WithLSP6.test.ts", - "test:lsp20init": "hardhat test --no-compile tests/LSP20CallVerification/LSP6/LSP20WithLSP6Init.test.ts", - "test:lsp23": "hardhat test --no-compile tests/LSP23LinkedContractsDeployment/LSP23LinkedContractsDeployment.test.ts", - "test:reentrancy": "hardhat test --no-compile tests/Reentrancy/Reentrancy.test.ts", - "test:reentrancyinit": "hardhat test --no-compile tests/Reentrancy/ReentrancyInit.test.ts", - "test:foundry": "forge test --no-match-test Skip -vvv --gas-report > gasreport.ansi", - "test:turbo": "turbo test" - }, - "dependencies": { - "@account-abstraction/contracts": "^0.6.0", - "@erc725/smart-contracts": "^7.0.0", - "@lukso/lsp0-contracts": "*", - "@lukso/lsp1-contracts": "*", - "@lukso/lsp10-contracts": "*", - "@lukso/lsp12-contracts": "*", - "@lukso/lsp14-contracts": "*", - "@lukso/lsp16-contracts": "*", - "@lukso/lsp17-contracts": "*", - "@lukso/lsp17contractextension-contracts": "*", - "@lukso/lsp1delegate-contracts": "*", - "@lukso/lsp2-contracts": "*", - "@lukso/lsp20-contracts": "*", - "@lukso/lsp23-contracts": "*", - "@lukso/lsp25-contracts": "*", - "@lukso/lsp3-contracts": "*", - "@lukso/lsp4-contracts": "*", - "@lukso/lsp5-contracts": "*", - "@lukso/lsp6-contracts": "*", - "@lukso/lsp7-contracts": "*", - "@lukso/lsp8-contracts": "*", - "@lukso/lsp9-contracts": "*", - "@lukso/universalprofile-contracts": "*", - "@openzeppelin/contracts": "^4.9.2", - "@openzeppelin/contracts-upgradeable": "^4.9.2", - "solidity-bytes-utils": "0.8.0" + "test:coverage": "turbo test:coverage", + "test:mocks": "hardhat test --no-compile packages/lsp-smart-contracts/tests/Mocks/*.test.ts", + "test:up": "hardhat test --no-compile packages/lsp-smart-contracts/tests/UniversalProfile.test.ts", + "test:upinit": "hardhat test --no-compile packages/lsp-smart-contracts/tests/UniversalProfileInit.test.ts", + "test:lsp1": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/*.test.ts", + "test:lsp6": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6KeyManager.test.ts", + "test:lsp6init": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6KeyManagerInit.test.ts", + "test:lsp7": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP7DigitalAsset/standard/*.test.ts", + "test:lsp7init": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP7DigitalAsset/proxy/*.test.ts", + "test:lsp8": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/*.test.ts", + "test:lsp8init": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/*.test.ts", + "test:lsp9": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP9Vault/LSP9Vault.test.ts", + "test:lsp9init": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP9Vault/LSP9VaultInit.test.ts", + "test:lsp11": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.test.ts", + "test:lsp11init": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.test.ts", + "test:lsp17": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP17ContractExtension/LSP17Extendable.test.ts", + "test:lsp17extensions": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP17Extensions/**/*.test.ts", + "test:lsp20": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/LSP20WithLSP6.test.ts", + "test:lsp20init": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/LSP20WithLSP6Init.test.ts", + "test:lsp23": "hardhat test --no-compile packages/lsp-smart-contracts/tests/LSP23LinkedContractsDeployment/LSP23LinkedContractsDeployment.test.ts", + "test:reentrancy": "hardhat test --no-compile packages/lsp-smart-contracts/tests/Reentrancy/Reentrancy.test.ts", + "test:reentrancyinit": "hardhat test --no-compile packages/lsp-smart-contracts/tests/Reentrancy/ReentrancyInit.test.ts" }, "devDependencies": { "@b00ste/hardhat-dodoc": "^0.3.16", diff --git a/packages/lsp-smart-contracts/.eslintrc.js b/packages/lsp-smart-contracts/.eslintrc.js new file mode 100644 index 000000000..03ee7431b --- /dev/null +++ b/packages/lsp-smart-contracts/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ['custom'], +}; diff --git a/.solcover.js b/packages/lsp-smart-contracts/.solcover.js similarity index 100% rename from .solcover.js rename to packages/lsp-smart-contracts/.solcover.js diff --git a/.solhint.json b/packages/lsp-smart-contracts/.solhint.json similarity index 96% rename from .solhint.json rename to packages/lsp-smart-contracts/.solhint.json index 26e01c48a..e8a54f742 100644 --- a/.solhint.json +++ b/packages/lsp-smart-contracts/.solhint.json @@ -16,7 +16,7 @@ "imports-on-top": "error", "visibility-modifier-order": "error", "no-unused-import": "error", - "no-global-import": "error", + "no-global-import": "off", "reason-string": ["warn", { "maxLength": 120 }], "avoid-low-level-calls": "off", "no-empty-blocks": ["error", { "ignoreConstructors": true }], diff --git a/CHANGELOG.md b/packages/lsp-smart-contracts/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to packages/lsp-smart-contracts/CHANGELOG.md diff --git a/packages/lsp-smart-contracts/README.md b/packages/lsp-smart-contracts/README.md new file mode 100644 index 000000000..644976a06 --- /dev/null +++ b/packages/lsp-smart-contracts/README.md @@ -0,0 +1,3 @@ +# `@lukso/lsp-smart-contracts` + +Package for the LSP Smart Contracts. diff --git a/build.config.ts b/packages/lsp-smart-contracts/build.config.ts similarity index 100% rename from build.config.ts rename to packages/lsp-smart-contracts/build.config.ts diff --git a/constants.ts b/packages/lsp-smart-contracts/constants.ts similarity index 100% rename from constants.ts rename to packages/lsp-smart-contracts/constants.ts diff --git a/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol new file mode 100644 index 000000000..39d368c70 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/ILSP0ERC725Account.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp0-contracts/contracts/ILSP0ERC725Account.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0Constants.sol b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0Constants.sol new file mode 100644 index 000000000..5cabb1423 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp0-contracts/contracts/LSP0Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725Account.sol b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725Account.sol new file mode 100644 index 000000000..e0e066a85 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725Account.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp0-contracts/contracts/LSP0ERC725Account.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol new file mode 100644 index 000000000..6cdd0ed4a --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp0-contracts/contracts/LSP0ERC725AccountCore.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol new file mode 100644 index 000000000..384a09e77 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountInit.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp0-contracts/contracts/LSP0ERC725AccountInit.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol new file mode 100644 index 000000000..a6aad9e29 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP0ERC725Account/LSP0ERC725AccountInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp0-contracts/contracts/LSP0ERC725AccountInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP10ReceivedVaults/LSP10Constants.sol b/packages/lsp-smart-contracts/contracts/LSP10ReceivedVaults/LSP10Constants.sol new file mode 100644 index 000000000..25ded8e48 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP10ReceivedVaults/LSP10Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp10-contracts/contracts/LSP10Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP10ReceivedVaults/LSP10Utils.sol b/packages/lsp-smart-contracts/contracts/LSP10ReceivedVaults/LSP10Utils.sol new file mode 100644 index 000000000..ad8ba98f4 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP10ReceivedVaults/LSP10Utils.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp10-contracts/contracts/LSP10Utils.sol"; diff --git a/contracts/LSP11BasicSocialRecovery/ILSP11BasicSocialRecovery.sol b/packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/ILSP11BasicSocialRecovery.sol similarity index 100% rename from contracts/LSP11BasicSocialRecovery/ILSP11BasicSocialRecovery.sol rename to packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/ILSP11BasicSocialRecovery.sol diff --git a/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol b/packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol similarity index 100% rename from contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol rename to packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.sol diff --git a/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol b/packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol similarity index 100% rename from contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol rename to packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryCore.sol diff --git a/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.sol b/packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.sol similarity index 100% rename from contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.sol rename to packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.sol diff --git a/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInitAbstract.sol similarity index 100% rename from contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInitAbstract.sol rename to packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInitAbstract.sol diff --git a/contracts/LSP11BasicSocialRecovery/LSP11Constants.sol b/packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11Constants.sol similarity index 100% rename from contracts/LSP11BasicSocialRecovery/LSP11Constants.sol rename to packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11Constants.sol diff --git a/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol b/packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol similarity index 100% rename from contracts/LSP11BasicSocialRecovery/LSP11Errors.sol rename to packages/lsp-smart-contracts/contracts/LSP11BasicSocialRecovery/LSP11Errors.sol diff --git a/packages/lsp-smart-contracts/contracts/LSP12IssuedAssets/LSP12Constants.sol b/packages/lsp-smart-contracts/contracts/LSP12IssuedAssets/LSP12Constants.sol new file mode 100644 index 000000000..12f76b536 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP12IssuedAssets/LSP12Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp12-contracts/contracts/LSP12Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol b/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol new file mode 100644 index 000000000..ecd0cf5f9 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/ILSP14Ownable2Step.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp14-contracts/contracts/ILSP14Ownable2Step.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Constants.sol b/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Constants.sol new file mode 100644 index 000000000..6155d1249 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp14-contracts/contracts/LSP14Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Errors.sol b/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Errors.sol new file mode 100644 index 000000000..f2181e6ff --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp14-contracts/contracts/LSP14Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol b/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol new file mode 100644 index 000000000..f0cb16816 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP14Ownable2Step/LSP14Ownable2Step.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp14-contracts/contracts/LSP14Ownable2Step.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol b/packages/lsp-smart-contracts/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol new file mode 100644 index 000000000..0693d5e67 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP16UniversalFactory/LSP16UniversalFactory.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp16-contracts/contracts/LSP16UniversalFactory.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Constants.sol b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Constants.sol new file mode 100644 index 000000000..9d7da33a9 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp17contractextension-contracts/contracts/LSP17Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Errors.sol b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Errors.sol new file mode 100644 index 000000000..a84a4b87b --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp17contractextension-contracts/contracts/LSP17Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Extendable.sol b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Extendable.sol new file mode 100644 index 000000000..a322d8fea --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Extendable.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp17contractextension-contracts/contracts/LSP17Extendable.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Extension.sol b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Extension.sol new file mode 100644 index 000000000..b856ae93a --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Extension.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp17contractextension-contracts/contracts/LSP17Extension.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Utils.sol b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Utils.sol new file mode 100644 index 000000000..ef3f287f9 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP17ContractExtension/LSP17Utils.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp17contractextension-contracts/contracts/LSP17Utils.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP17Extensions/Extension4337.sol b/packages/lsp-smart-contracts/contracts/LSP17Extensions/Extension4337.sol new file mode 100644 index 000000000..51815c2c5 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP17Extensions/Extension4337.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp17-contracts/contracts/Extension4337.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol b/packages/lsp-smart-contracts/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol new file mode 100644 index 000000000..0c3c2cf2a --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP17Extensions/OnERC721ReceivedExtension.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp17-contracts/contracts/OnERC721ReceivedExtension.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol new file mode 100644 index 000000000..a5da4d4ca --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiver.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp1-contracts/contracts/ILSP1UniversalReceiver.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol new file mode 100644 index 000000000..eef9463a9 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/ILSP1UniversalReceiverDelegate.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp1-contracts/contracts/ILSP1UniversalReceiverDelegate.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Constants.sol b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Constants.sol new file mode 100644 index 000000000..7b7e45b39 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp1-contracts/contracts/LSP1Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Errors.sol b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Errors.sol new file mode 100644 index 000000000..e60bb80f7 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp1delegate-contracts/contracts/LSP1Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol new file mode 100644 index 000000000..ce57e7b80 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateUP.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol new file mode 100644 index 000000000..c6910b037 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault/LSP1UniversalReceiverDelegateVault.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp1delegate-contracts/contracts/LSP1UniversalReceiverDelegateVault.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Utils.sol b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Utils.sol new file mode 100644 index 000000000..b699543ba --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP1UniversalReceiver/LSP1Utils.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp1-contracts/contracts/LSP1Utils.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP20CallVerification/ILSP20CallVerifier.sol b/packages/lsp-smart-contracts/contracts/LSP20CallVerification/ILSP20CallVerifier.sol new file mode 100644 index 000000000..5231c8715 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP20CallVerification/ILSP20CallVerifier.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp20-contracts/contracts/ILSP20CallVerifier.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20CallVerification.sol b/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20CallVerification.sol new file mode 100644 index 000000000..c659b4cdc --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20CallVerification.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp20-contracts/contracts/LSP20CallVerification.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20Constants.sol b/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20Constants.sol new file mode 100644 index 000000000..b0cbaa677 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp20-contracts/contracts/LSP20Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20Errors.sol b/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20Errors.sol new file mode 100644 index 000000000..40a513afa --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP20CallVerification/LSP20Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp20-contracts/contracts/LSP20Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/ILSP23LinkedContractsFactory.sol b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/ILSP23LinkedContractsFactory.sol new file mode 100644 index 000000000..eadc44d56 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/ILSP23LinkedContractsFactory.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp23-contracts/contracts/ILSP23LinkedContractsFactory.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/IPostDeploymentModule.sol b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/IPostDeploymentModule.sol new file mode 100644 index 000000000..280808e51 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/IPostDeploymentModule.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp23-contracts/contracts/IPostDeploymentModule.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/LSP23Errors.sol b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/LSP23Errors.sol new file mode 100644 index 000000000..7a1a33628 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/LSP23Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp23-contracts/contracts/LSP23Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/LSP23LinkedContractsFactory.sol b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/LSP23LinkedContractsFactory.sol new file mode 100644 index 000000000..e498c7946 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/LSP23LinkedContractsFactory.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp23-contracts/contracts/LSP23LinkedContractsFactory.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/README.md b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/README.md new file mode 100644 index 000000000..1232d6e66 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/README.md @@ -0,0 +1,23 @@ +# LSP23 Linked Contracts Deployment Module + +This folder contains modules related to the deployment of LSP23 Linked Contracts. The modules are essential for initializing and post-deploying actions for Universal Profiles. + +## Modules + +- **UniversalProfileInitPostDeploymentModule**: This module is responsible for the initial setup after the deployment of a Universal Profile Init contract. + + - **Standardized Address**: `0x000000000066093407b6704B89793beFfD0D8F00` + - **Standardized Salt**: `0x12a6712f113536d8b01d99f72ce168c7e10901240d73e80eeb821d01aa4c2b1a` + - [More Details](./deployment-UP-init-module.md) + +- **UniversalProfilePostDeploymentModule**: This module is responsible for the initial setup after the deployment of a Universal Profile contract. + - **Standardized Address**: `0x0000005aD606bcFEF9Ea6D0BbE5b79847054BcD7` + - **Standardized Salt**: `0x42ff55d7957589c62da54a4368b10a2bc549f2038bbb6880ec6b3e0ecae2ba58` + - [More Details](./deployment-UP-module.md) + +## Setup + +Before deploying any of these modules, make sure that the following contracts are already deployed on the same network: + +- [Nick's Factory contract](https://github.com/Arachnid/deterministic-deployment-proxy/tree/master) +- [LSP23 Linked Contracts Factory](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-23-LinkedContractsFactory.md#lsp23linkedcontractsfactory-deployment) diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/UniversalProfileInitPostDeploymentModule.sol b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/UniversalProfileInitPostDeploymentModule.sol new file mode 100644 index 000000000..336f3645e --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/UniversalProfileInitPostDeploymentModule.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp23-contracts/contracts/modules/UniversalProfileInitPostDeploymentModule.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/UniversalProfilePostDeploymentModule.sol b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/UniversalProfilePostDeploymentModule.sol new file mode 100644 index 000000000..eacb0ba87 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/UniversalProfilePostDeploymentModule.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp23-contracts/contracts/modules/UniversalProfilePostDeploymentModule.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/deployment-UP-init-module.md b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/deployment-UP-init-module.md new file mode 100644 index 000000000..13c2fc307 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/deployment-UP-init-module.md @@ -0,0 +1,92 @@ +# Setup + +Before the deployment of the `UniversalProfileInitPostDeploymentModule` on any network, people should make sure that the [Nick's Factory contract](https://github.com/Arachnid/deterministic-deployment-proxy/tree/master) is deployed on the same network. +You also need to make sure that the LSP23 Linked Contracts Factory is deployed on the same network. Please refer to [LSP23 Linked Contracts Deployment Factory LIP](https://github.com/lukso-network/LIPs/LSPs/LSP-23-LinkedContractsFactory.md#lsp23linkedcontractsfactory-deployment) in order to deploy it. + +# Deployment of the Universal Profile Init Post Deployment Module + +## Standardized Address + +`0x000000000066093407b6704B89793beFfD0D8F00` + +## Standardized Salt + +`0x12a6712f113536d8b01d99f72ce168c7e10901240d73e80eeb821d01aa4c2b1a` + +## Standardized Bytecode + +```solidity +0x60806040523480156200001157600080fd5b506200001c6200002c565b620000266200002c565b620000ed565b600054610100900460ff1615620000995760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff90811614620000eb576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b61497980620000fd6000396000f3fe6080604052600436106101635760003560e01c8063715018a6116100c0578063c4d66de811610074578063e30c397811610059578063e30c397814610451578063ead3fbdf1461020d578063f2fde38b1461047c5761019e565b8063c4d66de81461041e578063dedff9c6146104315761019e565b80637f23690c116100a55780637f23690c146103a65780638da5cb5b146103b9578063979024211461040b5761019e565b8063715018a61461037c57806379ba5097146103915761019e565b806344c028fe1161011757806354f6127f116100fc57806354f6127f146103295780636963d438146103495780636bb56a14146103695761019e565b806344c028fe146102f65780634f04d60a146103165761019e565b80631626ba7e116101485780631626ba7e1461026557806328c4d14e146102b657806331858452146102d65761019e565b806301bfba611461020d57806301ffc9a7146102355761019e565b3661019e57341561019c57604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b005b600036606034156101d757604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60043610156101f55750604080516020810190915260008152610202565b6101ff838361049c565b90505b915050805190602001f35b34801561021957600080fd5b5061022260c881565b6040519081526020015b60405180910390f35b34801561024157600080fd5b50610255610250366004613a93565b610677565b604051901515815260200161022c565b34801561027157600080fd5b50610285610280366004613bca565b61080c565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161022c565b3480156102c257600080fd5b5061019c6102d1366004613c7c565b610ac3565b6102e96102e4366004613de7565b610c2a565b60405161022c9190613fb2565b610309610304366004613fc5565b610cf4565b60405161022c919061401a565b61019c61032436600461402d565b610d95565b34801561033557600080fd5b506103096103443660046140a1565b610f19565b34801561035557600080fd5b506102e96103643660046140ba565b610f24565b61030961037736600461412f565b61109a565b34801561038857600080fd5b5061019c6112a2565b34801561039d57600080fd5b5061019c6113a7565b61019c6103b4366004613bca565b6114b1565b3480156103c557600080fd5b5060005462010000900473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161022c565b61019c61041936600461417b565b611552565b61019c61042c3660046141d5565b611681565b34801561043d57600080fd5b506102e961044c3660046141f0565b611815565b34801561045d57600080fd5b5060035473ffffffffffffffffffffffffffffffffffffffff166103e6565b34801561048857600080fd5b5061019c6104973660046141d5565b6118c0565b606060006104cd6000357fffffffff0000000000000000000000000000000000000000000000000000000016611b4f565b90506000357fffffffff0000000000000000000000000000000000000000000000000000000016158015610515575073ffffffffffffffffffffffffffffffffffffffff8116155b15610530575050604080516020810190915260008152610671565b73ffffffffffffffffffffffffffffffffffffffff81166105a8576040517fbb370b2b0000000000000000000000000000000000000000000000000000000081527fffffffff000000000000000000000000000000000000000000000000000000006000351660048201526024015b60405180910390fd5b6000808273ffffffffffffffffffffffffffffffffffffffff16868633346040516020016105d99493929190614225565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261061191614268565b6000604051808303816000865af19150503d806000811461064e576040519150601f19603f3d011682016040523d82523d6000602084013e610653565b606091505b50915091508115610668579250610671915050565b80518060208301fd5b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f1626ba7e00000000000000000000000000000000000000000000000000000000148061070a57507fffffffff0000000000000000000000000000000000000000000000000000000082167f24871b3d00000000000000000000000000000000000000000000000000000000145b8061075657507fffffffff0000000000000000000000000000000000000000000000000000000082167f6bb56a1400000000000000000000000000000000000000000000000000000000145b806107a257507fffffffff0000000000000000000000000000000000000000000000000000000082167f94be599900000000000000000000000000000000000000000000000000000000145b806107ee57507fffffffff0000000000000000000000000000000000000000000000000000000082167f1a0eb6a500000000000000000000000000000000000000000000000000000000145b806107fd57506107fd82611bbf565b80610671575061067182611c15565b6000805462010000900473ffffffffffffffffffffffffffffffffffffffff16803b156109e0576000808273ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b8787604051602401610868929190614284565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290516108f19190614268565b600060405180830381855afa9150503d806000811461092c576040519150601f19603f3d011682016040523d82523d6000602084013e610931565b606091505b50915091506000828015610946575081516020145b8015610986575081517f1626ba7e0000000000000000000000000000000000000000000000000000000090610984908401602090810190850161429d565b145b9050806109b3577fffffffff000000000000000000000000000000000000000000000000000000006109d5565b7f1626ba7e000000000000000000000000000000000000000000000000000000005b945050505050610671565b6000806109ed8686611c78565b90925090506000816004811115610a0657610a066142b6565b14610a3757507fffffffff000000000000000000000000000000000000000000000000000000009250610671915050565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a90577fffffffff00000000000000000000000000000000000000000000000000000000610ab2565b7f1626ba7e000000000000000000000000000000000000000000000000000000005b9350505050610671565b5092915050565b600080610ad28385018561417b565b915091508573ffffffffffffffffffffffffffffffffffffffff166344c028fe600430600086868b604051602401610b0c939291906142e5565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f4f04d60a000000000000000000000000000000000000000000000000000000001790525160e086901b7fffffffff00000000000000000000000000000000000000000000000000000000168152610bbc949392919060040161435a565b6000604051808303816000875af1158015610bdb573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610c219190810190614395565b50505050505050565b60603415610c6057604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1633819003610c9b57610c9386868686611cbd565b915050610cec565b6000610ca682611e4d565b90506000610cb688888888611cbd565b90508115610ce757610ce78382604051602001610cd39190613fb2565b604051602081830303815290604052612060565b925050505b949350505050565b60603415610d2a57604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1633819003610d5d57610c9386868686612233565b6000610d6882611e4d565b90506000610d7888888888612233565b90508115610ce757610ce78382604051602001610cd3919061401a565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152606860248201527f556e6976657273616c50726f66696c65496e6974506f73744465706c6f796d6560448201527f6e744d6f64756c653a2073657444617461416e645472616e736665724f776e6560648201527f7273686970206f6e6c7920616c6c6f776564207468726f7567682064656c656760848201527f6174652063616c6c00000000000000000000000000000000000000000000000060a482015260c40161059f565b60005b8351811015610f0a57610f02848281518110610edb57610edb614403565b6020026020010151848381518110610ef557610ef5614403565b60200260200101516123d5565b600101610ebd565b50610f1481612449565b505050565b6060610671826124ef565b60608167ffffffffffffffff811115610f3f57610f3f613ab0565b604051908082528060200260200182016040528015610f7257816020015b6060815260200190600190039081610f5d5790505b50905060005b82811015610abc5760008030868685818110610f9657610f96614403565b9050602002810190610fa89190614432565b604051610fb6929190614497565b600060405180830381855af49150503d8060008114610ff1576040519150601f19603f3d011682016040523d82523d6000602084013e610ff6565b606091505b509150915081611072578051156110105780518082602001fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4c5350303a20626174636843616c6c7320726576657274656400000000000000604482015260640161059f565b8084848151811061108557611085614403565b60209081029190910101525050600101610f78565b606034156110d057604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60006110fb7f0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b476124ef565b905060606014825110611170576000611113836144a7565b60601c9050611142817f6bb56a1400000000000000000000000000000000000000000000000000000000612591565b1561116e5761116b73ffffffffffffffffffffffffffffffffffffffff82168888883334612660565b91505b505b600061119c7f0cfc51aec37c55a4d0b10000000000000000000000000000000000000000000088612800565b905060006111a9826124ef565b90506060601482511061121e5760006111c1836144a7565b60601c90506111f0817f6bb56a1400000000000000000000000000000000000000000000000000000000612591565b1561121c5761121973ffffffffffffffffffffffffffffffffffffffff82168b8b8b3334612660565b91505b505b83816040516020016112319291906144f7565b604051602081830303815290604052955088343373ffffffffffffffffffffffffffffffffffffffff167f9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c28b8b8b60405161128e93929190614565565b60405180910390a450505050509392505050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff16338190036112d4576112d161287c565b50565b60006112df82611e4d565b9050600061130960005473ffffffffffffffffffffffffffffffffffffffff620100009091041690565b905061131361287c565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff16611388576040805160208101909152600081526113889073ffffffffffffffffffffffffffffffffffffffff8316907fa4e59c931d14f7c8a7a35027f92ee40b5f2886b9fdcdb78f30bc5ecce5a2f814906129b8565b8115610f1457610f148360405180602001604052806000815250612060565b60035474010000000000000000000000000000000000000000900460ff16156113fc576040517f5758dd0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005462010000900473ffffffffffffffffffffffffffffffffffffffff16611423612aa0565b6040805160208101909152600081526114759073ffffffffffffffffffffffffffffffffffffffff8316907fa4e59c931d14f7c8a7a35027f92ee40b5f2886b9fdcdb78f30bc5ecce5a2f814906129b8565b6040805160208101909152600081526112d19033907fceca317f109c43507871523e82dc2a3cc64dfa18f12da0b6db14f6e23f995538906129b8565b34156114e557604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60005462010000900473ffffffffffffffffffffffffffffffffffffffff163381900361151657610f1483836123d5565b600061152182611e4d565b905061152d84846123d5565b801561154c5761154c8260405180602001604052806000815250612060565b50505050565b341561158657604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b80518251146115c1576040517f3bcc897900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005462010000900473ffffffffffffffffffffffffffffffffffffffff16338190036116115760005b835181101561154c57611609848281518110610edb57610edb614403565b6001016115eb565b600061161c82611e4d565b905060005b84518110156116615761165985828151811061163f5761163f614403565b6020026020010151858381518110610ef557610ef5614403565b600101611621565b50801561154c5761154c8260405180602001604052806000815250612060565b600054610100900460ff16158080156116a15750600054600160ff909116105b806116bb5750303b1580156116bb575060005460ff166001145b611747576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161059f565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156117a557600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6117ae82612b7a565b801561181157600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b6060815167ffffffffffffffff81111561183157611831613ab0565b60405190808252806020026020018201604052801561186457816020015b606081526020019060019003908161184f5790505b50905060005b82518110156118ba5761189583828151811061188857611888614403565b60200260200101516124ef565b8282815181106118a7576118a7614403565b602090810291909101015260010161186a565b50919050565b60005462010000900473ffffffffffffffffffffffffffffffffffffffff1633819003611a0757600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905561192f82612c7c565b8173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a36040805160208101909152600081526119db9073ffffffffffffffffffffffffffffffffffffffff8416907fe17117c9d2665d1dbeb479ed8058bbebde3c50ac50e2e65619f60006caac6926906129b8565b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050565b6000611a1282611e4d565b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790559050611a5c83612c7c565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a3604080516020810190915260008152611b089073ffffffffffffffffffffffffffffffffffffffff8516907fe17117c9d2665d1dbeb479ed8058bbebde3c50ac50e2e65619f60006caac6926906129b8565b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690558015610f1457610f148260405180602001604052806000815250612060565b600080611b9e7fcee78b4094da86011096000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008516612800565b90506000611bab826124ef565b611bb4906144a7565b60601c949350505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fa918fa6b000000000000000000000000000000000000000000000000000000001480610671575061067182612d17565b600080611c417f01ffc9a700000000000000000000000000000000000000000000000000000000611b4f565b905073ffffffffffffffffffffffffffffffffffffffff8116611c675750600092915050565b611c718184612591565b9392505050565b6000808251604103611cae5760208301516040840151606085015160001a611ca287828585612d6d565b94509450505050611cb6565b506000905060025b9250929050565b606083518551141580611cde575082518451141580611cde57508151835114155b15611d15576040517f3ff55f4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8451600003611d50576040517fe9ad2b5f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000855167ffffffffffffffff811115611d6c57611d6c613ab0565b604051908082528060200260200182016040528015611d9f57816020015b6060815260200190600190039081611d8a5790505b50905060005b8651811015611e4357611e1e878281518110611dc357611dc3614403565b6020026020010151878381518110611ddd57611ddd614403565b6020026020010151878481518110611df757611df7614403565b6020026020010151878581518110611e1157611e11614403565b6020026020010151612233565b828281518110611e3057611e30614403565b6020908102919091010152600101611da5565b5095945050505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff16639bf04b1160e01b3334600036604051602401611e89949392919061458b565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051611f129190614268565b6000604051808303816000865af19150503d8060008114611f4f576040519150601f19603f3d011682016040523d82523d6000602084013e611f54565b606091505b5091509150611f6560008383612e5c565b600081806020019051810190611f7b91906145c1565b90507fffffff000000000000000000000000000000000000000000000000000000000081167f9bf04b000000000000000000000000000000000000000000000000000000000014611ffd576000826040517fd088ec4000000000000000000000000000000000000000000000000000000000815260040161059f9291906145de565b7f01000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000600383901a60f81b1614612054576000612057565b60015b95945050505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1663d3fc45d360e01b333460003660405160200161209a94939291906145f9565b60405160208183030381529060405280519060200120856040516024016120c2929190614284565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090941693909317909252905161214b9190614268565b6000604051808303816000865af19150503d8060008114612188576040519150601f19603f3d011682016040523d82523d6000602084013e61218d565b606091505b509150915061219e60018383612e5c565b80517fd3fc45d300000000000000000000000000000000000000000000000000000000906121d590830160209081019084016145c1565b7fffffffff00000000000000000000000000000000000000000000000000000000161461154c576001816040517fd088ec4000000000000000000000000000000000000000000000000000000000815260040161059f9291906145de565b60608461224c57612245848484612ee5565b9050610cec565b600185036122ac5773ffffffffffffffffffffffffffffffffffffffff8416156122a2576040517f3041824a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612245838361305c565b6002850361230c5773ffffffffffffffffffffffffffffffffffffffff841615612302576040517f3041824a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61224583836131d5565b6003850361235657821561234c576040517f72f2bc6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61224584836132f8565b600485036123a0578215612396576040517f5ac8313500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6122458483613420565b6040517f7583b3bc0000000000000000000000000000000000000000000000000000000081526004810186905260240161059f565b60008281526001602052604090206123ed82826146da565b50817fece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b26101008351111561242e576124298360006101006134fe565b612430565b825b60405161243d919061401a565b60405180910390a25050565b60005473ffffffffffffffffffffffffffffffffffffffff8281166201000090920416146112d1576000805473ffffffffffffffffffffffffffffffffffffffff838116620100008181027fffffffffffffffffffff0000000000000000000000000000000000000000ffff851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600081815260016020526040902080546060919061250c9061463f565b80601f01602080910402602001604051908101604052809291908181526020018280546125389061463f565b80156125855780601f1061255a57610100808354040283529160200191612585565b820191906000526020600020905b81548152906001019060200180831161256857829003601f168201915b50505050509050919050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d91506000519050828015612649575060208210155b80156126555750600081115b979650505050505050565b60606000636bb56a1460e01b878787604051602401612681939291906147f4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909516949094179093525161270e92879187910161480e565b60405160208183030381529060405290506000808973ffffffffffffffffffffffffffffffffffffffff16836040516127479190614268565b6000604051808303816000865af19150503d8060008114612784576040519150601f19603f3d011682016040523d82523d6000602084013e612789565b606091505b50915091506127ce82826040518060400160405280602081526020017f43616c6c20746f20756e6976657273616c5265636569766572206661696c6564815250613678565b5080516000036127de57806127f2565b808060200190518101906127f29190614395565b9a9950505050505050505050565b604080517fffffffffffffffffffff00000000000000000000000000000000000000000000841660208201526000602a82018190527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008416602c83015291829101604051602081830303815290604052905080610cec90614860565b60025443906000906128909060c8906148d1565b9050600061289f60c8836148d1565b9050808311806128af5750600254155b1561290f576002839055600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556040517f81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e790600090a1505050565b81831015612953576040517f8b9bf507000000000000000000000000000000000000000000000000000000008152600481018390526024810182905260440161059f565b61295d6000612449565b60006002819055600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556040517fd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce9190a1505050565b6129e2837f6bb56a1400000000000000000000000000000000000000000000000000000000612591565b15610f14576040517f6bb56a1400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841690636bb56a1490612a3b9085908590600401614284565b6000604051808303816000875af1158015612a5a573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820160405261154c9190810190614395565b60035473ffffffffffffffffffffffffffffffffffffffff163314612b47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4c535031343a2063616c6c6572206973206e6f74207468652070656e64696e6760448201527f4f776e6572000000000000000000000000000000000000000000000000000000606482015260840161059f565b612b5033612449565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b600054610100900460ff16612c11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161059f565b612c1a81613691565b6112d17feafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce61634760001b6040518060400160405280600481526020017f5ef83ad9000000000000000000000000000000000000000000000000000000008152506123d5565b3073ffffffffffffffffffffffffffffffffffffffff821603612ccb576040517f43b248cd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556000600255565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f629aa694000000000000000000000000000000000000000000000000000000001480610671575061067182613765565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612da45750600090506003612e53565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612df8573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116612e4c57600060019250925050612e53565b9150600090505b94509492505050565b81612e6b57612e6b83826137fc565b602081511080612eaa575060006020612e8383614860565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000911b1614155b15610f145782816040517fd088ec4000000000000000000000000000000000000000000000000000000000815260040161059f9291906145de565b606082471015612f2a576040517f0df9a8f80000000000000000000000000000000000000000000000000000000081524760048201526024810184905260440161059f565b8273ffffffffffffffffffffffffffffffffffffffff851660007f4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e612f6e866148e4565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390a46000808573ffffffffffffffffffffffffffffffffffffffff168585604051612fcb9190614268565b60006040518083038185875af1925050503d8060008114613008576040519150601f19603f3d011682016040523d82523d6000602084013e61300d565b606091505b509150915061305282826040518060400160405280601681526020017f455243373235583a20556e6b6e6f776e204572726f7200000000000000000000815250613678565b9695505050505050565b6060824710156130a1576040517f0df9a8f80000000000000000000000000000000000000000000000000000000081524760048201526024810184905260440161059f565b81516000036130dc576040517fb81cd8d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082516020840185f0905073ffffffffffffffffffffffffffffffffffffffff8116613135576040517f0b07489b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838173ffffffffffffffffffffffffffffffffffffffff1660017fa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c36000801b60405161318391815260200190565b60405180910390a46040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606083901b16602082015260340160405160208183030381529060405291505092915050565b60608151600003613212576040517fb81cd8d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061322b83602085516132269190614930565b613842565b90506000613248846000602087516132439190614930565b6134fe565b905060006132578684846138c2565b9050858173ffffffffffffffffffffffffffffffffffffffff1660027fa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3866040516132a491815260200190565b60405180910390a46040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606083901b166020820152603401604051602081830303815290604052935050505092915050565b6060600073ffffffffffffffffffffffffffffffffffffffff841660037f4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e61333f866148e4565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390a46000808473ffffffffffffffffffffffffffffffffffffffff168460405161339b9190614268565b600060405180830381855afa9150503d80600081146133d6576040519150601f19603f3d011682016040523d82523d6000602084013e6133db565b606091505b509150915061205782826040518060400160405280601681526020017f455243373235583a20556e6b6e6f776e204572726f7200000000000000000000815250613678565b6060600073ffffffffffffffffffffffffffffffffffffffff841660047f4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e613467866148e4565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390a46000808473ffffffffffffffffffffffffffffffffffffffff16846040516134c39190614268565b600060405180830381855af49150503d80600081146133d6576040519150601f19603f3d011682016040523d82523d6000602084013e6133db565b60608161350c81601f6148d1565b1015613574576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015260640161059f565b61357e82846148d1565b845110156135e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015260640161059f565b606082158015613607576040519150600082526020820160405261366f565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015613640578051835260209283019201613628565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b50949350505050565b60608315613687575081611c71565b611c718383613a21565b600054610100900460ff16613728576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161059f565b341561375c57604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b6112d181612449565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7545acac00000000000000000000000000000000000000000000000000000000148061067157507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610671565b80511561380c5780518082602001fd5b6040517f8c6a8ae3000000000000000000000000000000000000000000000000000000008152821515600482015260240161059f565b600061384f8260206148d1565b835110156138b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f427974657333325f6f75744f66426f756e64730000000000000000000000604482015260640161059f565b50016020015190565b60008347101561392e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015260640161059f565b8151600003613999576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015260640161059f565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116611c71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015260640161059f565b815115613a315781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161059f919061401a565b7fffffffff00000000000000000000000000000000000000000000000000000000811681146112d157600080fd5b600060208284031215613aa557600080fd5b8135611c7181613a65565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613b2657613b26613ab0565b604052919050565b600067ffffffffffffffff821115613b4857613b48613ab0565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f830112613b8557600080fd5b8135613b98613b9382613b2e565b613adf565b818152846020838601011115613bad57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215613bdd57600080fd5b82359150602083013567ffffffffffffffff811115613bfb57600080fd5b613c0785828601613b74565b9150509250929050565b803573ffffffffffffffffffffffffffffffffffffffff81168114613c3557600080fd5b919050565b60008083601f840112613c4c57600080fd5b50813567ffffffffffffffff811115613c6457600080fd5b602083019150836020828501011115611cb657600080fd5b60008060008060608587031215613c9257600080fd5b613c9b85613c11565b9350613ca960208601613c11565b9250604085013567ffffffffffffffff811115613cc557600080fd5b613cd187828801613c3a565b95989497509550505050565b600067ffffffffffffffff821115613cf757613cf7613ab0565b5060051b60200190565b600082601f830112613d1257600080fd5b81356020613d22613b9383613cdd565b82815260059290921b84018101918181019086841115613d4157600080fd5b8286015b84811015613d5c5780358352918301918301613d45565b509695505050505050565b600082601f830112613d7857600080fd5b81356020613d88613b9383613cdd565b82815260059290921b84018101918181019086841115613da757600080fd5b8286015b84811015613d5c57803567ffffffffffffffff811115613dcb5760008081fd5b613dd98986838b0101613b74565b845250918301918301613dab565b60008060008060808587031215613dfd57600080fd5b843567ffffffffffffffff80821115613e1557600080fd5b613e2188838901613d01565b9550602091508187013581811115613e3857600080fd5b8701601f81018913613e4957600080fd5b8035613e57613b9382613cdd565b81815260059190911b8201840190848101908b831115613e7657600080fd5b928501925b82841015613e9b57613e8c84613c11565b82529285019290850190613e7b565b97505050506040870135915080821115613eb457600080fd5b613ec088838901613d01565b93506060870135915080821115613ed657600080fd5b50613ee387828801613d67565b91505092959194509250565b60005b83811015613f0a578181015183820152602001613ef2565b50506000910152565b60008151808452613f2b816020860160208601613eef565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015613fa5578284038952613f93848351613f13565b98850198935090840190600101613f7b565b5091979650505050505050565b602081526000611c716020830184613f5d565b60008060008060808587031215613fdb57600080fd5b84359350613feb60208601613c11565b925060408501359150606085013567ffffffffffffffff81111561400e57600080fd5b613ee387828801613b74565b602081526000611c716020830184613f13565b60008060006060848603121561404257600080fd5b833567ffffffffffffffff8082111561405a57600080fd5b61406687838801613d01565b9450602086013591508082111561407c57600080fd5b5061408986828701613d67565b92505061409860408501613c11565b90509250925092565b6000602082840312156140b357600080fd5b5035919050565b600080602083850312156140cd57600080fd5b823567ffffffffffffffff808211156140e557600080fd5b818501915085601f8301126140f957600080fd5b81358181111561410857600080fd5b8660208260051b850101111561411d57600080fd5b60209290920196919550909350505050565b60008060006040848603121561414457600080fd5b83359250602084013567ffffffffffffffff81111561416257600080fd5b61416e86828701613c3a565b9497909650939450505050565b6000806040838503121561418e57600080fd5b823567ffffffffffffffff808211156141a657600080fd5b6141b286838701613d01565b935060208501359150808211156141c857600080fd5b50613c0785828601613d67565b6000602082840312156141e757600080fd5b611c7182613c11565b60006020828403121561420257600080fd5b813567ffffffffffffffff81111561421957600080fd5b610cec84828501613d01565b8385823760609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016919092019081526014810191909152603401919050565b6000825161427a818460208701613eef565b9190910192915050565b828152604060208201526000610cec6040830184613f13565b6000602082840312156142af57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b606080825284519082018190526000906020906080840190828801845b8281101561431e57815184529284019290840190600101614302565b505050838103828501526143328187613f5d565b9250505073ffffffffffffffffffffffffffffffffffffffff83166040830152949350505050565b84815273ffffffffffffffffffffffffffffffffffffffff841660208201528260408201526080606082015260006130526080830184613f13565b6000602082840312156143a757600080fd5b815167ffffffffffffffff8111156143be57600080fd5b8201601f810184136143cf57600080fd5b80516143dd613b9382613b2e565b8181528560208385010111156143f257600080fd5b612057826020830160208601613eef565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261446757600080fd5b83018035915067ffffffffffffffff82111561448257600080fd5b602001915036819003821315611cb657600080fd5b8183823760009101908152919050565b6000815160208301517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808216935060148310156144ef5780818460140360031b1b83161693505b505050919050565b60408152600061450a6040830185613f13565b82810360208401526120578185613f13565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60408152600061457960408301858761451c565b82810360208401526130528185613f13565b73ffffffffffffffffffffffffffffffffffffffff8516815283602082015260606040820152600061305260608301848661451c565b6000602082840312156145d357600080fd5b8151611c7181613a65565b8215158152604060208201526000610cec6040830184613f13565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008560601b16815283601482015281836034830137600091016034019081529392505050565b600181811c9082168061465357607f821691505b6020821081036118ba577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b601f821115610f1457600081815260208120601f850160051c810160208610156146b35750805b601f850160051c820191505b818110156146d2578281556001016146bf565b505050505050565b815167ffffffffffffffff8111156146f4576146f4613ab0565b61470881614702845461463f565b8461468c565b602080601f83116001811461475b57600084156147255750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556146d2565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156147a857888601518255948401946001909101908401614789565b50858210156147e457878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b83815260406020820152600061205760408301848661451c565b60008451614820818460208901613eef565b60609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001691909301908152601481019190915260340192915050565b805160208083015191908110156118ba577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60209190910360031b1b16919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115610671576106716148a2565b6000815160208301517fffffffff00000000000000000000000000000000000000000000000000000000808216935060048310156144ef5760049290920360031b82901b161692915050565b81810381811115610671576106716148a256fea26469706673582212204c716f85d1145bcbe75de9c2eb2914430942e4f65ea5e7afda664b1551460c7f64736f6c63430008110033 +``` + +## Universal Profile Init Post Deployment Module Source Code + +This is an exact copy of the code of the [`UniversalProfileInitPostDeploymentModule` smart contract]. + +- The source code is generated with `solc` compiler version `0.8.17` and with `9999999` optimization runs. +- The imported contracts are part of the `4.9.2` version of the `@openzeppelin/contracts` package. +- Navigate to [lsp-smart-contract](https://github.com/lukso-network/lsp-smart-contracts) repo and checkout to `b8eca3c5696acf85239130ef67edec9e8c134bfa` commit to obtain the exact copy of the code, change the compiler settings in `hardhat.config.ts` and compile to produce the same bytecode. + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.4; + +import { OPERATION_4_DELEGATECALL } from "@erc725/smart-contracts/contracts/constants.sol"; + +import { UniversalProfileInit } from "../../UniversalProfileInit.sol"; + +contract UniversalProfileInitPostDeploymentModule is UniversalProfileInit { + constructor() { + _disableInitializers(); + } + + function setDataAndTransferOwnership( + bytes32[] memory dataKeys, + bytes[] memory dataValues, + address newOwner + ) public payable { + // check that the msg.sender is the owner + require( + msg.sender == owner(), + "UniversalProfileInitPostDeploymentModule: setDataAndTransferOwnership only allowed through delegate call" + ); + + // update the dataKeys and dataValues in the UniversalProfile contract + for (uint256 i = 0; i < dataKeys.length; ) { + _setData(dataKeys[i], dataValues[i]); + + unchecked { + ++i; + } + } + + // transfer the ownership of the UniversalProfile contract to the newOwner + _setOwner(newOwner); + } + + function executePostDeployment( + address universalProfile, + address keyManager, + bytes calldata setDataBatchBytes + ) public { + // retrieve the dataKeys and dataValues to setData from the initializationCalldata bytes + (bytes32[] memory dataKeys, bytes[] memory dataValues) = abi.decode( + setDataBatchBytes, + (bytes32[], bytes[]) + ); + + // call the execute function with delegate_call on the universalProfile contract to setData and transferOwnership + UniversalProfileInit(payable(universalProfile)).execute( + OPERATION_4_DELEGATECALL, + address(this), + 0, + abi.encodeWithSignature( + "setDataAndTransferOwnership(bytes32[],bytes[],address)", + dataKeys, + dataValues, + keyManager + ) + ); + } +} +``` diff --git a/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/deployment-UP-module.md b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/deployment-UP-module.md new file mode 100644 index 000000000..d046f4a4a --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP23LinkedContractsFactory/modules/deployment-UP-module.md @@ -0,0 +1,90 @@ +# Setup + +Before the deployment of the `UniversalProfilePostDeploymentModule` on any network, people should make sure that the [Nick's Factory contract](https://github.com/Arachnid/deterministic-deployment-proxy/tree/master) is deployed on the same network. +You also need to make sure that the LSP23 Linked Contracts Factory is deployed on the same network. Please refer to [LSP23 Linked Contracts Deployment Factory LIP](https://github.com/lukso-network/LIPs/LSPs/LSP-23-LinkedContractsFactory.md#lsp23linkedcontractsfactory-deployment) in order to deploy it. + +# Deployment of the Universal Profile Post Deployment Module + +## Standardized Address + +`0x0000005aD606bcFEF9Ea6D0BbE5b79847054BcD7` + +## Standardized Salt + +`0x42ff55d7957589c62da54a4368b10a2bc549f2038bbb6880ec6b3e0ecae2ba58 ` + +## Standardized Bytecode + +```solidity +0x60806040523480156200001157600080fd5b5060008034156200004a57604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b6200006081620000b060201b620019381760201c565b506040805180820190915260048152635ef83ad960e01b6020820152620000a9907feafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce6163479062000117565b50620004a4565b6000546001600160a01b038281169116146200011457600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a3505b50565b600082815260016020526040902062000131828262000360565b50817fece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b26101008351111562000181576200017b8360006101006200019e60201b620019cf1760201c565b62000183565b825b6040516200019291906200042c565b60405180910390a25050565b606081620001ae81601f6200047c565b1015620001f35760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b60448201526064015b60405180910390fd5b620001ff82846200047c565b84511015620002455760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401620001ea565b606082158015620002665760405191506000825260208201604052620002b2565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015620002a157805183526020928301920162000287565b5050858452601f01601f1916604052505b50949350505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002e657607f821691505b6020821081036200030757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200035b57600081815260208120601f850160051c81016020861015620003365750805b601f850160051c820191505b81811015620003575782815560010162000342565b5050505b505050565b81516001600160401b038111156200037c576200037c620002bb565b62000394816200038d8454620002d1565b846200030d565b602080601f831160018114620003cc5760008415620003b35750858301515b600019600386901b1c1916600185901b17855562000357565b600085815260208120601f198616915b82811015620003fd57888601518255948401946001909101908401620003dc565b50858210156200041c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208083528351808285015260005b818110156200045b578581018301518582016040015282016200043d565b506000604082860101526040601f19601f8301168501019250505092915050565b808201808211156200049e57634e487b7160e01b600052601160045260246000fd5b92915050565b61457880620004b46000396000f3fe6080604052600436106101485760003560e01c80636bb56a14116100c05780639790242111610074578063e30c397811610059578063e30c39781461041d578063ead3fbdf146101f2578063f2fde38b1461044857610183565b806397902421146103ea578063dedff9c6146103fd57610183565b806379ba5097116100a557806379ba5097146103765780637f23690c1461038b5780638da5cb5b1461039e57610183565b80636bb56a141461034e578063715018a61461036157610183565b806331858452116101175780634f04d60a116100fc5780634f04d60a146102fb57806354f6127f1461030e5780636963d4381461032e57610183565b806331858452146102bb57806344c028fe146102db57610183565b806301bfba61146101f257806301ffc9a71461021a5780631626ba7e1461024a57806328c4d14e1461029b57610183565b3661018357341561018157604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b005b600036606034156101bc57604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60043610156101da57506040805160208101909152600081526101e7565b6101e48383610468565b90505b915050805190602001f35b3480156101fe57600080fd5b5061020760c881565b6040519081526020015b60405180910390f35b34801561022657600080fd5b5061023a610235366004613692565b610643565b6040519015158152602001610211565b34801561025657600080fd5b5061026a6102653660046137c9565b6107d8565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610211565b3480156102a757600080fd5b506101816102b636600461387b565b610aa9565b6102ce6102c93660046139e6565b610c10565b6040516102119190613bb1565b6102ee6102e9366004613bc4565b610cd4565b6040516102119190613c19565b610181610309366004613c2c565b610d6f565b34801561031a57600080fd5b506102ee610329366004613ca0565b610ec1565b34801561033a57600080fd5b506102ce610349366004613cb9565b610ecc565b6102ee61035c366004613d2e565b611042565b34801561036d57600080fd5b5061018161124a565b34801561038257600080fd5b5061018161133c565b6101816103993660046137c9565b611440565b3480156103aa57600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610211565b6101816103f8366004613d7a565b6114db565b34801561040957600080fd5b506102ce610418366004613dd4565b611604565b34801561042957600080fd5b5060035473ffffffffffffffffffffffffffffffffffffffff166103c5565b34801561045457600080fd5b50610181610463366004613e09565b6116af565b606060006104996000357fffffffff0000000000000000000000000000000000000000000000000000000016611b4b565b90506000357fffffffff00000000000000000000000000000000000000000000000000000000161580156104e1575073ffffffffffffffffffffffffffffffffffffffff8116155b156104fc57505060408051602081019091526000815261063d565b73ffffffffffffffffffffffffffffffffffffffff8116610574576040517fbb370b2b0000000000000000000000000000000000000000000000000000000081527fffffffff000000000000000000000000000000000000000000000000000000006000351660048201526024015b60405180910390fd5b6000808273ffffffffffffffffffffffffffffffffffffffff16868633346040516020016105a59493929190613e24565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290526105dd91613e67565b6000604051808303816000865af19150503d806000811461061a576040519150601f19603f3d011682016040523d82523d6000602084013e61061f565b606091505b5091509150811561063457925061063d915050565b80518060208301fd5b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f1626ba7e0000000000000000000000000000000000000000000000000000000014806106d657507fffffffff0000000000000000000000000000000000000000000000000000000082167f24871b3d00000000000000000000000000000000000000000000000000000000145b8061072257507fffffffff0000000000000000000000000000000000000000000000000000000082167f6bb56a1400000000000000000000000000000000000000000000000000000000145b8061076e57507fffffffff0000000000000000000000000000000000000000000000000000000082167f94be599900000000000000000000000000000000000000000000000000000000145b806107ba57507fffffffff0000000000000000000000000000000000000000000000000000000082167f1a0eb6a500000000000000000000000000000000000000000000000000000000145b806107c957506107c982611bbb565b8061063d575061063d82611c11565b6000806107fa60005473ffffffffffffffffffffffffffffffffffffffff1690565b905073ffffffffffffffffffffffffffffffffffffffff81163b156109c6576000808273ffffffffffffffffffffffffffffffffffffffff16631626ba7e60e01b878760405160240161084e929190613e83565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290516108d79190613e67565b600060405180830381855afa9150503d8060008114610912576040519150601f19603f3d011682016040523d82523d6000602084013e610917565b606091505b5091509150600082801561092c575081516020145b801561096c575081517f1626ba7e000000000000000000000000000000000000000000000000000000009061096a9084016020908101908501613e9c565b145b905080610999577fffffffff000000000000000000000000000000000000000000000000000000006109bb565b7f1626ba7e000000000000000000000000000000000000000000000000000000005b94505050505061063d565b6000806109d38686611c6d565b909250905060008160048111156109ec576109ec613eb5565b14610a1d57507fffffffff00000000000000000000000000000000000000000000000000000000925061063d915050565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a76577fffffffff00000000000000000000000000000000000000000000000000000000610a98565b7f1626ba7e000000000000000000000000000000000000000000000000000000005b935050505061063d565b5092915050565b600080610ab883850185613d7a565b915091508573ffffffffffffffffffffffffffffffffffffffff166344c028fe600430600086868b604051602401610af293929190613ee4565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f4f04d60a000000000000000000000000000000000000000000000000000000001790525160e086901b7fffffffff00000000000000000000000000000000000000000000000000000000168152610ba29493929190600401613f59565b6000604051808303816000875af1158015610bc1573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201604052610c079190810190613f94565b50505050505050565b60603415610c4657604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60005473ffffffffffffffffffffffffffffffffffffffff1633819003610c7b57610c7386868686611cb2565b915050610ccc565b6000610c8682611e42565b90506000610c9688888888611cb2565b90508115610cc757610cc78382604051602001610cb39190613bb1565b604051602081830303815290604052612055565b925050505b949350505050565b60603415610d0a57604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60005473ffffffffffffffffffffffffffffffffffffffff1633819003610d3757610c7386868686612228565b6000610d4282611e42565b90506000610d5288888888612228565b90508115610cc757610cc78382604051602001610cb39190613c19565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e62576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152606860248201527f556e6976657273616c50726f66696c65496e6974506f73744465706c6f796d6560448201527f6e744d6f64756c653a2073657444617461416e645472616e736665724f776e6560648201527f7273686970206f6e6c7920616c6c6f776564207468726f7567682064656c656760848201527f6174652063616c6c00000000000000000000000000000000000000000000000060a482015260c40161056b565b60005b8351811015610eb257610eaa848281518110610e8357610e83614002565b6020026020010151848381518110610e9d57610e9d614002565b60200260200101516123ca565b600101610e65565b50610ebc81611938565b505050565b606061063d8261243e565b60608167ffffffffffffffff811115610ee757610ee76136af565b604051908082528060200260200182016040528015610f1a57816020015b6060815260200190600190039081610f055790505b50905060005b82811015610aa25760008030868685818110610f3e57610f3e614002565b9050602002810190610f509190614031565b604051610f5e929190614096565b600060405180830381855af49150503d8060008114610f99576040519150601f19603f3d011682016040523d82523d6000602084013e610f9e565b606091505b50915091508161101a57805115610fb85780518082602001fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4c5350303a20626174636843616c6c7320726576657274656400000000000000604482015260640161056b565b8084848151811061102d5761102d614002565b60209081029190910101525050600101610f20565b6060341561107857604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60006110a37f0cfc51aec37c55a4d0b1a65c6255c4bf2fbdf6277f3cc0730c45b828b6db8b4761243e565b9050606060148251106111185760006110bb836140a6565b60601c90506110ea817f6bb56a14000000000000000000000000000000000000000000000000000000006124e0565b156111165761111373ffffffffffffffffffffffffffffffffffffffff821688888833346125af565b91505b505b60006111447f0cfc51aec37c55a4d0b1000000000000000000000000000000000000000000008861274f565b905060006111518261243e565b9050606060148251106111c6576000611169836140a6565b60601c9050611198817f6bb56a14000000000000000000000000000000000000000000000000000000006124e0565b156111c4576111c173ffffffffffffffffffffffffffffffffffffffff82168b8b8b33346125af565b91505b505b83816040516020016111d99291906140f6565b604051602081830303815290604052955088343373ffffffffffffffffffffffffffffffffffffffff167f9c3ba68eb5742b8e3961aea0afc7371a71bf433c8a67a831803b64c064a178c28b8b8b60405161123693929190614164565b60405180910390a450505050509392505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633819003611276576112736127cb565b50565b600061128182611e42565b905060006112a460005473ffffffffffffffffffffffffffffffffffffffff1690565b90506112ae6127cb565b60005473ffffffffffffffffffffffffffffffffffffffff1661131d5760408051602081019091526000815261131d9073ffffffffffffffffffffffffffffffffffffffff8316907fa4e59c931d14f7c8a7a35027f92ee40b5f2886b9fdcdb78f30bc5ecce5a2f81490612907565b8115610ebc57610ebc8360405180602001604052806000815250612055565b60035474010000000000000000000000000000000000000000900460ff1615611391576040517f5758dd0700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff166113b26129ef565b6040805160208101909152600081526114049073ffffffffffffffffffffffffffffffffffffffff8316907fa4e59c931d14f7c8a7a35027f92ee40b5f2886b9fdcdb78f30bc5ecce5a2f81490612907565b6040805160208101909152600081526112739033907fceca317f109c43507871523e82dc2a3cc64dfa18f12da0b6db14f6e23f99553890612907565b341561147457604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b60005473ffffffffffffffffffffffffffffffffffffffff163381900361149f57610ebc83836123ca565b60006114aa82611e42565b90506114b684846123ca565b80156114d5576114d58260405180602001604052806000815250612055565b50505050565b341561150f57604051349033907f7e71433ddf847725166244795048ecf3e3f9f35628254ecbf73605666423349390600090a35b805182511461154a576040517f3bcc897900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff16338190036115945760005b83518110156114d55761158c848281518110610e8357610e83614002565b60010161156e565b600061159f82611e42565b905060005b84518110156115e4576115dc8582815181106115c2576115c2614002565b6020026020010151858381518110610e9d57610e9d614002565b6001016115a4565b5080156114d5576114d58260405180602001604052806000815250612055565b6060815167ffffffffffffffff811115611620576116206136af565b60405190808252806020026020018201604052801561165357816020015b606081526020019060019003908161163e5790505b50905060005b82518110156116a95761168483828151811061167757611677614002565b602002602001015161243e565b82828151811061169657611696614002565b6020908102919091010152600101611659565b50919050565b60005473ffffffffffffffffffffffffffffffffffffffff16338190036117f057600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017905561171882612ac9565b8173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a36040805160208101909152600081526117c49073ffffffffffffffffffffffffffffffffffffffff8416907fe17117c9d2665d1dbeb479ed8058bbebde3c50ac50e2e65619f60006caac692690612907565b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690555050565b60006117fb82611e42565b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055905061184583612ac9565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a36040805160208101909152600081526118f19073ffffffffffffffffffffffffffffffffffffffff8516907fe17117c9d2665d1dbeb479ed8058bbebde3c50ac50e2e65619f60006caac692690612907565b600380547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690558015610ebc57610ebc8260405180602001604052806000815250612055565b60005473ffffffffffffffffffffffffffffffffffffffff828116911614611273576000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060816119dd81601f6141b9565b1015611a45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f736c6963655f6f766572666c6f77000000000000000000000000000000000000604482015260640161056b565b611a4f82846141b9565b84511015611ab9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f736c6963655f6f75744f66426f756e6473000000000000000000000000000000604482015260640161056b565b606082158015611ad85760405191506000825260208201604052611b40565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015611b11578051835260209283019201611af9565b5050858452601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016604052505b5090505b9392505050565b600080611b9a7fcee78b4094da86011096000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000851661274f565b90506000611ba78261243e565b611bb0906140a6565b60601c949350505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fa918fa6b00000000000000000000000000000000000000000000000000000000148061063d575061063d82612b64565b600080611c3d7f01ffc9a700000000000000000000000000000000000000000000000000000000611b4b565b905073ffffffffffffffffffffffffffffffffffffffff8116611c635750600092915050565b611b4481846124e0565b6000808251604103611ca35760208301516040840151606085015160001a611c9787828585612bba565b94509450505050611cab565b506000905060025b9250929050565b606083518551141580611cd3575082518451141580611cd357508151835114155b15611d0a576040517f3ff55f4d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8451600003611d45576040517fe9ad2b5f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000855167ffffffffffffffff811115611d6157611d616136af565b604051908082528060200260200182016040528015611d9457816020015b6060815260200190600190039081611d7f5790505b50905060005b8651811015611e3857611e13878281518110611db857611db8614002565b6020026020010151878381518110611dd257611dd2614002565b6020026020010151878481518110611dec57611dec614002565b6020026020010151878581518110611e0657611e06614002565b6020026020010151612228565b828281518110611e2557611e25614002565b6020908102919091010152600101611d9a565b5095945050505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff16639bf04b1160e01b3334600036604051602401611e7e94939291906141cc565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909416939093179092529051611f079190613e67565b6000604051808303816000865af19150503d8060008114611f44576040519150601f19603f3d011682016040523d82523d6000602084013e611f49565b606091505b5091509150611f5a60008383612ca9565b600081806020019051810190611f709190614202565b90507fffffff000000000000000000000000000000000000000000000000000000000081167f9bf04b000000000000000000000000000000000000000000000000000000000014611ff2576000826040517fd088ec4000000000000000000000000000000000000000000000000000000000815260040161056b92919061421f565b7f01000000000000000000000000000000000000000000000000000000000000007fff00000000000000000000000000000000000000000000000000000000000000600383901a60f81b161461204957600061204c565b60015b95945050505050565b6000808373ffffffffffffffffffffffffffffffffffffffff1663d3fc45d360e01b333460003660405160200161208f949392919061423a565b60405160208183030381529060405280519060200120856040516024016120b7929190613e83565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009094169390931790925290516121409190613e67565b6000604051808303816000865af19150503d806000811461217d576040519150601f19603f3d011682016040523d82523d6000602084013e612182565b606091505b509150915061219360018383612ca9565b80517fd3fc45d300000000000000000000000000000000000000000000000000000000906121ca9083016020908101908401614202565b7fffffffff0000000000000000000000000000000000000000000000000000000016146114d5576001816040517fd088ec4000000000000000000000000000000000000000000000000000000000815260040161056b92919061421f565b6060846122415761223a848484612d32565b9050610ccc565b600185036122a15773ffffffffffffffffffffffffffffffffffffffff841615612297576040517f3041824a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61223a8383612ea9565b600285036123015773ffffffffffffffffffffffffffffffffffffffff8416156122f7576040517f3041824a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61223a8383613022565b6003850361234b578215612341576040517f72f2bc6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61223a8483613145565b6004850361239557821561238b576040517f5ac8313500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61223a848361326d565b6040517f7583b3bc0000000000000000000000000000000000000000000000000000000081526004810186905260240161056b565b60008281526001602052604090206123e2828261431b565b50817fece574603820d07bc9b91f2a932baadf4628aabcb8afba49776529c14a6104b2610100835111156124235761241e8360006101006119cf565b612425565b825b6040516124329190613c19565b60405180910390a25050565b600081815260016020526040902080546060919061245b90614280565b80601f016020809104026020016040519081016040528092919081815260200182805461248790614280565b80156124d45780601f106124a9576101008083540402835291602001916124d4565b820191906000526020600020905b8154815290600101906020018083116124b757829003601f168201915b50505050509050919050565b604080517fffffffff000000000000000000000000000000000000000000000000000000008316602480830191909152825180830390910181526044909101909152602080820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f01ffc9a700000000000000000000000000000000000000000000000000000000178152825160009392849283928392918391908a617530fa92503d91506000519050828015612598575060208210155b80156125a45750600081115b979650505050505050565b60606000636bb56a1460e01b8787876040516024016125d093929190614435565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909516949094179093525161265d92879187910161444f565b60405160208183030381529060405290506000808973ffffffffffffffffffffffffffffffffffffffff16836040516126969190613e67565b6000604051808303816000865af19150503d80600081146126d3576040519150601f19603f3d011682016040523d82523d6000602084013e6126d8565b606091505b509150915061271d82826040518060400160405280602081526020017f43616c6c20746f20756e6976657273616c5265636569766572206661696c656481525061334b565b50805160000361272d5780612741565b808060200190518101906127419190613f94565b9a9950505050505050505050565b604080517fffffffffffffffffffff00000000000000000000000000000000000000000000841660208201526000602a82018190527fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008416602c83015291829101604051602081830303815290604052905080610ccc906144a1565b60025443906000906127df9060c8906141b9565b905060006127ee60c8836141b9565b9050808311806127fe5750600254155b1561285e576002839055600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556040517f81b7f830f1f0084db6497c486cbe6974c86488dcc4e3738eab94ab6d6b1653e790600090a1505050565b818310156128a2576040517f8b9bf507000000000000000000000000000000000000000000000000000000008152600481018390526024810182905260440161056b565b6128ac6000611938565b60006002819055600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001690556040517fd1f66c3d2bc1993a86be5e3d33709d98f0442381befcedd29f578b9b2506b1ce9190a1505050565b612931837f6bb56a14000000000000000000000000000000000000000000000000000000006124e0565b15610ebc576040517f6bb56a1400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff841690636bb56a149061298a9085908590600401613e83565b6000604051808303816000875af11580156129a9573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526114d59190810190613f94565b60035473ffffffffffffffffffffffffffffffffffffffff163314612a96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f4c535031343a2063616c6c6572206973206e6f74207468652070656e64696e6760448201527f4f776e6572000000000000000000000000000000000000000000000000000000606482015260840161056b565b612a9f33611938565b600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b3073ffffffffffffffffffffffffffffffffffffffff821603612b18576040517f43b248cd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911790556000600255565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f629aa69400000000000000000000000000000000000000000000000000000000148061063d575061063d82613364565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612bf15750600090506003612ca0565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612c45573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116612c9957600060019250925050612ca0565b9150600090505b94509492505050565b81612cb857612cb883826133fb565b602081511080612cf7575060006020612cd0836144a1565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000911b1614155b15610ebc5782816040517fd088ec4000000000000000000000000000000000000000000000000000000000815260040161056b92919061421f565b606082471015612d77576040517f0df9a8f80000000000000000000000000000000000000000000000000000000081524760048201526024810184905260440161056b565b8273ffffffffffffffffffffffffffffffffffffffff851660007f4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e612dbb866144e3565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390a46000808573ffffffffffffffffffffffffffffffffffffffff168585604051612e189190613e67565b60006040518083038185875af1925050503d8060008114612e55576040519150601f19603f3d011682016040523d82523d6000602084013e612e5a565b606091505b5091509150612e9f82826040518060400160405280601681526020017f455243373235583a20556e6b6e6f776e204572726f720000000000000000000081525061334b565b9695505050505050565b606082471015612eee576040517f0df9a8f80000000000000000000000000000000000000000000000000000000081524760048201526024810184905260440161056b565b8151600003612f29576040517fb81cd8d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082516020840185f0905073ffffffffffffffffffffffffffffffffffffffff8116612f82576040517f0b07489b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b838173ffffffffffffffffffffffffffffffffffffffff1660017fa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c36000801b604051612fd091815260200190565b60405180910390a46040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606083901b16602082015260340160405160208183030381529060405291505092915050565b6060815160000361305f576040517fb81cd8d900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006130788360208551613073919061452f565b613441565b9050600061309584600060208751613090919061452f565b6119cf565b905060006130a48684846134c1565b9050858173ffffffffffffffffffffffffffffffffffffffff1660027fa1fb700aaee2ae4a2ff6f91ce7eba292f89c2f5488b8ec4c5c5c8150692595c3866040516130f191815260200190565b60405180910390a46040517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606083901b166020820152603401604051602081830303815290604052935050505092915050565b6060600073ffffffffffffffffffffffffffffffffffffffff841660037f4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e61318c866144e3565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390a46000808473ffffffffffffffffffffffffffffffffffffffff16846040516131e89190613e67565b600060405180830381855afa9150503d8060008114613223576040519150601f19603f3d011682016040523d82523d6000602084013e613228565b606091505b509150915061204c82826040518060400160405280601681526020017f455243373235583a20556e6b6e6f776e204572726f720000000000000000000081525061334b565b6060600073ffffffffffffffffffffffffffffffffffffffff841660047f4810874456b8e6487bd861375cf6abd8e1c8bb5858c8ce36a86a04dabfac199e6132b4866144e3565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200160405180910390a46000808473ffffffffffffffffffffffffffffffffffffffff16846040516133109190613e67565b600060405180830381855af49150503d8060008114613223576040519150601f19603f3d011682016040523d82523d6000602084013e613228565b6060831561335a575081611b44565b611b448383613620565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7545acac00000000000000000000000000000000000000000000000000000000148061063d57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461063d565b80511561340b5780518082602001fd5b6040517f8c6a8ae3000000000000000000000000000000000000000000000000000000008152821515600482015260240161056b565b600061344e8260206141b9565b835110156134b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f746f427974657333325f6f75744f66426f756e64730000000000000000000000604482015260640161056b565b50016020015190565b60008347101561352d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f437265617465323a20696e73756666696369656e742062616c616e6365000000604482015260640161056b565b8151600003613598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f604482015260640161056b565b8282516020840186f5905073ffffffffffffffffffffffffffffffffffffffff8116611b44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f7900000000000000604482015260640161056b565b8151156136305781518083602001fd5b806040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056b9190613c19565b7fffffffff000000000000000000000000000000000000000000000000000000008116811461127357600080fd5b6000602082840312156136a457600080fd5b8135611b4481613664565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715613725576137256136af565b604052919050565b600067ffffffffffffffff821115613747576137476136af565b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b600082601f83011261378457600080fd5b81356137976137928261372d565b6136de565b8181528460208386010111156137ac57600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156137dc57600080fd5b82359150602083013567ffffffffffffffff8111156137fa57600080fd5b61380685828601613773565b9150509250929050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461383457600080fd5b919050565b60008083601f84011261384b57600080fd5b50813567ffffffffffffffff81111561386357600080fd5b602083019150836020828501011115611cab57600080fd5b6000806000806060858703121561389157600080fd5b61389a85613810565b93506138a860208601613810565b9250604085013567ffffffffffffffff8111156138c457600080fd5b6138d087828801613839565b95989497509550505050565b600067ffffffffffffffff8211156138f6576138f66136af565b5060051b60200190565b600082601f83011261391157600080fd5b81356020613921613792836138dc565b82815260059290921b8401810191818101908684111561394057600080fd5b8286015b8481101561395b5780358352918301918301613944565b509695505050505050565b600082601f83011261397757600080fd5b81356020613987613792836138dc565b82815260059290921b840181019181810190868411156139a657600080fd5b8286015b8481101561395b57803567ffffffffffffffff8111156139ca5760008081fd5b6139d88986838b0101613773565b8452509183019183016139aa565b600080600080608085870312156139fc57600080fd5b843567ffffffffffffffff80821115613a1457600080fd5b613a2088838901613900565b9550602091508187013581811115613a3757600080fd5b8701601f81018913613a4857600080fd5b8035613a56613792826138dc565b81815260059190911b8201840190848101908b831115613a7557600080fd5b928501925b82841015613a9a57613a8b84613810565b82529285019290850190613a7a565b97505050506040870135915080821115613ab357600080fd5b613abf88838901613900565b93506060870135915080821115613ad557600080fd5b50613ae287828801613966565b91505092959194509250565b60005b83811015613b09578181015183820152602001613af1565b50506000910152565b60008151808452613b2a816020860160208601613aee565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600081518084526020808501808196508360051b8101915082860160005b85811015613ba4578284038952613b92848351613b12565b98850198935090840190600101613b7a565b5091979650505050505050565b602081526000611b446020830184613b5c565b60008060008060808587031215613bda57600080fd5b84359350613bea60208601613810565b925060408501359150606085013567ffffffffffffffff811115613c0d57600080fd5b613ae287828801613773565b602081526000611b446020830184613b12565b600080600060608486031215613c4157600080fd5b833567ffffffffffffffff80821115613c5957600080fd5b613c6587838801613900565b94506020860135915080821115613c7b57600080fd5b50613c8886828701613966565b925050613c9760408501613810565b90509250925092565b600060208284031215613cb257600080fd5b5035919050565b60008060208385031215613ccc57600080fd5b823567ffffffffffffffff80821115613ce457600080fd5b818501915085601f830112613cf857600080fd5b813581811115613d0757600080fd5b8660208260051b8501011115613d1c57600080fd5b60209290920196919550909350505050565b600080600060408486031215613d4357600080fd5b83359250602084013567ffffffffffffffff811115613d6157600080fd5b613d6d86828701613839565b9497909650939450505050565b60008060408385031215613d8d57600080fd5b823567ffffffffffffffff80821115613da557600080fd5b613db186838701613900565b93506020850135915080821115613dc757600080fd5b5061380685828601613966565b600060208284031215613de657600080fd5b813567ffffffffffffffff811115613dfd57600080fd5b610ccc84828501613900565b600060208284031215613e1b57600080fd5b611b4482613810565b8385823760609290921b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016919092019081526014810191909152603401919050565b60008251613e79818460208701613aee565b9190910192915050565b828152604060208201526000610ccc6040830184613b12565b600060208284031215613eae57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b606080825284519082018190526000906020906080840190828801845b82811015613f1d57815184529284019290840190600101613f01565b50505083810382850152613f318187613b5c565b9250505073ffffffffffffffffffffffffffffffffffffffff83166040830152949350505050565b84815273ffffffffffffffffffffffffffffffffffffffff84166020820152826040820152608060608201526000612e9f6080830184613b12565b600060208284031215613fa657600080fd5b815167ffffffffffffffff811115613fbd57600080fd5b8201601f81018413613fce57600080fd5b8051613fdc6137928261372d565b818152856020838501011115613ff157600080fd5b61204c826020830160208601613aee565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261406657600080fd5b83018035915067ffffffffffffffff82111561408157600080fd5b602001915036819003821315611cab57600080fd5b8183823760009101908152919050565b6000815160208301517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808216935060148310156140ee5780818460140360031b1b83161693505b505050919050565b6040815260006141096040830185613b12565b828103602084015261204c8185613b12565b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60408152600061417860408301858761411b565b8281036020840152612e9f8185613b12565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561063d5761063d61418a565b73ffffffffffffffffffffffffffffffffffffffff85168152836020820152606060408201526000612e9f60608301848661411b565b60006020828403121561421457600080fd5b8151611b4481613664565b8215158152604060208201526000610ccc6040830184613b12565b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008560601b16815283601482015281836034830137600091016034019081529392505050565b600181811c9082168061429457607f821691505b6020821081036116a9577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b601f821115610ebc57600081815260208120601f850160051c810160208610156142f45750805b601f850160051c820191505b8181101561431357828155600101614300565b505050505050565b815167ffffffffffffffff811115614335576143356136af565b614349816143438454614280565b846142cd565b602080601f83116001811461439c57600084156143665750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555614313565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b828110156143e9578886015182559484019460019091019084016143ca565b508582101561442557878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b83815260406020820152600061204c60408301848661411b565b60008451614461818460208901613aee565b60609490941b7fffffffffffffffffffffffffffffffffffffffff0000000000000000000000001691909301908152601481019190915260340192915050565b805160208083015191908110156116a9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60209190910360031b1b16919050565b6000815160208301517fffffffff00000000000000000000000000000000000000000000000000000000808216935060048310156140ee5760049290920360031b82901b161692915050565b8181038181111561063d5761063d61418a56fea2646970667358221220709024acd2bc0a3533c747974ab8f11d519f7708b55eb0107adc4574f225e7d964736f6c63430008110033 +``` + +## Universal Profile Post Deployment Module Source Code + +This is an exact copy of the code of the [`UniversalProfilePostDeploymentModule` smart contract]. + +- The source code is generated with `solc` compiler version `0.8.17` and with `9999999` optimization runs. +- The imported contracts are part of the `4.9.2` version of the `@openzeppelin/contracts` package. +- Navigate to [lsp-smart-contract](https://github.com/lukso-network/lsp-smart-contracts) repo and checkout to `b8eca3c5696acf85239130ef67edec9e8c134bfa` commit to obtain the exact copy of the code, change the compiler settings in `hardhat.config.ts` and compile to produce the same bytecode. + +```solidity +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.4; + +import { OPERATION_4_DELEGATECALL } from "@erc725/smart-contracts/contracts/constants.sol"; + +import { UniversalProfile } from "../../UniversalProfile.sol"; + +contract UniversalProfilePostDeploymentModule is UniversalProfile { + constructor() UniversalProfile(address(0)) {} + + function setDataAndTransferOwnership( + bytes32[] memory dataKeys, + bytes[] memory dataValues, + address newOwner + ) public payable { + // check that the msg.sender is the owner + require( + msg.sender == owner(), + "UniversalProfilePostDeploymentModule: setDataAndTransferOwnership only allowed through delegate call" + ); + + // update the dataKeys and dataValues in the UniversalProfile contract + for (uint256 i = 0; i < dataKeys.length; ) { + _setData(dataKeys[i], dataValues[i]); + + unchecked { + ++i; + } + } + + // transfer the ownership of the UniversalProfile contract to the newOwner + _setOwner(newOwner); + } + + function executePostDeployment( + address universalProfile, + address keyManager, + bytes calldata setDataBatchBytes + ) public { + // retrieve the dataKeys and dataValues to setData from the initializationCalldata bytes + (bytes32[] memory dataKeys, bytes[] memory dataValues) = abi.decode( + setDataBatchBytes, + (bytes32[], bytes[]) + ); + + // call the execute function with delegate_call on the universalProfile contract to setData and transferOwnership + UniversalProfile(payable(universalProfile)).execute( + OPERATION_4_DELEGATECALL, + address(this), + 0, + abi.encodeWithSignature( + "setDataAndTransferOwnership(bytes32[],bytes[],address)", + dataKeys, + dataValues, + keyManager + ) + ); + } +} +``` diff --git a/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/ILSP25ExecuteRelayCall.sol b/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/ILSP25ExecuteRelayCall.sol new file mode 100644 index 000000000..96b6b4fc6 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/ILSP25ExecuteRelayCall.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache 2.0 +pragma solidity ^0.8.0; + +import "@lukso/lsp25-contracts/contracts/ILSP25ExecuteRelayCall.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol b/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol new file mode 100644 index 000000000..660defe76 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp25-contracts/contracts/LSP25Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25Errors.sol b/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25Errors.sol new file mode 100644 index 000000000..98f2ee9f7 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp25-contracts/contracts/LSP25Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol b/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol new file mode 100644 index 000000000..6f77c265e --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP25ExecuteRelayCall/LSP25MultiChannelNonce.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp25-contracts/contracts/LSP25MultiChannelNonce.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol b/packages/lsp-smart-contracts/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol new file mode 100644 index 000000000..7cfd5e777 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP2ERC725YJSONSchema/LSP2Utils.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp2-contracts/contracts/LSP2Utils.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP3ProfileMetadata/LSP3Constants.sol b/packages/lsp-smart-contracts/contracts/LSP3ProfileMetadata/LSP3Constants.sol new file mode 100644 index 000000000..44f8afdfd --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP3ProfileMetadata/LSP3Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp3-contracts/contracts/LSP3Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol new file mode 100644 index 000000000..2cf9cf500 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp4-contracts/contracts/LSP4Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol new file mode 100644 index 000000000..12f6b47a5 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadata.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol new file mode 100644 index 000000000..f10ae841f --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataCore.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadataCore.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol new file mode 100644 index 000000000..4040975a0 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadataInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp4-contracts/contracts/LSP4DigitalAssetMetadataInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol new file mode 100644 index 000000000..9e09cda39 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP4DigitalAssetMetadata/LSP4Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp4-contracts/contracts/LSP4Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP5ReceivedAssets/LSP5Constants.sol b/packages/lsp-smart-contracts/contracts/LSP5ReceivedAssets/LSP5Constants.sol new file mode 100644 index 000000000..f72e21d65 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP5ReceivedAssets/LSP5Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp5-contracts/contracts/LSP5Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP5ReceivedAssets/LSP5Utils.sol b/packages/lsp-smart-contracts/contracts/LSP5ReceivedAssets/LSP5Utils.sol new file mode 100644 index 000000000..e6a2a4962 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP5ReceivedAssets/LSP5Utils.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp5-contracts/contracts/LSP5Utils.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/ILSP6KeyManager.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/ILSP6KeyManager.sol new file mode 100644 index 000000000..92ba02e8e --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/ILSP6KeyManager.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp6-contracts/contracts/ILSP6KeyManager.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Constants.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Constants.sol new file mode 100644 index 000000000..ae7cea264 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp6-contracts/contracts/LSP6Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Errors.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Errors.sol new file mode 100644 index 000000000..81976ef36 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp6-contracts/contracts/LSP6Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol new file mode 100644 index 000000000..68d156bef --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManager.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.5; + +import "@lukso/lsp6-contracts/contracts/LSP6KeyManager.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol new file mode 100644 index 000000000..827d7d211 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerCore.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.5; + +import "@lukso/lsp6-contracts/contracts/LSP6KeyManagerCore.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol new file mode 100644 index 000000000..014ca1844 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerInit.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.5; + +import "@lukso/lsp6-contracts/contracts/LSP6KeyManagerInit.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol new file mode 100644 index 000000000..4cc758c98 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6KeyManagerInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.5; + +import "@lukso/lsp6-contracts/contracts/LSP6KeyManagerInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol new file mode 100644 index 000000000..a7136791d --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteModule.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.5; + +import "@lukso/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteModule.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteRelayCallModule.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteRelayCallModule.sol new file mode 100644 index 000000000..816d696d5 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6ExecuteRelayCallModule.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.5; + +import "@lukso/lsp6-contracts/contracts/LSP6Modules/LSP6ExecuteRelayCallModule.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol new file mode 100644 index 000000000..2a6b0b44f --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6OwnershipModule.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.5; + +import "@lukso/lsp6-contracts/contracts/LSP6Modules/LSP6OwnershipModule.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol new file mode 100644 index 000000000..329c25b86 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Modules/LSP6SetDataModule.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.5; + +import "@lukso/lsp6-contracts/contracts/LSP6Modules/LSP6SetDataModule.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Utils.sol b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Utils.sol new file mode 100644 index 000000000..1b6bbd0fe --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP6KeyManager/LSP6Utils.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp6-contracts/contracts/LSP6Utils.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol new file mode 100644 index 000000000..1ccad2701 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/ILSP7DigitalAsset.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/ILSP7DigitalAsset.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7Constants.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7Constants.sol new file mode 100644 index 000000000..9ebc74a5c --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/LSP7Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol new file mode 100644 index 000000000..a8c32db1f --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/LSP7DigitalAsset.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol new file mode 100644 index 000000000..8a888e9ea --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetCore.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/LSP7DigitalAssetCore.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol new file mode 100644 index 000000000..e8e32e8da --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/LSP7DigitalAssetInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7Errors.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7Errors.sol new file mode 100644 index 000000000..ee111d7e5 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/LSP7Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/LSP7Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol new file mode 100644 index 000000000..e63ba46c3 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7Burnable.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/extensions/LSP7Burnable.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol new file mode 100644 index 000000000..e9fa18b3b --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7BurnableInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/extensions/LSP7BurnableInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol new file mode 100644 index 000000000..7514dc4cf --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupply.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/extensions/LSP7CappedSupply.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol new file mode 100644 index 000000000..9bfe846f9 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/extensions/LSP7CappedSupplyInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/extensions/LSP7CappedSupplyInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol new file mode 100644 index 000000000..7510435be --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/ILSP7Mintable.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/presets/ILSP7Mintable.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol new file mode 100644 index 000000000..1082b0cda --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7Mintable.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/presets/LSP7Mintable.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol new file mode 100644 index 000000000..2ec70c86c --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7MintableInit.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/presets/LSP7MintableInit.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol new file mode 100644 index 000000000..63ff5f63a --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP7DigitalAsset/presets/LSP7MintableInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp7-contracts/contracts/presets/LSP7MintableInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol new file mode 100644 index 000000000..b7b3c68f5 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/ILSP8IdentifiableDigitalAsset.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp8-contracts/contracts/ILSP8IdentifiableDigitalAsset.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol new file mode 100644 index 000000000..383060c98 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp8-contracts/contracts/LSP8Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol new file mode 100644 index 000000000..5305923ed --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp8-contracts/contracts/LSP8Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol new file mode 100644 index 000000000..cababdd31 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAsset.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol new file mode 100644 index 000000000..41b3df98e --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetCore.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetCore.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol new file mode 100644 index 000000000..87de808ab --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAssetInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/LSP8IdentifiableDigitalAssetInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol new file mode 100644 index 000000000..147948911 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Burnable.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/extensions/LSP8Burnable.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol new file mode 100644 index 000000000..8c1d6733d --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8BurnableInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/extensions/LSP8BurnableInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol new file mode 100644 index 000000000..02cf69e4f --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupply.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/extensions/LSP8CappedSupply.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol new file mode 100644 index 000000000..d9fa08771 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8CappedSupplyInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/extensions/LSP8CappedSupplyInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol new file mode 100644 index 000000000..21049f210 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8Enumerable.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/extensions/LSP8Enumerable.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol new file mode 100644 index 000000000..c1b915ad9 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/extensions/LSP8EnumerableInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/extensions/LSP8EnumerableInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol new file mode 100644 index 000000000..1c63371ab --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/ILSP8Mintable.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp8-contracts/contracts/presets/ILSP8Mintable.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol new file mode 100644 index 000000000..8fcf6a3ae --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8Mintable.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/presets/LSP8Mintable.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol new file mode 100644 index 000000000..cdde50dad --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInit.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/presets/LSP8MintableInit.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol new file mode 100644 index 000000000..33d02bef2 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP8IdentifiableDigitalAsset/presets/LSP8MintableInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.12; + +import "@lukso/lsp8-contracts/contracts/presets/LSP8MintableInitAbstract.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP9Vault/ILSP9Vault.sol b/packages/lsp-smart-contracts/contracts/LSP9Vault/ILSP9Vault.sol new file mode 100644 index 000000000..fd5bd5506 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP9Vault/ILSP9Vault.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp9-contracts/contracts/ILSP9Vault.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Constants.sol b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Constants.sol new file mode 100644 index 000000000..a2054a219 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Constants.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp9-contracts/contracts/LSP9Constants.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Errors.sol b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Errors.sol new file mode 100644 index 000000000..a1b452f25 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Errors.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp9-contracts/contracts/LSP9Errors.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Vault.sol b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Vault.sol new file mode 100644 index 000000000..aeef2dd13 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9Vault.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp9-contracts/contracts/LSP9Vault.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultCore.sol b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultCore.sol new file mode 100644 index 000000000..7e6c3a360 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultCore.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp9-contracts/contracts/LSP9VaultCore.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultInit.sol b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultInit.sol new file mode 100644 index 000000000..7402b06bc --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultInit.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp9-contracts/contracts/LSP9VaultInit.sol"; diff --git a/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultInitAbstract.sol b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultInitAbstract.sol new file mode 100644 index 000000000..9f4ded8c3 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/LSP9Vault/LSP9VaultInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/lsp9-contracts/contracts/LSP9VaultInitAbstract.sol"; diff --git a/contracts/Mocks/ABIEncoder.sol b/packages/lsp-smart-contracts/contracts/Mocks/ABIEncoder.sol similarity index 100% rename from contracts/Mocks/ABIEncoder.sol rename to packages/lsp-smart-contracts/contracts/Mocks/ABIEncoder.sol diff --git a/contracts/Mocks/ERC165Interfaces.sol b/packages/lsp-smart-contracts/contracts/Mocks/ERC165Interfaces.sol similarity index 100% rename from contracts/Mocks/ERC165Interfaces.sol rename to packages/lsp-smart-contracts/contracts/Mocks/ERC165Interfaces.sol diff --git a/contracts/Mocks/Executor.sol b/packages/lsp-smart-contracts/contracts/Mocks/Executor.sol similarity index 100% rename from contracts/Mocks/Executor.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Executor.sol diff --git a/contracts/Mocks/ExecutorLSP20.sol b/packages/lsp-smart-contracts/contracts/Mocks/ExecutorLSP20.sol similarity index 100% rename from contracts/Mocks/ExecutorLSP20.sol rename to packages/lsp-smart-contracts/contracts/Mocks/ExecutorLSP20.sol diff --git a/contracts/Mocks/FallbackContract.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackContract.sol similarity index 100% rename from contracts/Mocks/FallbackContract.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackContract.sol diff --git a/contracts/Mocks/FallbackExtensions/AgeExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/AgeExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/AgeExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/AgeExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/Buy.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/Buy.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/Buy.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/Buy.sol diff --git a/contracts/Mocks/FallbackExtensions/CheckerExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/CheckerExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/CheckerExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/CheckerExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/ERC165Extension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/ERC165Extension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/ERC165Extension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/ERC165Extension.sol diff --git a/contracts/Mocks/FallbackExtensions/EmitEventExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/EmitEventExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/EmitEventExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/EmitEventExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/GraffitiEventExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/GraffitiEventExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/GraffitiEventExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/GraffitiEventExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/NameExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/NameExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/NameExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/NameExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/ReenterAccountExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/ReenterAccountExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/ReenterAccountExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/ReenterAccountExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/RevertCustomExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/RevertCustomExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/RevertCustomExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/RevertCustomExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/RevertErrorsTestExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/RevertErrorsTestExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/RevertErrorsTestExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/RevertErrorsTestExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/RevertFallbackExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/RevertFallbackExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/RevertFallbackExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/RevertFallbackExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/RevertStringExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/RevertStringExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/RevertStringExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/RevertStringExtension.sol diff --git a/contracts/Mocks/FallbackExtensions/TransferExtension.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/TransferExtension.sol similarity index 100% rename from contracts/Mocks/FallbackExtensions/TransferExtension.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackExtensions/TransferExtension.sol diff --git a/contracts/Mocks/FallbackInitializer.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackInitializer.sol similarity index 100% rename from contracts/Mocks/FallbackInitializer.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackInitializer.sol diff --git a/contracts/Mocks/FallbackRevert.sol b/packages/lsp-smart-contracts/contracts/Mocks/FallbackRevert.sol similarity index 100% rename from contracts/Mocks/FallbackRevert.sol rename to packages/lsp-smart-contracts/contracts/Mocks/FallbackRevert.sol diff --git a/contracts/Mocks/GenericExecutor.sol b/packages/lsp-smart-contracts/contracts/Mocks/GenericExecutor.sol similarity index 100% rename from contracts/Mocks/GenericExecutor.sol rename to packages/lsp-smart-contracts/contracts/Mocks/GenericExecutor.sol diff --git a/contracts/Mocks/GenericExecutorWithBalanceOfFunction.sol b/packages/lsp-smart-contracts/contracts/Mocks/GenericExecutorWithBalanceOfFunction.sol similarity index 100% rename from contracts/Mocks/GenericExecutorWithBalanceOfFunction.sol rename to packages/lsp-smart-contracts/contracts/Mocks/GenericExecutorWithBalanceOfFunction.sol diff --git a/contracts/Mocks/ImplementationTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/ImplementationTester.sol similarity index 100% rename from contracts/Mocks/ImplementationTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/ImplementationTester.sol diff --git a/contracts/Mocks/KeyManager/ERC725YDelegateCall.sol b/packages/lsp-smart-contracts/contracts/Mocks/KeyManager/ERC725YDelegateCall.sol similarity index 100% rename from contracts/Mocks/KeyManager/ERC725YDelegateCall.sol rename to packages/lsp-smart-contracts/contracts/Mocks/KeyManager/ERC725YDelegateCall.sol diff --git a/contracts/Mocks/KeyManager/KeyManagerInternalsTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/KeyManager/KeyManagerInternalsTester.sol similarity index 100% rename from contracts/Mocks/KeyManager/KeyManagerInternalsTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/KeyManager/KeyManagerInternalsTester.sol diff --git a/contracts/Mocks/KeyManager/TargetPayableContract.sol b/packages/lsp-smart-contracts/contracts/Mocks/KeyManager/TargetPayableContract.sol similarity index 100% rename from contracts/Mocks/KeyManager/TargetPayableContract.sol rename to packages/lsp-smart-contracts/contracts/Mocks/KeyManager/TargetPayableContract.sol diff --git a/contracts/Mocks/KeyManagerInitWithExtraParams.sol b/packages/lsp-smart-contracts/contracts/Mocks/KeyManagerInitWithExtraParams.sol similarity index 100% rename from contracts/Mocks/KeyManagerInitWithExtraParams.sol rename to packages/lsp-smart-contracts/contracts/Mocks/KeyManagerInitWithExtraParams.sol diff --git a/contracts/Mocks/KeyManagerWithExtraParams.sol b/packages/lsp-smart-contracts/contracts/Mocks/KeyManagerWithExtraParams.sol similarity index 100% rename from contracts/Mocks/KeyManagerWithExtraParams.sol rename to packages/lsp-smart-contracts/contracts/Mocks/KeyManagerWithExtraParams.sol diff --git a/contracts/Mocks/LSP17ExtendableTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP17ExtendableTester.sol similarity index 100% rename from contracts/Mocks/LSP17ExtendableTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP17ExtendableTester.sol diff --git a/contracts/Mocks/LSP1TypeIDsTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP1TypeIDsTester.sol similarity index 100% rename from contracts/Mocks/LSP1TypeIDsTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP1TypeIDsTester.sol diff --git a/contracts/Mocks/LSP20Owners/BothCallReturnMagicValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/BothCallReturnMagicValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/BothCallReturnMagicValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/BothCallReturnMagicValue.sol diff --git a/contracts/Mocks/LSP20Owners/BothCallReturnSuccessValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/BothCallReturnSuccessValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/BothCallReturnSuccessValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/BothCallReturnSuccessValue.sol diff --git a/contracts/Mocks/LSP20Owners/FallbackReturnSuccessValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FallbackReturnSuccessValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/FallbackReturnSuccessValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FallbackReturnSuccessValue.sol diff --git a/contracts/Mocks/LSP20Owners/FirstCallReturnExpandedInvalidValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FirstCallReturnExpandedInvalidValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/FirstCallReturnExpandedInvalidValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FirstCallReturnExpandedInvalidValue.sol diff --git a/contracts/Mocks/LSP20Owners/FirstCallReturnInvalidValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FirstCallReturnInvalidValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/FirstCallReturnInvalidValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FirstCallReturnInvalidValue.sol diff --git a/contracts/Mocks/LSP20Owners/FirstCallReturnMagicValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FirstCallReturnMagicValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/FirstCallReturnMagicValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FirstCallReturnMagicValue.sol diff --git a/contracts/Mocks/LSP20Owners/FirstCallReturnSuccessValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FirstCallReturnSuccessValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/FirstCallReturnSuccessValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/FirstCallReturnSuccessValue.sol diff --git a/contracts/Mocks/LSP20Owners/ImplementingFallback.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/ImplementingFallback.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/ImplementingFallback.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/ImplementingFallback.sol diff --git a/contracts/Mocks/LSP20Owners/NotImplementingVerifyCall.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/NotImplementingVerifyCall.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/NotImplementingVerifyCall.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/NotImplementingVerifyCall.sol diff --git a/contracts/Mocks/LSP20Owners/OwnerWIthURD.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/OwnerWIthURD.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/OwnerWIthURD.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/OwnerWIthURD.sol diff --git a/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedSuccessValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedSuccessValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/SecondCallReturnExpandedSuccessValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedSuccessValue.sol diff --git a/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/SecondCallReturnExpandedValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedValue.sol diff --git a/contracts/Mocks/LSP20Owners/SecondCallReturnFailureValue.sol b/packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/SecondCallReturnFailureValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/SecondCallReturnFailureValue.sol rename to packages/lsp-smart-contracts/contracts/Mocks/LSP20Owners/SecondCallReturnFailureValue.sol diff --git a/contracts/Mocks/MaliciousERC1271Wallet.sol b/packages/lsp-smart-contracts/contracts/Mocks/MaliciousERC1271Wallet.sol similarity index 100% rename from contracts/Mocks/MaliciousERC1271Wallet.sol rename to packages/lsp-smart-contracts/contracts/Mocks/MaliciousERC1271Wallet.sol diff --git a/contracts/Mocks/NonPayableFallback.sol b/packages/lsp-smart-contracts/contracts/Mocks/NonPayableFallback.sol similarity index 100% rename from contracts/Mocks/NonPayableFallback.sol rename to packages/lsp-smart-contracts/contracts/Mocks/NonPayableFallback.sol diff --git a/contracts/Mocks/PayableContract.sol b/packages/lsp-smart-contracts/contracts/Mocks/PayableContract.sol similarity index 100% rename from contracts/Mocks/PayableContract.sol rename to packages/lsp-smart-contracts/contracts/Mocks/PayableContract.sol diff --git a/contracts/Mocks/Reentrancy/BatchReentrancyRelayer.sol b/packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/BatchReentrancyRelayer.sol similarity index 100% rename from contracts/Mocks/Reentrancy/BatchReentrancyRelayer.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/BatchReentrancyRelayer.sol diff --git a/contracts/Mocks/Reentrancy/LSP20ReentrantContract.sol b/packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/LSP20ReentrantContract.sol similarity index 100% rename from contracts/Mocks/Reentrancy/LSP20ReentrantContract.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/LSP20ReentrantContract.sol diff --git a/contracts/Mocks/Reentrancy/LSP20ReentrantContractBatch.sol b/packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/LSP20ReentrantContractBatch.sol similarity index 100% rename from contracts/Mocks/Reentrancy/LSP20ReentrantContractBatch.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/LSP20ReentrantContractBatch.sol diff --git a/contracts/Mocks/Reentrancy/ReentrantContract.sol b/packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/ReentrantContract.sol similarity index 100% rename from contracts/Mocks/Reentrancy/ReentrantContract.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/ReentrantContract.sol diff --git a/contracts/Mocks/Reentrancy/SingleReentrancyRelayer.sol b/packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/SingleReentrancyRelayer.sol similarity index 100% rename from contracts/Mocks/Reentrancy/SingleReentrancyRelayer.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/SingleReentrancyRelayer.sol diff --git a/contracts/Mocks/Reentrancy/ThreeReentrancy.sol b/packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/ThreeReentrancy.sol similarity index 100% rename from contracts/Mocks/Reentrancy/ThreeReentrancy.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Reentrancy/ThreeReentrancy.sol diff --git a/contracts/Mocks/Security/Reentrancy.sol b/packages/lsp-smart-contracts/contracts/Mocks/Security/Reentrancy.sol similarity index 100% rename from contracts/Mocks/Security/Reentrancy.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Security/Reentrancy.sol diff --git a/contracts/Mocks/SignatureValidatorContract.sol b/packages/lsp-smart-contracts/contracts/Mocks/SignatureValidatorContract.sol similarity index 100% rename from contracts/Mocks/SignatureValidatorContract.sol rename to packages/lsp-smart-contracts/contracts/Mocks/SignatureValidatorContract.sol diff --git a/contracts/Mocks/TargetContract.sol b/packages/lsp-smart-contracts/contracts/Mocks/TargetContract.sol similarity index 100% rename from contracts/Mocks/TargetContract.sol rename to packages/lsp-smart-contracts/contracts/Mocks/TargetContract.sol diff --git a/contracts/Mocks/Tokens/IERC223.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/IERC223.sol similarity index 100% rename from contracts/Mocks/Tokens/IERC223.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/IERC223.sol diff --git a/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7CappedSupplyInitTester.sol diff --git a/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7CappedSupplyTester.sol diff --git a/contracts/Mocks/Tokens/LSP7InitTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7InitTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP7InitTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7InitTester.sol diff --git a/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7MintWhenDeployed.sol diff --git a/contracts/Mocks/Tokens/LSP7Tester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7Tester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP7Tester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP7Tester.sol diff --git a/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8BurnableInitTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8BurnableInitTester.sol diff --git a/contracts/Mocks/Tokens/LSP8BurnableTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8BurnableTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8BurnableTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8BurnableTester.sol diff --git a/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8CappedSupplyInitTester.sol diff --git a/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8CappedSupplyTester.sol diff --git a/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8EnumerableInitTester.sol diff --git a/contracts/Mocks/Tokens/LSP8EnumerableTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8EnumerableTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8EnumerableTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8EnumerableTester.sol diff --git a/contracts/Mocks/Tokens/LSP8InitTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8InitTester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8InitTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8InitTester.sol diff --git a/contracts/Mocks/Tokens/LSP8Tester.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8Tester.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8Tester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8Tester.sol diff --git a/contracts/Mocks/Tokens/LSP8TransferOwnerChange.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8TransferOwnerChange.sol similarity index 100% rename from contracts/Mocks/Tokens/LSP8TransferOwnerChange.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/LSP8TransferOwnerChange.sol diff --git a/contracts/Mocks/Tokens/RequireCallbackToken.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/RequireCallbackToken.sol similarity index 100% rename from contracts/Mocks/Tokens/RequireCallbackToken.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/RequireCallbackToken.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithLSP1.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithLSP1.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithLSP1Revert.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1Revert.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithLSP1Revert.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1Revert.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721Received.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721Received.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721Received.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721Received.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721ReceivedInvalid.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721ReceivedInvalid.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721ReceivedInvalid.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721ReceivedInvalid.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721ReceivedRevert.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721ReceivedRevert.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721ReceivedRevert.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithLSP1WithERC721ReceivedRevert.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithoutLSP1.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721Received.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721Received.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721Received.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721Received.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721ReceivedInvalid.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721ReceivedInvalid.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721ReceivedInvalid.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721ReceivedInvalid.sol diff --git a/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721ReceivedRevert.sol b/packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721ReceivedRevert.sol similarity index 100% rename from contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721ReceivedRevert.sol rename to packages/lsp-smart-contracts/contracts/Mocks/Tokens/TokenReceiverWithoutLSP1WithERC721ReceivedRevert.sol diff --git a/contracts/Mocks/UPWithInstantAcceptOwnership.sol b/packages/lsp-smart-contracts/contracts/Mocks/UPWithInstantAcceptOwnership.sol similarity index 100% rename from contracts/Mocks/UPWithInstantAcceptOwnership.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UPWithInstantAcceptOwnership.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataLYX.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataLYX.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataLYX.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataLYX.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataUpdater.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataUpdater.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataUpdater.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateDataUpdater.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateGasConsumer.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateGasConsumer.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateGasConsumer.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateGasConsumer.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateRevert.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateRevert.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateRevert.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateRevert.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateTokenReentrant.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateTokenReentrant.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateTokenReentrant.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateTokenReentrant.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultMalicious.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultMalicious.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultMalicious.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultMalicious.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultReentrantA.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultReentrantA.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultReentrantA.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultReentrantA.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultReentrantB.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultReentrantB.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultReentrantB.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultReentrantB.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultSetter.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultSetter.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultSetter.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverDelegateVaultSetter.sol diff --git a/contracts/Mocks/UniversalReceivers/UniversalReceiverTester.sol b/packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverTester.sol similarity index 100% rename from contracts/Mocks/UniversalReceivers/UniversalReceiverTester.sol rename to packages/lsp-smart-contracts/contracts/Mocks/UniversalReceivers/UniversalReceiverTester.sol diff --git a/packages/lsp-smart-contracts/contracts/UniversalProfile.sol b/packages/lsp-smart-contracts/contracts/UniversalProfile.sol new file mode 100644 index 000000000..07e4e7598 --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/UniversalProfile.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/universalprofile-contracts/contracts/UniversalProfile.sol"; diff --git a/packages/lsp-smart-contracts/contracts/UniversalProfileInit.sol b/packages/lsp-smart-contracts/contracts/UniversalProfileInit.sol new file mode 100644 index 000000000..88085216d --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/UniversalProfileInit.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/universalprofile-contracts/contracts/UniversalProfileInit.sol"; diff --git a/packages/lsp-smart-contracts/contracts/UniversalProfileInitAbstract.sol b/packages/lsp-smart-contracts/contracts/UniversalProfileInitAbstract.sol new file mode 100644 index 000000000..0d21a346a --- /dev/null +++ b/packages/lsp-smart-contracts/contracts/UniversalProfileInitAbstract.sol @@ -0,0 +1,4 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +import "@lukso/universalprofile-contracts/contracts/UniversalProfileInitAbstract.sol"; diff --git a/dodoc/config.ts b/packages/lsp-smart-contracts/dodoc/config.ts similarity index 100% rename from dodoc/config.ts rename to packages/lsp-smart-contracts/dodoc/config.ts diff --git a/dodoc/template.sqrl b/packages/lsp-smart-contracts/dodoc/template.sqrl similarity index 100% rename from dodoc/template.sqrl rename to packages/lsp-smart-contracts/dodoc/template.sqrl diff --git a/packages/lsp-smart-contracts/gas_benchmark_result.json b/packages/lsp-smart-contracts/gas_benchmark_result.json new file mode 100644 index 000000000..e21f05d3e --- /dev/null +++ b/packages/lsp-smart-contracts/gas_benchmark_result.json @@ -0,0 +1,204 @@ +{ + "deployment_costs": { + "UniversalProfile": "", + "KeyManager": "", + "LSP1DelegateUP": "", + "LSP7Mintable": "", + "LSP8Mintable": "" + }, + "runtime_costs": { + "EOA_owner": { + "execute": { + "case_1": { + "description": "Transfer 1 LYX to an EOA without data", + "gas_cost": "" + }, + "case_2": { + "description": "Transfer 1 LYX to a UP without data", + "gas_cost": "" + }, + "case_3": { + "description": "Transfer 1 LYX to an EOA with 256 bytes of data", + "gas_cost": "" + }, + "case_4": { + "description": "Transfer 1 LYX to a UP with 256 bytes of data", + "gas_cost": "" + }, + "case_5": { + "description": "Transfer 0.1 LYX to 3x EOA without data", + "gas_cost": "" + }, + "case_6": { + "description": "Transfer 0.1 LYX to 3x UP without data", + "gas_cost": "" + }, + "case_7": { + "description": "Transfer 0.1 LYX to 3x EOA with 256 bytes of data", + "gas_cost": "" + }, + "case_8": { + "description": "Transfer 0.1 LYX to 3x UPs with 256 bytes of data", + "gas_cost": "" + } + }, + "setData": { + "case_1": { + "description": "Set a 20 bytes long value", + "gas_cost": "" + }, + "case_2": { + "description": "Set a 60 bytes long value", + "gas_cost": "" + }, + "case_3": { + "description": "Set a 160 bytes long value", + "gas_cost": "" + }, + "case_4": { + "description": "Set a 300 bytes long value", + "gas_cost": "" + }, + "case_5": { + "description": "Set a 600 bytes long value", + "gas_cost": "" + }, + "case_6": { + "description": "Change the value of a data key already set", + "gas_cost": "" + }, + "case_7": { + "description": "Remove the value of a data key already set", + "gas_cost": "" + }, + "case_8": { + "description": "Set 2 data keys of 20 bytes long value", + "gas_cost": "" + }, + "case_9": { + "description": "Set 2 data keys of 100 bytes long value", + "gas_cost": "" + }, + "case_10": { + "description": "Set 3 data keys of 20 bytes long value", + "gas_cost": "" + }, + "case_11": { + "description": "Change the value of three data keys already set of 20 bytes long value", + "gas_cost": "" + }, + "case_12": { + "description": "Remove the value of three data keys already set", + "gas_cost": "" + } + }, + "tokens": { + "case_1": { + "description": "Minting a LSP7Token to a UP (No Delegate) from an EOA", + "gas_cost": "" + }, + "case_2": { + "description": "Minting a LSP7Token to an EOA from an EOA", + "gas_cost": "" + }, + "case_3": { + "description": "Transferring an LSP7Token from a UP to another UP (No Delegate)", + "gas_cost": "" + }, + "case_4": { + "description": "Minting a LSP8Token to a UP (No Delegate) from an EOA ", + "gas_cost": "" + }, + "case_5": { + "description": "Minting a LSP8Token to an EOA from an EOA ", + "gas_cost": "" + }, + "case_6": { + "description": "Transferring an LSP8Token from a UP to another UP (No Delegate)", + "gas_cost": "" + } + } + }, + "KeyManager_owner": { + "execute": { + "case_1": { + "description": "LYX transfer --> to an EOA", + "main_controller": "", + "restricted_controller": "" + }, + "case_2": { + "description": "LYX transfer --> to a UP", + "main_controller": "", + "restricted_controller": "" + }, + "case_3": { + "description": "LSP7 token transfer --> to an EOA", + "main_controller": "", + "restricted_controller": "" + }, + "case_4": { + "description": "LSP7 token transfer --> to a UP", + "main_controller": "", + "restricted_controller": "" + }, + "case_5": { + "description": "LSP8 NFT transfer --> to an EOA", + "main_controller": "", + "restricted_controller": "" + }, + "case_6": { + "description": "LSP8 NFT transfer --> to a UP", + "main_controller": "", + "restricted_controller": "" + } + }, + "setData": { + "case_1": { + "description": "Update Profile details (LSP3Profile Metadata)", + "main_controller": "", + "restricted_controller": "" + }, + "case_2": { + "description": "Add a new controller with permission to `SET_DATA` + 3x allowed data keys:
`AddressPermissions[]`
+ `AddressPermissions[index]`
+ `AddressPermissions:Permissions:`
+ `AddressPermissions:AllowedERC725YDataKeys: 1. decrease `AddressPermissions[]` Array length
2. remove the controller address at `AddressPermissions[index]`
3. set \"0x\" for the controller permissions under AddressPermissions:Permissions:", + "main_controller": "", + "restricted_controller": "" + }, + "case_5": { + "description": "Write 5x new LSP12 Issued Assets", + "main_controller": "", + "restricted_controller": "" + }, + "case_6": { + "description": "Update 3x data keys (first 3)", + "main_controller": "", + "restricted_controller": "" + }, + "case_7": { + "description": "Update 3x data keys (middle 3)", + "main_controller": "", + "restricted_controller": "" + }, + "case_8": { + "description": "Update 3x data keys (last 3)", + "main_controller": "", + "restricted_controller": "" + }, + "case_9": { + "description": "Set 2 x new data keys + add 3x new controllers", + "main_controller": "", + "restricted_controller": "" + } + } + } + } +} \ No newline at end of file diff --git a/hardhat.config.ts b/packages/lsp-smart-contracts/hardhat.config.ts similarity index 100% rename from hardhat.config.ts rename to packages/lsp-smart-contracts/hardhat.config.ts diff --git a/packages/lsp-smart-contracts/index.ts b/packages/lsp-smart-contracts/index.ts new file mode 100644 index 000000000..c94f80f84 --- /dev/null +++ b/packages/lsp-smart-contracts/index.ts @@ -0,0 +1 @@ +export * from './constants'; diff --git a/packages/lsp-smart-contracts/package.json b/packages/lsp-smart-contracts/package.json new file mode 100644 index 000000000..d504eb7e3 --- /dev/null +++ b/packages/lsp-smart-contracts/package.json @@ -0,0 +1,89 @@ +{ + "name": "@lukso/lsp-smart-contracts", + "version": "0.12.1", + "description": "The reference smart contract implementation for the LUKSO LSP standards", + "license": "Apache-2.0", + "author": "", + "keywords": [ + "LUKSO", + "LSP", + "Blockchain", + "Standards", + "Smart Contracts", + "Ethereum", + "EVM", + "Solidity" + ], + "directories": { + "test": "tests" + }, + "files": [ + "contracts/**/*.sol", + "!contracts/Mocks/**/*.sol", + "artifacts/*.json", + "dist", + "./README.md", + "./CONTRIBUTING.md", + "./LICENSE" + ], + "main": "./dist/constants.cjs", + "module": "./dist/constants.mjs", + "typings": "./dist/constants.d.ts", + "exports": { + ".": { + "require": "./dist/constants.cjs", + "import": "./dist/constants.mjs", + "types": "./dist/constants.d.ts" + }, + "./constants.js": { + "require": "./dist/constants.cjs", + "import": "./dist/constants.mjs", + "types": "./dist/constants.d.ts" + }, + "./constants": { + "require": "./dist/constants.cjs", + "import": "./dist/constants.mjs", + "types": "./dist/constants.d.ts" + }, + "./artifacts/*": "./artifacts/*", + "./dist/*": "./dist/*", + "./package.json": "./package.json" + }, + "scripts": { + "build": "hardhat compile --show-stack-traces", + "build:foundry": "forge build", + "build:js": "unbuild", + "build:docs": "hardhat dodoc && prettier -w ./docs", + "clean": "hardhat clean && rm -Rf dist/", + "format": "prettier --write .", + "lint": "eslint . --ext .ts,.js", + "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'", + "package": "hardhat prepare-package", + "test": "hardhat test --no-compile tests/**/*.test.ts", + "test:foundry": "FOUNDRY_PROFILE=lsp_smart_contracts forge test --no-match-test Skip -vvv", + "test:coverage": "hardhat coverage" + }, + "dependencies": { + "@lukso/lsp0-contracts": "*", + "@lukso/lsp1-contracts": "*", + "@lukso/lsp10-contracts": "*", + "@lukso/lsp12-contracts": "*", + "@lukso/lsp14-contracts": "*", + "@lukso/lsp16-contracts": "*", + "@lukso/lsp17-contracts": "*", + "@lukso/lsp17contractextension-contracts": "*", + "@lukso/lsp1delegate-contracts": "*", + "@lukso/lsp2-contracts": "*", + "@lukso/lsp20-contracts": "*", + "@lukso/lsp23-contracts": "*", + "@lukso/lsp25-contracts": "*", + "@lukso/lsp3-contracts": "*", + "@lukso/lsp4-contracts": "*", + "@lukso/lsp5-contracts": "*", + "@lukso/lsp6-contracts": "*", + "@lukso/lsp7-contracts": "*", + "@lukso/lsp8-contracts": "*", + "@lukso/lsp9-contracts": "*", + "@lukso/universalprofile-contracts": "*" + } +} diff --git a/scripts/ci/README.md b/packages/lsp-smart-contracts/scripts/ci/README.md similarity index 100% rename from scripts/ci/README.md rename to packages/lsp-smart-contracts/scripts/ci/README.md diff --git a/scripts/ci/check-deployer-balance.ts b/packages/lsp-smart-contracts/scripts/ci/check-deployer-balance.ts similarity index 100% rename from scripts/ci/check-deployer-balance.ts rename to packages/lsp-smart-contracts/scripts/ci/check-deployer-balance.ts diff --git a/scripts/ci/docs-generate.ts b/packages/lsp-smart-contracts/scripts/ci/docs-generate.ts similarity index 100% rename from scripts/ci/docs-generate.ts rename to packages/lsp-smart-contracts/scripts/ci/docs-generate.ts diff --git a/scripts/ci/gas_benchmark.ts b/packages/lsp-smart-contracts/scripts/ci/gas_benchmark.ts similarity index 100% rename from scripts/ci/gas_benchmark.ts rename to packages/lsp-smart-contracts/scripts/ci/gas_benchmark.ts diff --git a/scripts/ci/gas_benchmark_template.json b/packages/lsp-smart-contracts/scripts/ci/gas_benchmark_template.json similarity index 100% rename from scripts/ci/gas_benchmark_template.json rename to packages/lsp-smart-contracts/scripts/ci/gas_benchmark_template.json diff --git a/scripts/ci/verify-all-contracts.ts b/packages/lsp-smart-contracts/scripts/ci/verify-all-contracts.ts similarity index 100% rename from scripts/ci/verify-all-contracts.ts rename to packages/lsp-smart-contracts/scripts/ci/verify-all-contracts.ts diff --git a/scripts/fix_flattener.js b/packages/lsp-smart-contracts/scripts/fix_flattener.js similarity index 100% rename from scripts/fix_flattener.js rename to packages/lsp-smart-contracts/scripts/fix_flattener.js diff --git a/scripts/interfaceIds.ts b/packages/lsp-smart-contracts/scripts/interfaceIds.ts similarity index 100% rename from scripts/interfaceIds.ts rename to packages/lsp-smart-contracts/scripts/interfaceIds.ts diff --git a/scripts/typesTs.sh b/packages/lsp-smart-contracts/scripts/typesTs.sh similarity index 100% rename from scripts/typesTs.sh rename to packages/lsp-smart-contracts/scripts/typesTs.sh diff --git a/tests/Benchmark.test.ts b/packages/lsp-smart-contracts/tests/Benchmark.test.ts similarity index 90% rename from tests/Benchmark.test.ts rename to packages/lsp-smart-contracts/tests/Benchmark.test.ts index 419e08423..98f4427ed 100644 --- a/tests/Benchmark.test.ts +++ b/packages/lsp-smart-contracts/tests/Benchmark.test.ts @@ -11,6 +11,8 @@ import { UniversalProfile, UniversalProfile__factory, LSP6KeyManager__factory, + LSP8Mintable__factory, + LSP8Mintable, } from '../types'; import { ERC725YDataKeys, INTERFACE_IDS } from '../constants'; @@ -49,7 +51,7 @@ const buildLSP6TestContext = async (initialFunding?: bigint): Promise { accounts[0].address, ); - const universalProfileDeployTransaction = universalProfile.deployTransaction; + const universalProfileDeployTransaction = universalProfile.deploymentTransaction(); const universalProfileDeploymentReceipt = await universalProfileDeployTransaction.wait(); - gasBenchmark['deployment_costs']['UniversalProfile'] = - universalProfileDeploymentReceipt.gasUsed.toNumber(); + gasBenchmark['deployment_costs']['UniversalProfile'] = ethers.toNumber( + universalProfileDeploymentReceipt.gasUsed, + ); // Key Manager const keyManager = await new LSP6KeyManager__factory(accounts[0]).deploy( - universalProfile.address, + universalProfile.target, ); - const keyManagerDeployTransaction = keyManager.deployTransaction; + const keyManagerDeployTransaction = keyManager.deploymentTransaction(); const keyManagerDeploymentReceipt = await keyManagerDeployTransaction?.wait(); - gasBenchmark['deployment_costs']['KeyManager'] = - keyManagerDeploymentReceipt?.gasUsed.toNumber(); + gasBenchmark['deployment_costs']['KeyManager'] = ethers.toNumber( + keyManagerDeploymentReceipt?.gasUsed, + ); // LSP1 Delegate const lsp1Delegate = await new LSP1UniversalReceiverDelegateUP__factory(accounts[0]).deploy(); - const lsp1DelegateDeployTransaction = lsp1Delegate.deployTransaction; + const lsp1DelegateDeployTransaction = lsp1Delegate.deploymentTransaction(); const lsp1DelegateDeploymentReceipt = await lsp1DelegateDeployTransaction.wait(); - gasBenchmark['deployment_costs']['LSP1DelegateUP'] = - lsp1DelegateDeploymentReceipt.gasUsed.toNumber(); + gasBenchmark['deployment_costs']['LSP1DelegateUP'] = ethers.toNumber( + lsp1DelegateDeploymentReceipt.gasUsed, + ); // LSP7 Token (Mintable preset) const lsp7Mintable = await new LSP7Mintable__factory(accounts[0]).deploy( @@ -126,10 +131,12 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { false, ); - const lsp7DeployTransaction = lsp7Mintable.deployTransaction; + const lsp7DeployTransaction = lsp7Mintable.deploymentTransaction(); const lsp7DeploymentReceipt = await lsp7DeployTransaction.wait(); - gasBenchmark['deployment_costs']['LSP7Mintable'] = lsp7DeploymentReceipt.gasUsed.toNumber(); + gasBenchmark['deployment_costs']['LSP7Mintable'] = ethers.toNumber( + lsp7DeploymentReceipt.gasUsed, + ); // LSP8 NFT (Mintable preset) const lsp8Mintable = await new LSP8Mintable__factory(accounts[0]).deploy( @@ -140,10 +147,12 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { LSP8_TOKEN_ID_FORMAT.NUMBER, ); - const lsp8DeployTransaction = lsp8Mintable.deployTransaction; + const lsp8DeployTransaction = lsp8Mintable.deploymentTransaction(); const lsp8DeploymentReceipt = await lsp8DeployTransaction.wait(); - gasBenchmark['deployment_costs']['LSP8Mintable'] = lsp8DeploymentReceipt.gasUsed.toNumber(); + gasBenchmark['deployment_costs']['LSP8Mintable'] = ethers.toNumber( + lsp8DeploymentReceipt.gasUsed, + ); }); }); @@ -169,7 +178,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['execute']['case_1']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Transfer 1 LYX to a UP without data', async () => { @@ -185,7 +194,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['execute']['case_2']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Transfer 1 LYX to an EOA with 256 bytes of data', async () => { @@ -201,7 +210,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['execute']['case_3']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Transfer 1 LYX to a UP with 256 bytes of data', async () => { @@ -211,13 +220,13 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { OPERATION_TYPES.CALL, await context.universalProfile.getAddress(), ethers.parseEther('1'), - ethers.utils.hexConcat(['0x00000000', generateRandomData(252)]), + ethers.concat(['0x00000000', generateRandomData(252)]), ); const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['execute']['case_4']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); }); @@ -257,7 +266,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['execute']['case_5']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Transfer 0.1 LYX to 3x UP without data', async () => { @@ -265,7 +274,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { .connect(context.mainController) .executeBatch( [OPERATION_TYPES.CALL, OPERATION_TYPES.CALL, OPERATION_TYPES.CALL], - [universalProfile1.address, universalProfile2.address, universalProfile3.address], + [universalProfile1.target, universalProfile2.target, universalProfile3.target], [ethers.parseEther('0.1'), ethers.parseEther('0.1'), ethers.parseEther('0.1')], ['0x', '0x', '0x'], ); @@ -273,7 +282,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['execute']['case_6']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Transfer 0.1 LYX to 3x EOA with 256 bytes of data', async () => { @@ -293,20 +302,17 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['execute']['case_7']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Transfer 0.1 LYX to 3x UP with 256 bytes of data', async () => { - const random256BytesData = ethers.utils.hexConcat([ - '0x00000000', - generateRandomData(252), - ]); + const random256BytesData = ethers.concat(['0x00000000', generateRandomData(252)]); const tx = await context.universalProfile .connect(context.mainController) .executeBatch( [OPERATION_TYPES.CALL, OPERATION_TYPES.CALL, OPERATION_TYPES.CALL], - [universalProfile1.address, universalProfile2.address, universalProfile3.address], + [universalProfile1.target, universalProfile2.target, universalProfile3.target], [ethers.parseEther('0.1'), ethers.parseEther('0.1'), ethers.parseEther('0.1')], [random256BytesData, random256BytesData, random256BytesData], ); @@ -314,7 +320,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['execute']['case_8']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); }); }); @@ -334,7 +340,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_1']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Set a 60 bytes long value', async () => { @@ -346,7 +352,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_2']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Set a 160 bytes long value', async () => { @@ -358,7 +364,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_3']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Set a 300 bytes long value', async () => { @@ -370,7 +376,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_4']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Set a 600 bytes long value', async () => { @@ -382,7 +388,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_5']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Change the value of a data key already set', async () => { @@ -397,7 +403,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_6']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Remove the value of a data key already set', async () => { @@ -411,7 +417,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_7']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); }); @@ -432,7 +438,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_8']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Set 2 data keys of 100 bytes long value', async () => { @@ -447,7 +453,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_9']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Set 3 data keys of 20 bytes long value', async () => { @@ -468,7 +474,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_10']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Change the value of three data keys already set of 20 bytes long value', async () => { @@ -491,7 +497,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_11']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('Remove the value of three data keys already set', async () => { @@ -514,7 +520,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['setData']['case_12']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); }); }); @@ -561,7 +567,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['tokens']['case_1']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('when minting LSP7Token to a EOA without data', async () => { @@ -570,7 +576,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['tokens']['case_2']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('when transferring LSP7Token from a UP to a UP without data', async () => { @@ -584,12 +590,12 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const tx = await context.universalProfile .connect(context.mainController) - .execute(OPERATION_TYPES.CALL, lsp7Token.address, 0, lsp7TransferPayload); + .execute(OPERATION_TYPES.CALL, lsp7Token.target, 0, lsp7TransferPayload); const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['tokens']['case_3']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); }); @@ -612,7 +618,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['tokens']['case_4']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('when minting LSP8Token to a EOA without data', async () => { @@ -621,7 +627,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['tokens']['case_5']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); it('when transferring LSP8Token from a UP to a UP without data', async () => { @@ -635,12 +641,12 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const tx = await context.universalProfile .connect(context.mainController) - .execute(OPERATION_TYPES.CALL, lsp8Token.address, 0, lsp8TransferPayload); + .execute(OPERATION_TYPES.CALL, lsp8Token.target, 0, lsp8TransferPayload); const receipt = await tx.wait(); gasBenchmark['runtime_costs']['EOA_owner']['tokens']['case_6']['gas_cost'] = - receipt.gasUsed.toNumber(); + ethers.toNumber(receipt.gasUsed); }); }); }); @@ -682,7 +688,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { await setupKeyManager( context, [ERC725YDataKeys.LSP1.LSP1UniversalReceiverDelegate], - [lsp1Delegate.address], + [await lsp1Delegate.getAddress()], ); // deploy a LSP7 token @@ -721,19 +727,19 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_1'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfers some LYXes to a UP', async () => { const lyxAmount = ethers.parseEther('3'); // prettier-ignore - const tx = await context.universalProfile.connect(context.mainController).execute(OPERATION_TYPES.CALL, aliceUP.address, lyxAmount, "0x"); + const tx = await context.universalProfile.connect(context.mainController).execute(OPERATION_TYPES.CALL, aliceUP.target, lyxAmount, "0x"); const receipt = await tx.wait(); gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_2'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfers some tokens (LSP7) to an EOA (no data)', async () => { @@ -742,7 +748,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const tx = await context.universalProfile.connect(context.mainController).execute( OPERATION_TYPES.CALL, - lsp7MetaCoin.address, + lsp7MetaCoin.target, 0, lsp7MetaCoin.interface.encodeFunctionData("transfer", [ await context.universalProfile.getAddress(), @@ -756,7 +762,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_3'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfer some tokens (LSP7) to a UP (no data)', async () => { @@ -765,11 +771,11 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const tx = await context.universalProfile.connect(context.mainController).execute( OPERATION_TYPES.CALL, - lsp7MetaCoin.address, + lsp7MetaCoin.target, 0, lsp7MetaCoin.interface.encodeFunctionData("transfer", [ await context.universalProfile.getAddress(), - aliceUP.address, + aliceUP.target, tokenAmount, true, "0x", @@ -779,7 +785,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_4'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfer a NFT (LSP8) to a EOA (no data)', async () => { @@ -788,7 +794,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const tx = await context.universalProfile.connect(context.mainController).execute( OPERATION_TYPES.CALL, - lsp8MetaNFT.address, + lsp8MetaNFT.target, 0, lsp8MetaNFT.interface.encodeFunctionData("transfer", [ await context.universalProfile.getAddress(), @@ -802,7 +808,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_5'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfer a NFT (LSP8) to a UP (no data)', async () => { @@ -811,11 +817,11 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const tx = await context.universalProfile.connect(context.mainController).execute( OPERATION_TYPES.CALL, - lsp8MetaNFT.address, + lsp8MetaNFT.target, 0, lsp8MetaNFT.interface.encodeFunctionData("transfer", [ await context.universalProfile.getAddress(), - aliceUP.address, + aliceUP.target, nftId, false, "0x", @@ -825,7 +831,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_6'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); }); @@ -941,20 +947,20 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { ERC725YDataKeys.LSP6["AddressPermissions:AllowedCalls"] + canTransferTwoNFTs.address.substring(2), ], [ - lsp1Delegate.address, + await lsp1Delegate.getAddress(), PERMISSIONS.TRANSFERVALUE, PERMISSIONS.CALL, PERMISSIONS.CALL, - combineAllowedCalls([CALLTYPE.VALUE, CALLTYPE.VALUE], [allowedAddressToTransferValue, aliceUP.address], ["0xffffffff", "0xffffffff"], ["0xffffffff", "0xffffffff"]), + combineAllowedCalls([CALLTYPE.VALUE, CALLTYPE.VALUE], [allowedAddressToTransferValue, await aliceUP.getAddress()], ["0xffffffff", "0xffffffff"], ["0xffffffff", "0xffffffff"]), combineAllowedCalls( [CALLTYPE.CALL, CALLTYPE.CALL], - [lsp7MetaCoin.address, lsp7LyxDai.address], + [await lsp7MetaCoin.getAddress(), await lsp7LyxDai.getAddress()], [INTERFACE_IDS.LSP7DigitalAsset, INTERFACE_IDS.LSP7DigitalAsset], ["0xffffffff", "0xffffffff"] ), combineAllowedCalls( [CALLTYPE.CALL, CALLTYPE.CALL], - [lsp8MetaNFT.address, lsp8LyxPunks.address], + [await lsp8MetaNFT.getAddress(), await lsp8LyxPunks.getAddress()], [INTERFACE_IDS.LSP8IdentifiableDigitalAsset, INTERFACE_IDS.LSP8IdentifiableDigitalAsset], ["0xffffffff", "0xffffffff"] ) @@ -972,7 +978,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_1'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfer some LYXes to a UP - restricted to 2 x allowed address only (an EOA + a UP) (TRANSFERVALUE + 2x AllowedCalls)', async () => { @@ -981,12 +987,12 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const tx = await context.universalProfile .connect(canTransferValueToOneAddress) - .execute(OPERATION_TYPES.CALL, aliceUP.address, lyxAmount, '0x'); + .execute(OPERATION_TYPES.CALL, aliceUP.target, lyxAmount, '0x'); const receipt = await tx.wait(); gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_2'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfers some tokens (LSP7) to an EOA - restricted to LSP7 + 2x allowed contracts only (CALL + 2x AllowedCalls) (no data)', async () => { @@ -995,7 +1001,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const tx = await context.universalProfile.connect(canTransferTwoTokens).execute( OPERATION_TYPES.CALL, - lsp7MetaCoin.address, + lsp7MetaCoin.target, 0, lsp7MetaCoin.interface.encodeFunctionData("transfer", [ await context.universalProfile.getAddress(), @@ -1009,7 +1015,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_3'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfers some tokens (LSP7) to an other UP - restricted to LSP7 + 2x allowed contracts only (CALL + 2x AllowedCalls) (no data)', async () => { @@ -1018,11 +1024,11 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const tx = await context.universalProfile.connect(canTransferTwoTokens).execute( OPERATION_TYPES.CALL, - lsp7MetaCoin.address, + lsp7MetaCoin.target, 0, lsp7MetaCoin.interface.encodeFunctionData("transfer", [ await context.universalProfile.getAddress(), - aliceUP.address, + aliceUP.target, tokenAmount, true, "0x", @@ -1032,7 +1038,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_4'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfers a NFT (LSP8) to an EOA - restricted to LSP8 + 2x allowed contracts only (CALL + 2x AllowedCalls) (no data)', async () => { @@ -1041,7 +1047,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const tx = await context.universalProfile.connect(canTransferTwoNFTs).execute( OPERATION_TYPES.CALL, - lsp8MetaNFT.address, + lsp8MetaNFT.target, 0, lsp8MetaNFT.interface.encodeFunctionData("transfer", [ await context.universalProfile.getAddress(), @@ -1055,7 +1061,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_5'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('transfers a NFT (LSP8) to an other UP - restricted to LSP8 + 2x allowed contracts only (CALL + 2x AllowedCalls) (no data)', async () => { @@ -1064,11 +1070,11 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const tx = await context.universalProfile.connect(canTransferTwoNFTs).execute( OPERATION_TYPES.CALL, - lsp8MetaNFT.address, + lsp8MetaNFT.target, 0, lsp8MetaNFT.interface.encodeFunctionData("transfer", [ await context.universalProfile.getAddress(), - aliceUP.address, + aliceUP.target, nftId, false, "0x", @@ -1078,7 +1084,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['execute']['case_6'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); }); }); @@ -1123,7 +1129,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const permissionValues = [ // Set some JSONURL for LSP3Profile metadata to test gas cost of updating your profile details '0x6f357c6a70546a2accab18748420b63c63b5af4cf710848ae83afc0c51dd8ad17fb5e8b3697066733a2f2f516d65637247656a555156587057347a53393438704e76636e51724a314b69416f4d36626466725663575a736e35', - ethers.zeroPadValue(ethers.toBigInt(3).toHexString(), 16), + ethers.zeroPadValue(ethers.toBeHex(3), 16), context.mainController.address, ]; @@ -1145,7 +1151,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_1'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it(`Give permissions to a controller @@ -1163,14 +1169,14 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const dataKeys = [ ERC725YDataKeys.LSP6["AddressPermissions[]"].length, - ERC725YDataKeys.LSP6["AddressPermissions[]"].index + ethers.zeroPadValue(ethers.utils.hexStripZeros(AddressPermissionsArrayLength), 16).substring(2), + ERC725YDataKeys.LSP6["AddressPermissions[]"].index + ethers.zeroPadValue(ethers.stripZerosLeft(AddressPermissionsArrayLength), 16).substring(2), ERC725YDataKeys.LSP6["AddressPermissions:Permissions"] + newController.address.substring(2), ERC725YDataKeys.LSP6["AddressPermissions:AllowedERC725YDataKeys"] + newController.address.substring(2), ]; // prettier-ignore const dataValues = [ - ethers.zeroPadValue(ethers.toBigInt(AddressPermissionsArrayLength).add(1).toHexString(), 16), + ethers.zeroPadValue(ethers.toBeHex(ethers.toBigInt(AddressPermissionsArrayLength) + BigInt(1)), 16), newController.address, combinePermissions(PERMISSIONS.SETDATA), encodeCompactBytesArray([ @@ -1190,7 +1196,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_2'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Update permissions of previous controller. Allow it now to `SUPER_SETDATA`', async () => { @@ -1212,7 +1218,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_3'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it(`Remove a controller @@ -1230,14 +1236,14 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const dataKeys = [ ERC725YDataKeys.LSP6["AddressPermissions[]"].length, - ERC725YDataKeys.LSP6["AddressPermissions[]"].index + ethers.zeroPadValue(ethers.utils.hexStripZeros(AddressPermissionsArrayLength), 16).substring(2), + ERC725YDataKeys.LSP6["AddressPermissions[]"].index + ethers.zeroPadValue(ethers.stripZerosLeft(AddressPermissionsArrayLength), 16).substring(2), ERC725YDataKeys.LSP6["AddressPermissions:Permissions"] + newController.address.substring(2), ERC725YDataKeys.LSP6["AddressPermissions:AllowedERC725YDataKeys"] + newController.address.substring(2), ]; // prettier-ignore const dataValues = [ - ethers.zeroPadValue(ethers.toBigInt(AddressPermissionsArrayLength).sub(1).toHexString(), 16), + ethers.zeroPadValue(ethers.toBeHex(ethers.toBigInt(AddressPermissionsArrayLength) - BigInt(1)), 16), "0x", "0x", "0x", @@ -1251,7 +1257,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_4'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Write 5x new LSP12 Issued Assets', async () => { @@ -1288,7 +1294,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_5'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Updates 1x data key', async () => { @@ -1303,7 +1309,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_5'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Updates 3x data keys (first x3)', async () => { @@ -1318,7 +1324,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_6'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Update 3x data keys (middle x3)', async () => { @@ -1333,7 +1339,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_7'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Update 3x data keys (last x3)', async () => { @@ -1348,20 +1354,20 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_8'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Set 2x data keys + add 3x new controllers (including setting the array length + indexes under AddressPermissions[index]) - 12 data keys in total', async () => { - const addressPermissionsArrayLength = ethers - .toBigInt( + const addressPermissionsArrayLength = ethers.toNumber( + ethers.toBigInt( await context.universalProfile.getData( ERC725YDataKeys.LSP6['AddressPermissions[]'].length, ), - ) - .toNumber(); + ), + ); const newArrayLengthUint128Hex = ethers.zeroPadValue( - ethers.toBigInt(addressPermissionsArrayLength).add(3).toHexString(), + ethers.toBeHex(ethers.toBigInt(addressPermissionsArrayLength) + BigInt(3)), 16, ); @@ -1421,7 +1427,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_9'][ 'main_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); }); @@ -1461,7 +1467,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { const permissionValues = [ // Set some JSONURL for LSP3Profile metadata to test gas cost of updating your profile details '0x6f357c6a70546a2accab18748420b63c63b5af4cf710848ae83afc0c51dd8ad17fb5e8b3697066733a2f2f516d65637247656a555156587057347a53393438704e76636e51724a314b69416f4d36626466725663575a736e35', - ethers.zeroPadValue(ethers.toBigInt(6).toHexString(), 16), + ethers.zeroPadValue(ethers.toBeHex(6), 16), context.mainController.address, PERMISSIONS.SETDATA, encodeCompactBytesArray([ @@ -1497,7 +1503,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_1'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it(`Give permissions to a controller @@ -1515,14 +1521,14 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const dataKeys = [ ERC725YDataKeys.LSP6["AddressPermissions[]"].length, - ERC725YDataKeys.LSP6["AddressPermissions[]"].index + ethers.zeroPadValue(ethers.utils.hexStripZeros(AddressPermissionsArrayLength), 16).substring(2), + ERC725YDataKeys.LSP6["AddressPermissions[]"].index + ethers.zeroPadValue(ethers.stripZerosLeft(AddressPermissionsArrayLength), 16).substring(2), ERC725YDataKeys.LSP6["AddressPermissions:Permissions"] + newController.address.substring(2), ERC725YDataKeys.LSP6["AddressPermissions:AllowedERC725YDataKeys"] + newController.address.substring(2), ]; // prettier-ignore const dataValues = [ - ethers.zeroPadValue(ethers.toBigInt(AddressPermissionsArrayLength).add(1).toHexString(), 16), + ethers.zeroPadValue(ethers.toBeHex(ethers.toBigInt(AddressPermissionsArrayLength) + BigInt(1)), 16), newController.address, combinePermissions(PERMISSIONS.SETDATA), encodeCompactBytesArray([ @@ -1542,7 +1548,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_2'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Update permissions of previous controller. Allow it now to `SUPER_SETDATA`', async () => { @@ -1564,7 +1570,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_3'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it(`Remove a controller @@ -1582,14 +1588,14 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { // prettier-ignore const dataKeys = [ ERC725YDataKeys.LSP6["AddressPermissions[]"].length, - ERC725YDataKeys.LSP6["AddressPermissions[]"].index + ethers.zeroPadValue(ethers.toBigInt(AddressPermissionsArrayLength).sub(1).toHexString(), 16).substring(2), + ERC725YDataKeys.LSP6["AddressPermissions[]"].index + ethers.zeroPadValue(ethers.toBeHex(ethers.toBigInt(AddressPermissionsArrayLength) - BigInt(1)), 16).substring(2), ERC725YDataKeys.LSP6["AddressPermissions:Permissions"] + newController.address.substring(2), ERC725YDataKeys.LSP6["AddressPermissions:AllowedERC725YDataKeys"] + newController.address.substring(2), ]; // prettier-ignore const dataValues = [ - ethers.zeroPadValue(ethers.toBigInt(AddressPermissionsArrayLength).sub(1).toHexString(), 16), + ethers.zeroPadValue(ethers.toBeHex(ethers.toBigInt(AddressPermissionsArrayLength) - BigInt(1)), 16), "0x", "0x", "0x", @@ -1603,7 +1609,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_4'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Write 5x new LSP12 Issued Assets', async () => { @@ -1640,7 +1646,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_5'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Updates 1x data key', async () => { @@ -1655,7 +1661,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_5'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Updates 3x data keys (first x3)', async () => { @@ -1670,7 +1676,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_6'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Update 3x data keys (middle x3)', async () => { @@ -1685,7 +1691,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_7'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Update 3x data keys (last x3)', async () => { @@ -1700,20 +1706,20 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_8'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); it('Set 2x data keys + add 3x new controllers (including setting the array length + indexes under AddressPermissions[index]) - 12 data keys in total', async () => { - const addressPermissionsArrayLength = ethers - .toBigInt( + const addressPermissionsArrayLength = ethers.toNumber( + ethers.toBigInt( await context.universalProfile.getData( ERC725YDataKeys.LSP6['AddressPermissions[]'].length, ), - ) - .toNumber(); + ), + ); const newArrayLengthUint128Hex = ethers.zeroPadValue( - ethers.toBigInt(addressPermissionsArrayLength).add(3).toHexString(), + ethers.toBeHex(ethers.toBigInt(addressPermissionsArrayLength) + BigInt(3)), 16, ); @@ -1773,7 +1779,7 @@ describe('โ›ฝ๐Ÿ“Š Gas Benchmark', () => { gasBenchmark['runtime_costs']['KeyManager_owner']['setData']['case_9'][ 'restricted_controller' - ] = receipt.gasUsed.toNumber(); + ] = ethers.toNumber(receipt.gasUsed); }); }); }); diff --git a/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.behaviour.ts similarity index 100% rename from tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.behaviour.ts diff --git a/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.test.ts b/packages/lsp-smart-contracts/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.test.ts similarity index 100% rename from tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.test.ts rename to packages/lsp-smart-contracts/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.test.ts diff --git a/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.test.ts b/packages/lsp-smart-contracts/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.test.ts similarity index 100% rename from tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP11BasicSocialRecovery/LSP11BasicSocialRecoveryInit.test.ts diff --git a/tests/LSP14Ownable2Step/LSP14Ownable2Step.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP14Ownable2Step/LSP14Ownable2Step.behaviour.ts similarity index 100% rename from tests/LSP14Ownable2Step/LSP14Ownable2Step.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP14Ownable2Step/LSP14Ownable2Step.behaviour.ts diff --git a/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts similarity index 99% rename from tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts index 7304af609..d748737d5 100644 --- a/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts +++ b/packages/lsp-smart-contracts/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts @@ -27,9 +27,6 @@ import { RequireCallbackToken__factory, RevertFallbackExtension, RevertFallbackExtension__factory, - NameExtension, - NameExtension__factory, - AgeExtension__factory, } from '../../types'; // helpers diff --git a/tests/LSP17ContractExtension/LSP17Extendable.test.ts b/packages/lsp-smart-contracts/tests/LSP17ContractExtension/LSP17Extendable.test.ts similarity index 100% rename from tests/LSP17ContractExtension/LSP17Extendable.test.ts rename to packages/lsp-smart-contracts/tests/LSP17ContractExtension/LSP17Extendable.test.ts diff --git a/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts similarity index 100% rename from tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts diff --git a/tests/LSP17Extensions/Extension4337/4337.test.ts b/packages/lsp-smart-contracts/tests/LSP17Extensions/Extension4337/4337.test.ts similarity index 100% rename from tests/LSP17Extensions/Extension4337/4337.test.ts rename to packages/lsp-smart-contracts/tests/LSP17Extensions/Extension4337/4337.test.ts diff --git a/tests/LSP17Extensions/helpers/Create2Factory.ts b/packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/Create2Factory.ts similarity index 100% rename from tests/LSP17Extensions/helpers/Create2Factory.ts rename to packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/Create2Factory.ts diff --git a/tests/LSP17Extensions/helpers/UserOp.ts b/packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/UserOp.ts similarity index 99% rename from tests/LSP17Extensions/helpers/UserOp.ts rename to packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/UserOp.ts index 428445043..66b893db6 100644 --- a/tests/LSP17Extensions/helpers/UserOp.ts +++ b/packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/UserOp.ts @@ -3,17 +3,17 @@ import { dataSlice, keccak256, BytesLike, + AbiCoder, toBigInt, toBeHex, hexlify, toNumber, + Wallet, } from 'ethers'; -import { Wallet } from 'ethers'; import { AddressZero, callDataCost } from './utils'; import { ecsign, toRpcSig, keccak256 as keccak256_buffer } from 'ethereumjs-util'; import { Create2Factory } from './Create2Factory'; import { EntryPoint } from '@account-abstraction/contracts'; -import { AbiCoder } from 'ethers'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import * as typ from './solidityTypes'; import { ethers as hreEther } from 'hardhat'; diff --git a/tests/LSP17Extensions/helpers/solidityTypes.ts b/packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/solidityTypes.ts similarity index 100% rename from tests/LSP17Extensions/helpers/solidityTypes.ts rename to packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/solidityTypes.ts diff --git a/tests/LSP17Extensions/helpers/utils.ts b/packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/utils.ts similarity index 100% rename from tests/LSP17Extensions/helpers/utils.ts rename to packages/lsp-smart-contracts/tests/LSP17Extensions/helpers/utils.ts diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiver.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiver.behaviour.ts similarity index 98% rename from tests/LSP1UniversalReceiver/LSP1UniversalReceiver.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiver.behaviour.ts index 06a894e93..db741b94f 100644 --- a/tests/LSP1UniversalReceiver/LSP1UniversalReceiver.behaviour.ts +++ b/packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiver.behaviour.ts @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { parseEther } from 'ethers'; +import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; // types @@ -159,7 +159,7 @@ export const shouldBehaveLikeLSP1 = (buildContext: () => Promise { - const valueSent = parseEther('3'); + const valueSent = ethers.parseEther('3'); before(async () => { context = await buildContext(); @@ -193,7 +193,7 @@ export const shouldBehaveLikeLSP1 = (buildContext: () => Promise { await context.accounts[0].sendTransaction({ to: lsp1CheckerAddress, - value: parseEther('50'), + value: ethers.parseEther('50'), }); }); diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts similarity index 100% rename from tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.behaviour.ts diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.test.ts b/packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.test.ts similarity index 100% rename from tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.test.ts rename to packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP.test.ts diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts similarity index 100% rename from tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.behaviour.ts diff --git a/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.test.ts b/packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.test.ts similarity index 100% rename from tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.test.ts rename to packages/lsp-smart-contracts/tests/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateVault.test.ts diff --git a/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts similarity index 99% rename from tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts index 929627878..956136121 100644 --- a/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts @@ -32,7 +32,7 @@ import { // constants import { LSP1_TYPE_IDS } from '../../constants'; import { OPERATION_TYPES } from '@lukso/lsp0-contracts'; -import { abiCoder } from './../utils/helpers'; +import { abiCoder } from '../utils/helpers'; export type LSP20TestContext = { accounts: SignerWithAddress[]; diff --git a/tests/LSP20CallVerification/LSP20WithLSP14.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP20WithLSP14.behaviour.ts similarity index 100% rename from tests/LSP20CallVerification/LSP20WithLSP14.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP20WithLSP14.behaviour.ts diff --git a/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddExtensions.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddExtensions.test.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddExtensions.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddExtensions.test.ts diff --git a/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddURD.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddURD.test.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddURD.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeAddURD.test.ts diff --git a/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeOwner.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeOwner.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Admin/PermissionChangeOwner.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeOwner.test.ts index b4626a2ab..ae922613f 100644 --- a/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeOwner.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Admin/PermissionChangeOwner.test.ts @@ -8,7 +8,7 @@ import { ERC725YDataKeys } from '../../../../constants'; import { OPERATION_TYPES } from '@lukso/lsp0-contracts'; import { PERMISSIONS } from '@lukso/lsp6-contracts'; -import { LSP6KeyManager, LSP6KeyManager__factory } from '../../../../types'; +import { LSP6KeyManager, LSP6KeyManager__factory } from '../../types'; // setup import { LSP6TestContext } from '../../../utils/context'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/AllowedAddresses.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedAddresses.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/AllowedAddresses.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedAddresses.test.ts index acfe2cf14..0e99cbf28 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/AllowedAddresses.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedAddresses.test.ts @@ -2,7 +2,7 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; -import { TargetContract, TargetContract__factory } from '../../../../types'; +import { TargetContract, TargetContract__factory } from '../../types'; // constants import { ERC725YDataKeys } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts index 634b1c8b3..f11605ed1 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedFunctions.test.ts @@ -9,7 +9,7 @@ import { LSP7Mintable__factory, LSP8Mintable, LSP8Mintable__factory, -} from '../../../../types'; +} from '../../types'; // constants import { ERC725YDataKeys, INTERFACE_IDS } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts index a8b011db3..4e9e71387 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/AllowedStandards.test.ts @@ -11,7 +11,7 @@ import { LSP7Mintable__factory, UniversalProfile, UniversalProfile__factory, -} from '../../../../types'; +} from '../../types'; // constants import { ERC725YDataKeys, INTERFACE_IDS } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts index acbfce4cc..549c9b124 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/ERC725XExecuteBatch.test.ts @@ -15,7 +15,7 @@ import { LSP7MintableInit, LSP7MintableInit__factory, LSP7Mintable__factory, -} from '../../../../types'; +} from '../../types'; export const shouldBehaveLikeBatchExecute = ( buildContext: (initialFunding?: bigint) => Promise, diff --git a/tests/LSP20CallVerification/LSP6/Interactions/OtherScenarios.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/OtherScenarios.test.ts similarity index 97% rename from tests/LSP20CallVerification/LSP6/Interactions/OtherScenarios.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/OtherScenarios.test.ts index b43a78b30..eac90fb33 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/OtherScenarios.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/OtherScenarios.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; -import { TargetContract__factory, TargetContract } from '../../../../types'; +import { TargetContract__factory, TargetContract } from '../../types'; // constants import { ERC725YDataKeys } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/PermissionCall.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionCall.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/PermissionCall.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionCall.test.ts index 0250ffa2f..0d88a54b3 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/PermissionCall.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionCall.test.ts @@ -9,7 +9,7 @@ import { FallbackRevert__factory, TargetContract, TargetContract__factory, -} from '../../../../types'; +} from '../../types'; // constants import { ERC725YDataKeys } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/PermissionDelegateCall.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionDelegateCall.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/PermissionDelegateCall.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionDelegateCall.test.ts index 0bd7df864..c937c9f22 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/PermissionDelegateCall.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionDelegateCall.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; -import { ERC725YDelegateCall, ERC725YDelegateCall__factory } from '../../../../types'; +import { ERC725YDelegateCall, ERC725YDelegateCall__factory } from '../../types'; // constants import { ERC725YDataKeys } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/PermissionDeploy.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionDeploy.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/PermissionDeploy.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionDeploy.test.ts index 7fd49ca8b..63fd4a5fa 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/PermissionDeploy.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionDeploy.test.ts @@ -3,7 +3,7 @@ import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { calculateCreate2 } from 'eth-create2-calculator'; -import { TargetContract__factory } from '../../../../types'; +import { TargetContract__factory } from '../../types'; // constants import { ERC725YDataKeys } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/PermissionStaticCall.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionStaticCall.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/PermissionStaticCall.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionStaticCall.test.ts index 9171d907d..3f5eec98d 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/PermissionStaticCall.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionStaticCall.test.ts @@ -1,7 +1,7 @@ import { expect } from 'chai'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; -import { TargetContract, TargetContract__factory } from '../../../../types'; +import { TargetContract, TargetContract__factory } from '../../types'; // constants import { ERC725YDataKeys } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts index 19bfb4079..cc2d96d5e 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts @@ -16,7 +16,7 @@ import { UniversalProfile, FallbackContract__factory, FallbackContract, -} from '../../../../types'; +} from '../../types'; // constants import { ERC725YDataKeys } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/Interactions/Security.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/Security.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/Interactions/Security.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/Security.test.ts index bc25f95dd..b518c2690 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/Security.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/Interactions/Security.test.ts @@ -12,7 +12,7 @@ import { TargetContract, TargetContract__factory, UniversalReceiverDelegateDataUpdater__factory, -} from '../../../../types'; +} from '../../types'; // constants import { ERC725YDataKeys, LSP1_TYPE_IDS } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/LSP20WithLSP6.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/LSP20WithLSP6.behaviour.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/LSP20WithLSP6.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/LSP20WithLSP6.behaviour.ts diff --git a/tests/LSP20CallVerification/LSP6/LSP20WithLSP6.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/LSP20WithLSP6.test.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/LSP20WithLSP6.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/LSP20WithLSP6.test.ts diff --git a/tests/LSP20CallVerification/LSP6/LSP20WithLSP6Init.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/LSP20WithLSP6Init.test.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/LSP20WithLSP6Init.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/LSP20WithLSP6Init.test.ts diff --git a/tests/LSP20CallVerification/LSP6/SetData/AllowedERC725YDataKeys.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetData/AllowedERC725YDataKeys.test.ts similarity index 77% rename from tests/LSP20CallVerification/LSP6/SetData/AllowedERC725YDataKeys.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetData/AllowedERC725YDataKeys.test.ts index bddd939c4..902cab268 100644 --- a/tests/LSP20CallVerification/LSP6/SetData/AllowedERC725YDataKeys.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetData/AllowedERC725YDataKeys.test.ts @@ -1,4 +1,5 @@ import { expect } from 'chai'; +import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; // constants @@ -11,7 +12,7 @@ import { setupKeyManager } from '../../../utils/fixtures'; // helpers import { encodeCompactBytesArray, decodeCompactBytes } from '../../../utils/helpers'; -import { BytesLike, keccak256, hexlify, toUtf8Bytes, randomBytes } from 'ethers'; +import { BytesLike } from 'ethers'; export type TestCase = { datakeyToSet: BytesLike; @@ -26,10 +27,10 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( describe('keyType: Singleton', () => { let controllerCanSetOneKey: SignerWithAddress, controllerCanSetManyKeys: SignerWithAddress; - const customKey1 = keccak256(toUtf8Bytes('CustomKey1')); - const customKey2 = keccak256(toUtf8Bytes('CustomKey2')); - const customKey3 = keccak256(toUtf8Bytes('CustomKey3')); - const customKey4 = keccak256(toUtf8Bytes('CustomKey4')); + const customKey1 = ethers.keccak256(ethers.toUtf8Bytes('CustomKey1')); + const customKey2 = ethers.keccak256(ethers.toUtf8Bytes('CustomKey2')); + const customKey3 = ethers.keccak256(ethers.toUtf8Bytes('CustomKey3')); + const customKey4 = ethers.keccak256(ethers.toUtf8Bytes('CustomKey4')); before(async () => { context = await buildContext(); @@ -109,7 +110,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( describe('when setting one key', () => { it('should pass when setting the right key', async () => { const key = customKey1; - const newValue = hexlify(toUtf8Bytes('Some data')); + const newValue = ethers.hexlify(ethers.toUtf8Bytes('Some data')); await context.universalProfile.connect(controllerCanSetOneKey).setData(key, newValue); @@ -118,8 +119,8 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( }); it('should fail when setting the wrong key', async () => { - const key = keccak256(toUtf8Bytes('NotAllowedKey')); - const newValue = hexlify(toUtf8Bytes('Some data')); + const key = ethers.keccak256(ethers.toUtf8Bytes('NotAllowedKey')); + const newValue = ethers.hexlify(ethers.toUtf8Bytes('Some data')); await expect( context.universalProfile.connect(controllerCanSetOneKey).setData(key, newValue), @@ -132,14 +133,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( describe('when setting multiple keys', () => { it('should fail when the list contains none of the allowed keys', async () => { const keys = [ - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), - keccak256(toUtf8Bytes('ZZZZZZZZZZ')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('ZZZZZZZZZZ')), ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), - hexlify(toUtf8Bytes('Value ZZZZZZZZ')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Value ZZZZZZZZ')), ]; await expect( @@ -152,13 +153,13 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should fail, even if the list contains the allowed key', async () => { const keys = [ customKey1, - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), ]; const values = [ - hexlify(toUtf8Bytes('Custom Value 1')), - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 1')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), ]; await expect( @@ -174,9 +175,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when the input is all the allowed keys', async () => { const keys = [customKey2, customKey3, customKey4]; const values = [ - hexlify(toUtf8Bytes('Some data 1')), - hexlify(toUtf8Bytes('Some data 2')), - hexlify(toUtf8Bytes('Some data 3')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 1')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 2')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 3')), ]; await context.universalProfile.connect(controllerCanSetManyKeys).setDataBatch(keys, values); @@ -188,14 +189,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should fail when the input contains none of the allowed keys', async () => { const keys = [ - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), - keccak256(toUtf8Bytes('ZZZZZZZZZZ')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('ZZZZZZZZZZ')), ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), - hexlify(toUtf8Bytes('Value ZZZZZZZZ')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Value ZZZZZZZZ')), ]; await expect( @@ -208,7 +209,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( describe('when setting one key', () => { it('should pass when trying to set the 1st allowed key', async () => { const key = customKey2; - const newValue = hexlify(toUtf8Bytes('Some data')); + const newValue = ethers.hexlify(ethers.toUtf8Bytes('Some data')); await context.universalProfile.connect(controllerCanSetManyKeys).setData(key, newValue); @@ -218,7 +219,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when trying to set the 2nd allowed key', async () => { const key = customKey3; - const newValue = hexlify(toUtf8Bytes('Some data')); + const newValue = ethers.hexlify(ethers.toUtf8Bytes('Some data')); await context.universalProfile.connect(controllerCanSetManyKeys).setData(key, newValue); @@ -228,7 +229,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when trying to set the 3rd allowed key', async () => { const key = customKey4; - const newValue = hexlify(toUtf8Bytes('Some data')); + const newValue = ethers.hexlify(ethers.toUtf8Bytes('Some data')); await context.universalProfile.connect(controllerCanSetManyKeys).setData(key, newValue); @@ -237,8 +238,8 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( }); it('should fail when setting a not-allowed Singleton key', async () => { - const key = keccak256(toUtf8Bytes('NotAllowedKey')); - const newValue = hexlify(toUtf8Bytes('Some data')); + const key = ethers.keccak256(ethers.toUtf8Bytes('NotAllowedKey')); + const newValue = ethers.hexlify(ethers.toUtf8Bytes('Some data')); await expect( context.universalProfile.connect(controllerCanSetManyKeys).setData(key, newValue), @@ -253,8 +254,8 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('the input is the first two (subset) allowed keys', async () => { const keys = [customKey2, customKey3]; const values = [ - hexlify(toUtf8Bytes('Some data 1')), - hexlify(toUtf8Bytes('Some data 2')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 1')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 2')), ]; await context.universalProfile @@ -268,8 +269,8 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('the input is the last two (subset) allowed keys', async () => { const keys = [customKey3, customKey4]; const values = [ - hexlify(toUtf8Bytes('Some data 1')), - hexlify(toUtf8Bytes('Some data 2')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 1')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 2')), ]; await context.universalProfile @@ -283,8 +284,8 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('the input is the first + last (subset) allowed keys', async () => { const keys = [customKey2, customKey4]; const values = [ - hexlify(toUtf8Bytes('Some data 1')), - hexlify(toUtf8Bytes('Some data 2')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 1')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 2')), ]; await context.universalProfile @@ -302,13 +303,13 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('1st key in input = 1st allowed key. Other 2 keys = not allowed', async () => { const keys = [ customKey2, - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), ]; const values = [ - hexlify(toUtf8Bytes('Custom Value 2')), - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), ]; await expect( @@ -320,14 +321,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('2nd key in input = 1st allowed key. Other 2 keys = not allowed', async () => { const keys = [ - keccak256(toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), customKey2, - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Custom Value 2')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), ]; await expect( @@ -339,14 +340,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('3rd key in input = 1st allowed key. Other 2 keys = not allowed', async () => { const keys = [ - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), customKey2, ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), - hexlify(toUtf8Bytes('Custom Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 2')), ]; await expect( @@ -359,13 +360,13 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('1st key in input = 2nd allowed key. Other 2 keys = not allowed', async () => { const keys = [ customKey3, - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), ]; const values = [ - hexlify(toUtf8Bytes('Custom Value 2')), - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), ]; await expect( @@ -377,14 +378,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('2nd key in input = 2nd allowed key. Other 2 keys = not allowed', async () => { const keys = [ - keccak256(toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), customKey3, - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Custom Value 3')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 3')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), ]; await expect( @@ -396,14 +397,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('3rd key in input = 2nd allowed key. Other 2 keys = not allowed', async () => { const keys = [ - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), customKey3, ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), - hexlify(toUtf8Bytes('Custom Value 3')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 3')), ]; await expect( @@ -416,13 +417,13 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('1st key in input = 3rd allowed key. Other 2 keys = not allowed', async () => { const keys = [ customKey4, - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), ]; const values = [ - hexlify(toUtf8Bytes('Custom Value 4')), - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 4')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), ]; await expect( @@ -434,14 +435,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('2nd key in input = 3rd allowed key. Other 2 keys = not allowed', async () => { const keys = [ - keccak256(toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), customKey4, - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Custom Value 4')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 4')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), ]; await expect( @@ -453,14 +454,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('3rd key in input = 3rd allowed key. Other 2 keys = not allowed', async () => { const keys = [ - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), customKey4, ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), - hexlify(toUtf8Bytes('Custom Value 4')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 4')), ]; await expect( @@ -471,12 +472,16 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( }); it('1st key in input = not allowed key. Other 2 keys = allowed', async () => { - const keys = [keccak256(toUtf8Bytes('XXXXXXXXXX')), customKey2, customKey3]; + const keys = [ + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + customKey2, + customKey3, + ]; const values = [ - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Custom Value 2')), - hexlify(toUtf8Bytes('Custom Value 3')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 3')), ]; await expect( @@ -487,11 +492,15 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( }); it('2nd key in input = not allowed key. Other 2 keys = allowed', async () => { - const keys = [customKey2, keccak256(toUtf8Bytes('XXXXXXXXXX')), customKey3]; + const keys = [ + customKey2, + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + customKey3, + ]; const values = [ - hexlify(toUtf8Bytes('Custom Value 2')), - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Custom Value 3')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 3')), ]; await expect( @@ -502,12 +511,16 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( }); it('3rd key in input = not allowed key. Other 2 keys = allowed', async () => { - const keys = [customKey2, customKey3, keccak256(toUtf8Bytes('XXXXXXXXXX'))]; + const keys = [ + customKey2, + customKey3, + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ]; const values = [ - hexlify(toUtf8Bytes('Custom Value 2')), - hexlify(toUtf8Bytes('Custom Value 3')), - hexlify(toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 3')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), ]; await expect( @@ -527,13 +540,13 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( customKey2, customKey3, customKey4, - keccak256(toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), ]; const values = [ - hexlify(toUtf8Bytes('Some Data for customKey2')), - hexlify(toUtf8Bytes('Some Data for customKey3')), - hexlify(toUtf8Bytes('Some Data for customKey4')), - hexlify(toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data for customKey2')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data for customKey3')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data for customKey4')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), ]; await expect( @@ -550,21 +563,21 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( customKey2, customKey3, customKey4, - keccak256(toUtf8Bytes('XXXXXXXXXX')), - keccak256(toUtf8Bytes('YYYYYYYYYY')), - keccak256(toUtf8Bytes('ZZZZZZZZZZ')), - keccak256(toUtf8Bytes('AAAAAAAAAA')), - keccak256(toUtf8Bytes('BBBBBBBBBB')), + ethers.keccak256(ethers.toUtf8Bytes('XXXXXXXXXX')), + ethers.keccak256(ethers.toUtf8Bytes('YYYYYYYYYY')), + ethers.keccak256(ethers.toUtf8Bytes('ZZZZZZZZZZ')), + ethers.keccak256(ethers.toUtf8Bytes('AAAAAAAAAA')), + ethers.keccak256(ethers.toUtf8Bytes('BBBBBBBBBB')), ]; const values = [ - hexlify(toUtf8Bytes('Custom Value 2')), - hexlify(toUtf8Bytes('Custom Value 3')), - hexlify(toUtf8Bytes('Custom Value 4')), - hexlify(toUtf8Bytes('Value XXXXXXXX')), - hexlify(toUtf8Bytes('Value YYYYYYYY')), - hexlify(toUtf8Bytes('Value ZZZZZZZZ')), - hexlify(toUtf8Bytes('Value AAAAAAAA')), - hexlify(toUtf8Bytes('Value BBBBBBBB')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 3')), + ethers.hexlify(ethers.toUtf8Bytes('Custom Value 4')), + ethers.hexlify(ethers.toUtf8Bytes('Value XXXXXXXX')), + ethers.hexlify(ethers.toUtf8Bytes('Value YYYYYYYY')), + ethers.hexlify(ethers.toUtf8Bytes('Value ZZZZZZZZ')), + ethers.hexlify(ethers.toUtf8Bytes('Value AAAAAAAA')), + ethers.hexlify(ethers.toUtf8Bytes('Value BBBBBBBB')), ]; await expect( @@ -591,15 +604,15 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( customKey4, ]; const values = [ - hexlify(toUtf8Bytes('Some Data for customKey2')), - hexlify(toUtf8Bytes('Some Data for customKey4')), - hexlify(toUtf8Bytes('Some Data for customKey3')), - hexlify(toUtf8Bytes('Some Data (override 1) for customKey2')), - hexlify(toUtf8Bytes('Some Data (override 1) for customKey3')), - hexlify(toUtf8Bytes('Some Data (override 2) for customKey2')), - hexlify(toUtf8Bytes('Some Data (override 1) for customKey4')), - hexlify(toUtf8Bytes('Some Data (override 2) for customKey3')), - hexlify(toUtf8Bytes('Some Data (override 2) for customKey4')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data for customKey2')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data for customKey4')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data for customKey3')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data (override 1) for customKey2')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data (override 1) for customKey3')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data (override 2) for customKey2')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data (override 1) for customKey4')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data (override 2) for customKey3')), + ethers.hexlify(ethers.toUtf8Bytes('Some Data (override 2) for customKey4')), ]; await context.universalProfile @@ -627,8 +640,8 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( describe('when address can set any key', () => { describe('when setting one key', () => { it('should pass when setting any random key', async () => { - const key = hexlify(randomBytes(32)); - const value = hexlify(toUtf8Bytes('Some data')); + const key = ethers.hexlify(ethers.randomBytes(32)); + const value = ethers.hexlify(ethers.toUtf8Bytes('Some data')); await context.universalProfile.connect(context.mainController).setData(key, value); @@ -640,14 +653,14 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( describe('when setting multiple keys', () => { it('should pass when setting any multiple keys', async () => { const keys = [ - hexlify(randomBytes(32)), - hexlify(randomBytes(32)), - hexlify(randomBytes(32)), + ethers.hexlify(ethers.randomBytes(32)), + ethers.hexlify(ethers.randomBytes(32)), + ethers.hexlify(ethers.randomBytes(32)), ]; const values = [ - hexlify(toUtf8Bytes('Some data 1')), - hexlify(toUtf8Bytes('Some data 2')), - hexlify(toUtf8Bytes('Some data 3')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 1')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 2')), + ethers.hexlify(ethers.toUtf8Bytes('Some data 3')), ]; await context.universalProfile.connect(context.mainController).setDataBatch(keys, values); @@ -702,7 +715,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( describe('when setting one key', () => { it('should pass when setting SupportedStandards:LSPX', async () => { const mappingKey = LSPXKey; - const mappingValue = hexlify(toUtf8Bytes('0x24ae6f23')); + const mappingValue = ethers.hexlify(ethers.toUtf8Bytes('0x24ae6f23')); await context.universalProfile .connect(controllerCanSetMappingKeys) @@ -714,7 +727,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when overriding SupportedStandards:LSPX', async () => { const mappingKey = LSPXKey; - const mappingValue = hexlify(toUtf8Bytes('0x24ae6f23')); + const mappingValue = ethers.hexlify(ethers.toUtf8Bytes('0x24ae6f23')); await context.universalProfile .connect(controllerCanSetMappingKeys) @@ -726,7 +739,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when setting SupportedStandards:LSPY', async () => { const mappingKey = LSPYKey; - const mappingValue = hexlify(toUtf8Bytes('0x5e8d18c5')); + const mappingValue = ethers.hexlify(ethers.toUtf8Bytes('0x5e8d18c5')); await context.universalProfile .connect(controllerCanSetMappingKeys) @@ -738,7 +751,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when setting SupportedStandards:LSPZ', async () => { const mappingKey = LSPZKey; - const mappingValue = hexlify(toUtf8Bytes('0x25b71a36')); + const mappingValue = ethers.hexlify(ethers.toUtf8Bytes('0x25b71a36')); await context.universalProfile .connect(controllerCanSetMappingKeys) @@ -828,9 +841,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( '0xcccccccccccccccccccccccccccccccc00000000000000000000000022222222', ]; const randomMappingValues = [ - hexlify(toUtf8Bytes('Random Mapping Value 1')), - hexlify(toUtf8Bytes('Random Mapping Value 2')), - hexlify(toUtf8Bytes('Random Mapping Value 3')), + ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value 1')), + ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value 3')), ]; await expect( @@ -850,8 +863,8 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( ]; const mappingValues = [ '0x24ae6f23', - hexlify(toUtf8Bytes('Random Mapping Value 1')), - hexlify(toUtf8Bytes('Random Mapping Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value 1')), + ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value 2')), ]; await expect( @@ -870,7 +883,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when setting any random Mapping key', async () => { const randomMappingKey = '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa00000000000000000000000011111111'; - const randomMappingValue = hexlify(toUtf8Bytes('Random Mapping Value')); + const randomMappingValue = ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value')); await context.universalProfile .connect(context.mainController) @@ -889,9 +902,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( '0xcccccccccccccccccccccccccccccccc00000000000000000000000022222222', ]; const randomMappingValues = [ - hexlify(toUtf8Bytes('Random Mapping Value 1')), - hexlify(toUtf8Bytes('Random Mapping Value 2')), - hexlify(toUtf8Bytes('Random Mapping Value 3')), + ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value 1')), + ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value 2')), + ethers.hexlify(ethers.toUtf8Bytes('Random Mapping Value 3')), ]; await context.universalProfile @@ -950,7 +963,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when setting array key length MyArray[]', async () => { const key = arrayKeyLength; // eg: MyArray[].length = 10 elements - const value = hexlify(toUtf8Bytes('0x0a')); + const value = ethers.hexlify(ethers.toUtf8Bytes('0x0a')); await context.universalProfile.connect(controllerCanSetArrayKeys).setData(key, value); @@ -960,7 +973,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when setting 1st array element MyArray[0]', async () => { const key = arrayKeyElement1; - const value = hexlify(toUtf8Bytes('0xaaaaaaaa')); + const value = ethers.hexlify(ethers.toUtf8Bytes('0xaaaaaaaa')); await context.universalProfile.connect(controllerCanSetArrayKeys).setData(key, value); @@ -970,7 +983,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when setting 2nd array element MyArray[1]', async () => { const key = arrayKeyElement2; - const value = hexlify(toUtf8Bytes('0xbbbbbbbb')); + const value = ethers.hexlify(ethers.toUtf8Bytes('0xbbbbbbbb')); await context.universalProfile.connect(controllerCanSetArrayKeys).setData(key, value); @@ -980,7 +993,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when setting 3rd array element MyArray[3]', async () => { const key = arrayKeyElement3; - const value = hexlify(toUtf8Bytes('0xcccccccc')); + const value = ethers.hexlify(ethers.toUtf8Bytes('0xcccccccc')); await context.universalProfile.connect(controllerCanSetArrayKeys).setData(key, value); @@ -1052,8 +1065,8 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( describe('Testing bytes32(0) (= zero key) edge cases', () => { let controllerCanSetSomeKeys: SignerWithAddress; - const customKey1 = keccak256(toUtf8Bytes('CustomKey1')); - const customKey2 = keccak256(toUtf8Bytes('CustomKey2')); + const customKey1 = ethers.keccak256(ethers.toUtf8Bytes('CustomKey1')); + const customKey2 = ethers.keccak256(ethers.toUtf8Bytes('CustomKey2')); const zeroKey = '0x0000000000000000000000000000000000000000000000000000000000000000'; @@ -1097,7 +1110,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( [{ allowedDataKey: customKey1 }, { allowedDataKey: customKey2 }].forEach((testCase) => { it(`should pass when setting a data key listed in the allowed ERC725Y data keys: ${testCase.allowedDataKey}`, async () => { const key = testCase.allowedDataKey; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value); @@ -1108,24 +1121,24 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( [ { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 1')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 1')), }, { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 2')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 2')), }, { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 3')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 3')), }, { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 4')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 4')), }, { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 5')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 5')), }, ].forEach((testCase) => { it(`should revert when trying to set any random data key (e.g: ${testCase.datakeyToSet})`, async () => { const key = testCase.datakeyToSet; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await expect( context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value), @@ -1137,7 +1150,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should revert when trying to set bytes31(0) dynamic key, not in AllowedERC725YDataKeys', async () => { const key = bytes31DynamicKey; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await expect(context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value)) .to.be.revertedWithCustomError(context.keyManager, 'NotAllowedERC725YDataKey') @@ -1146,7 +1159,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass and allow to set the bytes32(0) data key', async () => { const key = zeroKey; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value); @@ -1156,9 +1169,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when trying to set an array of data keys that includes bytes32(0) (= zero data key)', async () => { const keys = [customKey1, customKey2, zeroKey]; const values = [ - hexlify(toUtf8Bytes('some value for ' + keys[0])), - hexlify(toUtf8Bytes('some value for ' + keys[1])), - hexlify(toUtf8Bytes('some value for ' + keys[2])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[0])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[1])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[2])), ]; await context.universalProfile.connect(controllerCanSetSomeKeys).setDataBatch(keys, values); @@ -1169,9 +1182,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should revert when trying to set an array of data keys including a dynamic bytes31(0) data key, not in AllowedERC725YDataKeys', async () => { const keys = [customKey1, customKey2, bytes31DynamicKey]; const values = [ - hexlify(toUtf8Bytes('some value for ' + keys[0])), - hexlify(toUtf8Bytes('some value for ' + keys[1])), - hexlify(toUtf8Bytes('some value for ' + keys[2])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[0])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[1])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[2])), ]; await expect( @@ -1184,9 +1197,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should revert when trying to set an array of data keys including a dynamic bytes20(0) data key, not in AllowedERC725YDataKeys', async () => { const keys = [customKey1, customKey2, bytes20DynamicKey]; const values = [ - hexlify(toUtf8Bytes('some value for ' + keys[0])), - hexlify(toUtf8Bytes('some value for ' + keys[1])), - hexlify(toUtf8Bytes('some value for ' + keys[2])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[0])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[1])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[2])), ]; await expect( @@ -1229,7 +1242,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( [{ allowedDataKey: customKey1 }, { allowedDataKey: customKey2 }].forEach((testCase) => { it(`should pass when setting a data key listed in the allowed ERC725Y data keys: ${testCase.allowedDataKey}`, async () => { const key = testCase.allowedDataKey; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value); @@ -1240,24 +1253,24 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( [ { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 1')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 1')), }, { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 2')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 2')), }, { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 3')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 3')), }, { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 4')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 4')), }, { - datakeyToSet: keccak256(toUtf8Bytes('Some random data key 5')), + datakeyToSet: ethers.keccak256(ethers.toUtf8Bytes('Some random data key 5')), }, ].forEach((testCase) => { it(`should revert when trying to set any random data key (e.g: ${testCase.datakeyToSet})`, async () => { const key = testCase.datakeyToSet; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await expect( context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value), @@ -1269,7 +1282,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should allow setting up a key with a prefix of 31 null bytes, as bytes31(0) is part of AllowedERC725YDataKeys', async () => { const key = bytes31DynamicKey; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value); @@ -1279,7 +1292,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should allow setting up a key with a prefix of 20 null bytes, as bytes20(0) is part of AllowedERC725YDataKeys', async () => { const key = bytes20DynamicKey; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value); @@ -1289,7 +1302,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass and allow to set the bytes32(0) data key', async () => { const key = zeroKey; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value); @@ -1299,9 +1312,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when setting an array of data keys that includes bytes32(0) (= zero data key)', async () => { const keys = [customKey1, customKey2, zeroKey]; const values = [ - hexlify(toUtf8Bytes('some value for ' + keys[0])), - hexlify(toUtf8Bytes('some value for ' + keys[1])), - hexlify(toUtf8Bytes('some value for ' + keys[2])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[0])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[1])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[2])), ]; await context.universalProfile.connect(controllerCanSetSomeKeys).setDataBatch(keys, values); @@ -1312,9 +1325,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should pass when trying to set an array of data keys including a dynamic bytes24(0) data key, because bytes20(0) dynamic data ke is in AllowedERC725YDataKeys', async () => { const keys = [customKey1, customKey2, bytes24DynamicKey]; const values = [ - hexlify(toUtf8Bytes('some value for ' + keys[0])), - hexlify(toUtf8Bytes('some value for ' + keys[1])), - hexlify(toUtf8Bytes('some value for ' + keys[2])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[0])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[1])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[2])), ]; await context.universalProfile.connect(controllerCanSetSomeKeys).setDataBatch(keys, values); @@ -1325,9 +1338,9 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( it('should revert when trying to set an array of data keys including a dynamic bytes19(0) data key, not in AllowedERC725YDataKeys', async () => { const keys = [customKey1, customKey2, bytes19DynamicKey]; const values = [ - hexlify(toUtf8Bytes('some value for ' + keys[0])), - hexlify(toUtf8Bytes('some value for ' + keys[1])), - hexlify(toUtf8Bytes('some value for ' + keys[2])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[0])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[1])), + ethers.hexlify(ethers.toUtf8Bytes('some value for ' + keys[2])), ]; await expect( @@ -1381,7 +1394,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( ].forEach((testCase) => { it(`e.g: ${testCase.datakeyToSet}`, async () => { const key = testCase.datakeyToSet; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value); @@ -1414,7 +1427,7 @@ export const shouldBehaveLikeAllowedERC725YDataKeys = ( ].forEach((testCase) => { it(`should revert (e.g: ${testCase.datakeyToSet})`, async () => { const key = testCase.datakeyToSet; - const value = hexlify(toUtf8Bytes('some value for ' + key)); + const value = ethers.hexlify(ethers.toUtf8Bytes('some value for ' + key)); await expect( context.universalProfile.connect(controllerCanSetSomeKeys).setData(key, value), diff --git a/tests/LSP20CallVerification/LSP6/SetData/PermissionSetData.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetData/PermissionSetData.test.ts similarity index 99% rename from tests/LSP20CallVerification/LSP6/SetData/PermissionSetData.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetData/PermissionSetData.test.ts index d512c38ec..89b252508 100644 --- a/tests/LSP20CallVerification/LSP6/SetData/PermissionSetData.test.ts +++ b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetData/PermissionSetData.test.ts @@ -3,7 +3,7 @@ import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { encodeData, ERC725JSONSchema } from '@erc725/erc725.js'; -import { ExecutorLSP20, ExecutorLSP20__factory } from '../../../../types'; +import { ExecutorLSP20, ExecutorLSP20__factory } from '../../types'; // constants import { ERC725YDataKeys } from '../../../../constants'; diff --git a/tests/LSP20CallVerification/LSP6/SetPermissions/PermissionChangeAddController.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetPermissions/PermissionChangeAddController.test.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/SetPermissions/PermissionChangeAddController.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetPermissions/PermissionChangeAddController.test.ts diff --git a/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedCalls.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedCalls.test.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedCalls.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedCalls.test.ts diff --git a/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedERC725YDataKeys.test.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedERC725YDataKeys.test.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedERC725YDataKeys.test.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedERC725YDataKeys.test.ts diff --git a/tests/LSP20CallVerification/LSP6/index.ts b/packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/index.ts similarity index 100% rename from tests/LSP20CallVerification/LSP6/index.ts rename to packages/lsp-smart-contracts/tests/LSP20CallVerification/LSP6/index.ts diff --git a/tests/LSP23LinkedContractsDeployment/LSP23LinkedContractsDeployment.test.ts b/packages/lsp-smart-contracts/tests/LSP23LinkedContractsDeployment/LSP23LinkedContractsDeployment.test.ts similarity index 100% rename from tests/LSP23LinkedContractsDeployment/LSP23LinkedContractsDeployment.test.ts rename to packages/lsp-smart-contracts/tests/LSP23LinkedContractsDeployment/LSP23LinkedContractsDeployment.test.ts diff --git a/tests/LSP23LinkedContractsDeployment/helpers.ts b/packages/lsp-smart-contracts/tests/LSP23LinkedContractsDeployment/helpers.ts similarity index 100% rename from tests/LSP23LinkedContractsDeployment/helpers.ts rename to packages/lsp-smart-contracts/tests/LSP23LinkedContractsDeployment/helpers.ts diff --git a/tests/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour.ts similarity index 100% rename from tests/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP4DigitalAssetMetadata/LSP4DigitalAssetMetadata.behaviour.ts diff --git a/tests/LSP6KeyManager/Admin/PermissionChangeAddExtensions.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Admin/PermissionChangeAddExtensions.test.ts similarity index 100% rename from tests/LSP6KeyManager/Admin/PermissionChangeAddExtensions.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Admin/PermissionChangeAddExtensions.test.ts diff --git a/tests/LSP6KeyManager/Admin/PermissionChangeAddURD.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Admin/PermissionChangeAddURD.test.ts similarity index 100% rename from tests/LSP6KeyManager/Admin/PermissionChangeAddURD.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Admin/PermissionChangeAddURD.test.ts diff --git a/tests/LSP6KeyManager/Admin/PermissionChangeOwner.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Admin/PermissionChangeOwner.test.ts similarity index 100% rename from tests/LSP6KeyManager/Admin/PermissionChangeOwner.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Admin/PermissionChangeOwner.test.ts diff --git a/tests/LSP6KeyManager/Admin/PermissionSign.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Admin/PermissionSign.test.ts similarity index 100% rename from tests/LSP6KeyManager/Admin/PermissionSign.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Admin/PermissionSign.test.ts diff --git a/tests/LSP6KeyManager/Interactions/AllowedAddresses.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/AllowedAddresses.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/AllowedAddresses.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/AllowedAddresses.test.ts diff --git a/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/AllowedFunctions.test.ts diff --git a/tests/LSP6KeyManager/Interactions/AllowedStandards.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/AllowedStandards.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/AllowedStandards.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/AllowedStandards.test.ts diff --git a/tests/LSP6KeyManager/Interactions/BatchExecute.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/BatchExecute.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/BatchExecute.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/BatchExecute.test.ts diff --git a/tests/LSP6KeyManager/Interactions/InvalidExecutePayloads.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/InvalidExecutePayloads.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/InvalidExecutePayloads.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/InvalidExecutePayloads.test.ts diff --git a/tests/LSP6KeyManager/Interactions/PermissionCall.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionCall.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/PermissionCall.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionCall.test.ts diff --git a/tests/LSP6KeyManager/Interactions/PermissionDelegateCall.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionDelegateCall.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/PermissionDelegateCall.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionDelegateCall.test.ts diff --git a/tests/LSP6KeyManager/Interactions/PermissionDeploy.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionDeploy.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/PermissionDeploy.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionDeploy.test.ts diff --git a/tests/LSP6KeyManager/Interactions/PermissionStaticCall.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionStaticCall.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/PermissionStaticCall.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionStaticCall.test.ts diff --git a/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts similarity index 100% rename from tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts diff --git a/tests/LSP6KeyManager/LSP6ControlledToken.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6ControlledToken.test.ts similarity index 100% rename from tests/LSP6KeyManager/LSP6ControlledToken.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6ControlledToken.test.ts diff --git a/tests/LSP6KeyManager/LSP6KeyManager.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6KeyManager.behaviour.ts similarity index 100% rename from tests/LSP6KeyManager/LSP6KeyManager.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6KeyManager.behaviour.ts diff --git a/tests/LSP6KeyManager/LSP6KeyManager.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6KeyManager.test.ts similarity index 100% rename from tests/LSP6KeyManager/LSP6KeyManager.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6KeyManager.test.ts diff --git a/tests/LSP6KeyManager/LSP6KeyManagerInit.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6KeyManagerInit.test.ts similarity index 100% rename from tests/LSP6KeyManager/LSP6KeyManagerInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/LSP6KeyManagerInit.test.ts diff --git a/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts similarity index 100% rename from tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Relay/ExecuteRelayCall.test.ts diff --git a/tests/LSP6KeyManager/Relay/MultiChannelNonce.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/Relay/MultiChannelNonce.test.ts similarity index 100% rename from tests/LSP6KeyManager/Relay/MultiChannelNonce.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/Relay/MultiChannelNonce.test.ts diff --git a/tests/LSP6KeyManager/SetData/AllowedERC725YDataKeys.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/SetData/AllowedERC725YDataKeys.test.ts similarity index 100% rename from tests/LSP6KeyManager/SetData/AllowedERC725YDataKeys.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/SetData/AllowedERC725YDataKeys.test.ts diff --git a/tests/LSP6KeyManager/SetData/PermissionSetData.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/SetData/PermissionSetData.test.ts similarity index 100% rename from tests/LSP6KeyManager/SetData/PermissionSetData.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/SetData/PermissionSetData.test.ts diff --git a/tests/LSP6KeyManager/SetPermissions/PermissionChangeAddController.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/SetPermissions/PermissionChangeAddController.test.ts similarity index 100% rename from tests/LSP6KeyManager/SetPermissions/PermissionChangeAddController.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/SetPermissions/PermissionChangeAddController.test.ts diff --git a/tests/LSP6KeyManager/SetPermissions/SetAllowedCalls.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/SetPermissions/SetAllowedCalls.test.ts similarity index 100% rename from tests/LSP6KeyManager/SetPermissions/SetAllowedCalls.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/SetPermissions/SetAllowedCalls.test.ts diff --git a/tests/LSP6KeyManager/SetPermissions/SetAllowedERC725YDataKeys.test.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/SetPermissions/SetAllowedERC725YDataKeys.test.ts similarity index 100% rename from tests/LSP6KeyManager/SetPermissions/SetAllowedERC725YDataKeys.test.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/SetPermissions/SetAllowedERC725YDataKeys.test.ts diff --git a/tests/LSP6KeyManager/index.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/index.ts similarity index 100% rename from tests/LSP6KeyManager/index.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/index.ts diff --git a/tests/LSP6KeyManager/internals/AllowedCalls.internal.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/AllowedCalls.internal.ts similarity index 100% rename from tests/LSP6KeyManager/internals/AllowedCalls.internal.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/AllowedCalls.internal.ts diff --git a/tests/LSP6KeyManager/internals/AllowedERC725YDataKeys.internal.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/AllowedERC725YDataKeys.internal.ts similarity index 100% rename from tests/LSP6KeyManager/internals/AllowedERC725YDataKeys.internal.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/AllowedERC725YDataKeys.internal.ts diff --git a/tests/LSP6KeyManager/internals/Execute.internal.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/Execute.internal.ts similarity index 100% rename from tests/LSP6KeyManager/internals/Execute.internal.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/Execute.internal.ts diff --git a/tests/LSP6KeyManager/internals/ReadPermissions.internal.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/ReadPermissions.internal.ts similarity index 100% rename from tests/LSP6KeyManager/internals/ReadPermissions.internal.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/ReadPermissions.internal.ts diff --git a/tests/LSP6KeyManager/internals/SetData.internal.ts b/packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/SetData.internal.ts similarity index 100% rename from tests/LSP6KeyManager/internals/SetData.internal.ts rename to packages/lsp-smart-contracts/tests/LSP6KeyManager/internals/SetData.internal.ts diff --git a/tests/LSP7DigitalAsset/LSP7CappedSupply.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/LSP7CappedSupply.behaviour.ts similarity index 100% rename from tests/LSP7DigitalAsset/LSP7CappedSupply.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/LSP7CappedSupply.behaviour.ts diff --git a/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts similarity index 100% rename from tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/LSP7DigitalAsset.behaviour.ts diff --git a/tests/LSP7DigitalAsset/LSP7Mintable.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/LSP7Mintable.behaviour.ts similarity index 100% rename from tests/LSP7DigitalAsset/LSP7Mintable.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/LSP7Mintable.behaviour.ts diff --git a/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts similarity index 100% rename from tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/proxy/LSP7CappedSupplyInit.test.ts diff --git a/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts similarity index 100% rename from tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/proxy/LSP7DigitalAssetInit.test.ts diff --git a/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts similarity index 100% rename from tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/proxy/LSP7MintableInit.test.ts diff --git a/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts similarity index 100% rename from tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/standard/LSP7CappedSupply.test.ts diff --git a/tests/LSP7DigitalAsset/standard/LSP7DigitalAsset.test.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/standard/LSP7DigitalAsset.test.ts similarity index 100% rename from tests/LSP7DigitalAsset/standard/LSP7DigitalAsset.test.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/standard/LSP7DigitalAsset.test.ts diff --git a/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts b/packages/lsp-smart-contracts/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts similarity index 100% rename from tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts rename to packages/lsp-smart-contracts/tests/LSP7DigitalAsset/standard/LSP7Mintable.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/LSP8CappedSupply.behaviour.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/LSP8Enumerable.behaviour.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset.behaviour.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/LSP8Mintable.behaviour.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8BurnableInit.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8CappedSupplyInit.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8EnumerableInit.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8IdentifiableDigitalAssetInit.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/proxy/LSP8MintableInit.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Burnable.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8CappedSupply.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Enumerable.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8IdentifiableDigitalAsset.test.ts diff --git a/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts b/packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts similarity index 100% rename from tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts rename to packages/lsp-smart-contracts/tests/LSP8IdentifiableDigitalAsset/standard/LSP8Mintable.test.ts diff --git a/tests/LSP9Vault/LSP9Vault.behaviour.ts b/packages/lsp-smart-contracts/tests/LSP9Vault/LSP9Vault.behaviour.ts similarity index 100% rename from tests/LSP9Vault/LSP9Vault.behaviour.ts rename to packages/lsp-smart-contracts/tests/LSP9Vault/LSP9Vault.behaviour.ts diff --git a/tests/LSP9Vault/LSP9Vault.test.ts b/packages/lsp-smart-contracts/tests/LSP9Vault/LSP9Vault.test.ts similarity index 100% rename from tests/LSP9Vault/LSP9Vault.test.ts rename to packages/lsp-smart-contracts/tests/LSP9Vault/LSP9Vault.test.ts diff --git a/tests/LSP9Vault/LSP9VaultInit.test.ts b/packages/lsp-smart-contracts/tests/LSP9Vault/LSP9VaultInit.test.ts similarity index 100% rename from tests/LSP9Vault/LSP9VaultInit.test.ts rename to packages/lsp-smart-contracts/tests/LSP9Vault/LSP9VaultInit.test.ts diff --git a/tests/Mocks/ABIEncoder.test.ts b/packages/lsp-smart-contracts/tests/Mocks/ABIEncoder.test.ts similarity index 100% rename from tests/Mocks/ABIEncoder.test.ts rename to packages/lsp-smart-contracts/tests/Mocks/ABIEncoder.test.ts diff --git a/tests/Mocks/ERC165Interfaces.test.ts b/packages/lsp-smart-contracts/tests/Mocks/ERC165Interfaces.test.ts similarity index 100% rename from tests/Mocks/ERC165Interfaces.test.ts rename to packages/lsp-smart-contracts/tests/Mocks/ERC165Interfaces.test.ts diff --git a/tests/Mocks/KeyManagerExecutionCosts.test.ts b/packages/lsp-smart-contracts/tests/Mocks/KeyManagerExecutionCosts.test.ts similarity index 100% rename from tests/Mocks/KeyManagerExecutionCosts.test.ts rename to packages/lsp-smart-contracts/tests/Mocks/KeyManagerExecutionCosts.test.ts diff --git a/tests/Mocks/LSP1TypeIDs.test.ts b/packages/lsp-smart-contracts/tests/Mocks/LSP1TypeIDs.test.ts similarity index 100% rename from tests/Mocks/LSP1TypeIDs.test.ts rename to packages/lsp-smart-contracts/tests/Mocks/LSP1TypeIDs.test.ts diff --git a/tests/README.md b/packages/lsp-smart-contracts/tests/README.md similarity index 100% rename from tests/README.md rename to packages/lsp-smart-contracts/tests/README.md diff --git a/tests/Reentrancy/LSP20/ERC725XBatchExecuteToERC725XExecute.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XBatchExecuteToERC725XExecute.test.ts similarity index 100% rename from tests/Reentrancy/LSP20/ERC725XBatchExecuteToERC725XExecute.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XBatchExecuteToERC725XExecute.test.ts diff --git a/tests/Reentrancy/LSP20/ERC725XExecuteToERC725XBatchExecute.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XExecuteToERC725XBatchExecute.test.ts similarity index 100% rename from tests/Reentrancy/LSP20/ERC725XExecuteToERC725XBatchExecute.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XExecuteToERC725XBatchExecute.test.ts diff --git a/tests/Reentrancy/LSP20/ERC725XExecuteToERC725XExecute.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XExecuteToERC725XExecute.test.ts similarity index 100% rename from tests/Reentrancy/LSP20/ERC725XExecuteToERC725XExecute.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XExecuteToERC725XExecute.test.ts diff --git a/tests/Reentrancy/LSP20/ERC725XExecuteToLSP6BatchExecuteRelayCall.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XExecuteToLSP6BatchExecuteRelayCall.test.ts similarity index 100% rename from tests/Reentrancy/LSP20/ERC725XExecuteToLSP6BatchExecuteRelayCall.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XExecuteToLSP6BatchExecuteRelayCall.test.ts diff --git a/tests/Reentrancy/LSP20/ERC725XExecuteToLSP6ExecuteRelayCall.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XExecuteToLSP6ExecuteRelayCall.test.ts similarity index 100% rename from tests/Reentrancy/LSP20/ERC725XExecuteToLSP6ExecuteRelayCall.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP20/ERC725XExecuteToLSP6ExecuteRelayCall.test.ts diff --git a/tests/Reentrancy/LSP20/LSP20WithLSP6Reentrancy.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP20/LSP20WithLSP6Reentrancy.test.ts similarity index 100% rename from tests/Reentrancy/LSP20/LSP20WithLSP6Reentrancy.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP20/LSP20WithLSP6Reentrancy.test.ts diff --git a/tests/Reentrancy/LSP20/reentrancyHelpers.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP20/reentrancyHelpers.ts similarity index 100% rename from tests/Reentrancy/LSP20/reentrancyHelpers.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP20/reentrancyHelpers.ts diff --git a/tests/Reentrancy/LSP6/LSP6Reentrancy.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/LSP6Reentrancy.test.ts similarity index 100% rename from tests/Reentrancy/LSP6/LSP6Reentrancy.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP6/LSP6Reentrancy.test.ts diff --git a/tests/Reentrancy/LSP6/SingleExecuteRelayCallToSingleExecute.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteRelayCallToSingleExecute.test.ts similarity index 100% rename from tests/Reentrancy/LSP6/SingleExecuteRelayCallToSingleExecute.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteRelayCallToSingleExecute.test.ts diff --git a/tests/Reentrancy/LSP6/SingleExecuteRelayCallToSingleExecuteRelayCall.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteRelayCallToSingleExecuteRelayCall.test.ts similarity index 100% rename from tests/Reentrancy/LSP6/SingleExecuteRelayCallToSingleExecuteRelayCall.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteRelayCallToSingleExecuteRelayCall.test.ts diff --git a/tests/Reentrancy/LSP6/SingleExecuteToBatchExecute.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToBatchExecute.test.ts similarity index 100% rename from tests/Reentrancy/LSP6/SingleExecuteToBatchExecute.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToBatchExecute.test.ts diff --git a/tests/Reentrancy/LSP6/SingleExecuteToBatchExecuteRelayCall.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToBatchExecuteRelayCall.test.ts similarity index 100% rename from tests/Reentrancy/LSP6/SingleExecuteToBatchExecuteRelayCall.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToBatchExecuteRelayCall.test.ts diff --git a/tests/Reentrancy/LSP6/SingleExecuteToSingleExecute.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToSingleExecute.test.ts similarity index 100% rename from tests/Reentrancy/LSP6/SingleExecuteToSingleExecute.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToSingleExecute.test.ts diff --git a/tests/Reentrancy/LSP6/SingleExecuteToSingleExecuteRelayCall.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToSingleExecuteRelayCall.test.ts similarity index 97% rename from tests/Reentrancy/LSP6/SingleExecuteToSingleExecuteRelayCall.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToSingleExecuteRelayCall.test.ts index 51c51ee03..e00f21456 100644 --- a/tests/Reentrancy/LSP6/SingleExecuteToSingleExecuteRelayCall.test.ts +++ b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/SingleExecuteToSingleExecuteRelayCall.test.ts @@ -1,7 +1,8 @@ import { expect } from 'chai'; +import { ethers } from 'hardhat'; // types -import { BytesLike, hexlify, keccak256, parseEther, toUtf8Bytes } from 'ethers'; +import { BytesLike } from 'ethers'; import { SingleReentrancyRelayer__factory, UniversalProfile__factory } from '../../../types'; // constants @@ -36,7 +37,7 @@ export const testSingleExecuteToSingleExecuteRelayCall = ( let executePayload: BytesLike; before(async () => { - context = await buildContext(parseEther('10')); + context = await buildContext(ethers.parseEther('10')); reentrancyContext = await buildReentrancyContext(context); const reentrantCallPayload = @@ -108,18 +109,18 @@ export const testSingleExecuteToSingleExecuteRelayCall = ( ); expect(await provider.getBalance(await context.universalProfile.getAddress())).to.equal( - parseEther('10'), + ethers.parseEther('10'), ); await context.keyManager.connect(reentrancyContext.caller).execute(executePayload); expect(await provider.getBalance(await context.universalProfile.getAddress())).to.equal( - parseEther('9'), + ethers.parseEther('9'), ); expect( await provider.getBalance(await reentrancyContext.singleReentarncyRelayer.getAddress()), - ).to.equal(parseEther('1')); + ).to.equal(ethers.parseEther('1')); }); }); @@ -181,8 +182,8 @@ export const testSingleExecuteToSingleExecuteRelayCall = ( await context.keyManager.connect(reentrancyContext.caller).execute(executePayload); - const hardcodedKey = keccak256(toUtf8Bytes('SomeRandomTextUsed')); - const hardcodedValue = hexlify(toUtf8Bytes('SomeRandomTextUsed')); + const hardcodedKey = ethers.keccak256(ethers.toUtf8Bytes('SomeRandomTextUsed')); + const hardcodedValue = ethers.hexlify(ethers.toUtf8Bytes('SomeRandomTextUsed')); expect(await context.universalProfile.getData(hardcodedKey)).to.equal(hardcodedValue); }); diff --git a/tests/Reentrancy/LSP6/reentrancyHelpers.ts b/packages/lsp-smart-contracts/tests/Reentrancy/LSP6/reentrancyHelpers.ts similarity index 100% rename from tests/Reentrancy/LSP6/reentrancyHelpers.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/LSP6/reentrancyHelpers.ts diff --git a/tests/Reentrancy/Reentrancy.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/Reentrancy.test.ts similarity index 100% rename from tests/Reentrancy/Reentrancy.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/Reentrancy.test.ts diff --git a/tests/Reentrancy/ReentrancyInit.test.ts b/packages/lsp-smart-contracts/tests/Reentrancy/ReentrancyInit.test.ts similarity index 100% rename from tests/Reentrancy/ReentrancyInit.test.ts rename to packages/lsp-smart-contracts/tests/Reentrancy/ReentrancyInit.test.ts diff --git a/tests/UniversalProfile.behaviour.ts b/packages/lsp-smart-contracts/tests/UniversalProfile.behaviour.ts similarity index 99% rename from tests/UniversalProfile.behaviour.ts rename to packages/lsp-smart-contracts/tests/UniversalProfile.behaviour.ts index 68fac6049..6af61f8f8 100644 --- a/tests/UniversalProfile.behaviour.ts +++ b/packages/lsp-smart-contracts/tests/UniversalProfile.behaviour.ts @@ -13,7 +13,7 @@ import { OwnerWithURD__factory, OwnerWithURD, UniversalProfile, -} from '../types'; +} from '../../../types'; // helpers import { LSP1_HOOK_PLACEHOLDER, abiCoder, getRandomAddresses } from './utils/helpers'; diff --git a/tests/UniversalProfile.test.ts b/packages/lsp-smart-contracts/tests/UniversalProfile.test.ts similarity index 99% rename from tests/UniversalProfile.test.ts rename to packages/lsp-smart-contracts/tests/UniversalProfile.test.ts index 29740d457..6c9e3c52d 100644 --- a/tests/UniversalProfile.test.ts +++ b/packages/lsp-smart-contracts/tests/UniversalProfile.test.ts @@ -1,6 +1,6 @@ import { ethers } from 'hardhat'; import { expect } from 'chai'; -import { UniversalReceiverTester__factory, UniversalProfile__factory } from '../types'; +import { UniversalReceiverTester__factory, UniversalProfile__factory } from '../../../types'; import { LSP1TestContext, diff --git a/tests/UniversalProfileInit.test.ts b/packages/lsp-smart-contracts/tests/UniversalProfileInit.test.ts similarity index 99% rename from tests/UniversalProfileInit.test.ts rename to packages/lsp-smart-contracts/tests/UniversalProfileInit.test.ts index 774aa13ae..923054097 100644 --- a/tests/UniversalProfileInit.test.ts +++ b/packages/lsp-smart-contracts/tests/UniversalProfileInit.test.ts @@ -4,7 +4,7 @@ import { UniversalReceiverTester__factory, UniversalProfileInit__factory, LSP0ERC725Account, -} from '../types'; +} from '../../../types'; import { deployProxy } from './utils/fixtures'; import { diff --git a/tests/foundry/GasTests/LSP6s/LSP6ExecuteRC.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/LSP6s/LSP6ExecuteRC.sol similarity index 100% rename from tests/foundry/GasTests/LSP6s/LSP6ExecuteRC.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/LSP6s/LSP6ExecuteRC.sol diff --git a/tests/foundry/GasTests/LSP6s/LSP6ExecuteUC.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/LSP6s/LSP6ExecuteUC.sol similarity index 100% rename from tests/foundry/GasTests/LSP6s/LSP6ExecuteUC.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/LSP6s/LSP6ExecuteUC.sol diff --git a/tests/foundry/GasTests/LSP6s/LSP6SetDataRC.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/LSP6s/LSP6SetDataRC.sol similarity index 100% rename from tests/foundry/GasTests/LSP6s/LSP6SetDataRC.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/LSP6s/LSP6SetDataRC.sol diff --git a/tests/foundry/GasTests/LSP6s/LSP6SetDataUC.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/LSP6s/LSP6SetDataUC.sol similarity index 100% rename from tests/foundry/GasTests/LSP6s/LSP6SetDataUC.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/LSP6s/LSP6SetDataUC.sol diff --git a/tests/foundry/GasTests/UniversalProfileTestsHelper.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/UniversalProfileTestsHelper.sol similarity index 100% rename from tests/foundry/GasTests/UniversalProfileTestsHelper.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/UniversalProfileTestsHelper.sol diff --git a/tests/foundry/GasTests/execute/RestrictedController.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/execute/RestrictedController.sol similarity index 100% rename from tests/foundry/GasTests/execute/RestrictedController.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/execute/RestrictedController.sol diff --git a/tests/foundry/GasTests/execute/UnrestrictedController.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/execute/UnrestrictedController.sol similarity index 100% rename from tests/foundry/GasTests/execute/UnrestrictedController.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/execute/UnrestrictedController.sol diff --git a/tests/foundry/GasTests/setData/RestrictedController.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/setData/RestrictedController.sol similarity index 100% rename from tests/foundry/GasTests/setData/RestrictedController.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/setData/RestrictedController.sol diff --git a/tests/foundry/GasTests/setData/UnrestrictedController.sol b/packages/lsp-smart-contracts/tests/foundry/GasTests/setData/UnrestrictedController.sol similarity index 100% rename from tests/foundry/GasTests/setData/UnrestrictedController.sol rename to packages/lsp-smart-contracts/tests/foundry/GasTests/setData/UnrestrictedController.sol diff --git a/tests/foundry/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.t.sol b/packages/lsp-smart-contracts/tests/foundry/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.t.sol similarity index 100% rename from tests/foundry/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.t.sol rename to packages/lsp-smart-contracts/tests/foundry/LSP11BasicSocialRecovery/LSP11BasicSocialRecovery.t.sol diff --git a/tests/foundry/LSP11BasicSocialRecovery/LSP11Mock.sol b/packages/lsp-smart-contracts/tests/foundry/LSP11BasicSocialRecovery/LSP11Mock.sol similarity index 100% rename from tests/foundry/LSP11BasicSocialRecovery/LSP11Mock.sol rename to packages/lsp-smart-contracts/tests/foundry/LSP11BasicSocialRecovery/LSP11Mock.sol diff --git a/tests/foundry/LSP14Ownable2Step/AcceptOwnershipCleanState.sol b/packages/lsp-smart-contracts/tests/foundry/LSP14Ownable2Step/AcceptOwnershipCleanState.sol similarity index 100% rename from tests/foundry/LSP14Ownable2Step/AcceptOwnershipCleanState.sol rename to packages/lsp-smart-contracts/tests/foundry/LSP14Ownable2Step/AcceptOwnershipCleanState.sol diff --git a/tests/foundry/LSP14Ownable2Step/TwoStepOwnership.sol b/packages/lsp-smart-contracts/tests/foundry/LSP14Ownable2Step/TwoStepOwnership.sol similarity index 100% rename from tests/foundry/LSP14Ownable2Step/TwoStepOwnership.sol rename to packages/lsp-smart-contracts/tests/foundry/LSP14Ownable2Step/TwoStepOwnership.sol diff --git a/tests/foundry/LSP14Ownable2Step/TwoStepRenounceOwnership.sol b/packages/lsp-smart-contracts/tests/foundry/LSP14Ownable2Step/TwoStepRenounceOwnership.sol similarity index 100% rename from tests/foundry/LSP14Ownable2Step/TwoStepRenounceOwnership.sol rename to packages/lsp-smart-contracts/tests/foundry/LSP14Ownable2Step/TwoStepRenounceOwnership.sol diff --git a/tests/foundry/LSP6KeyManager/LSP6RestrictedController.t.sol b/packages/lsp-smart-contracts/tests/foundry/LSP6KeyManager/LSP6RestrictedController.t.sol similarity index 100% rename from tests/foundry/LSP6KeyManager/LSP6RestrictedController.t.sol rename to packages/lsp-smart-contracts/tests/foundry/LSP6KeyManager/LSP6RestrictedController.t.sol diff --git a/tests/utils/context.ts b/packages/lsp-smart-contracts/tests/utils/context.ts similarity index 100% rename from tests/utils/context.ts rename to packages/lsp-smart-contracts/tests/utils/context.ts diff --git a/tests/utils/fixtures.ts b/packages/lsp-smart-contracts/tests/utils/fixtures.ts similarity index 99% rename from tests/utils/fixtures.ts rename to packages/lsp-smart-contracts/tests/utils/fixtures.ts index 165bab036..bd3cf2f05 100644 --- a/tests/utils/fixtures.ts +++ b/packages/lsp-smart-contracts/tests/utils/fixtures.ts @@ -12,7 +12,7 @@ import { ERC725YDataKeys } from '../../constants'; import { PERMISSIONS, ALL_PERMISSIONS } from '@lukso/lsp6-contracts'; // helpers -import { combinePermissions } from '../utils/helpers'; +import { combinePermissions } from './helpers'; import { LSP6TestContext, LSP6InternalsTestContext } from './context'; /** diff --git a/tests/utils/helpers.ts b/packages/lsp-smart-contracts/tests/utils/helpers.ts similarity index 82% rename from tests/utils/helpers.ts rename to packages/lsp-smart-contracts/tests/utils/helpers.ts index 56597a2a7..bdcbc3fc2 100644 --- a/tests/utils/helpers.ts +++ b/packages/lsp-smart-contracts/tests/utils/helpers.ts @@ -1,26 +1,14 @@ -import { - BytesLike, - AbiCoder, - Wallet, - toBigInt, - zeroPadValue, - toBeHex, - getNumber, - concat, - solidityPacked, -} from 'ethers'; +import { BytesLike } from 'ethers'; import hre from 'hardhat'; -const { - ethers: { provider: hreProvider }, -} = hre; +const { ethers } = hre; import { LSP6KeyManager } from '../../types/index.js'; // constants import { LSP25_VERSION } from '@lukso/lsp25-contracts'; import { EIP191Signer } from '@lukso/eip191-signer.js'; -export const abiCoder = AbiCoder.defaultAbiCoder(); -export const provider = hreProvider; +export const abiCoder = ethers.AbiCoder.defaultAbiCoder(); +export const provider = ethers.provider; export const AddressOffset = '000000000000000000000000'; export const EMPTY_PAYLOAD = '0x'; @@ -65,7 +53,7 @@ export function getRandomAddresses(count: number): string[] { for (let ii = 0; ii < count; ii++) { // addresses stored under ERC725Y storage have always lowercases character. // therefore, disable the checksum by converting to lowercase to avoid failing tests - const randomAddress = Wallet.createRandom().address.toLowerCase(); + const randomAddress = ethers.Wallet.createRandom().address.toLowerCase(); addresses.push(randomAddress); } @@ -73,33 +61,34 @@ export function getRandomAddresses(count: number): string[] { } export function combinePermissions(..._permissions: string[]) { - let result: bigint = toBigInt(0); + let result: bigint = ethers.toBigInt(0); _permissions.forEach((permission) => { - const permissionAsBN = toBigInt(permission); + const permissionAsBN = ethers.toBigInt(permission); result = result | permissionAsBN; }); - return zeroPadValue(toBeHex(result), 32); + return ethers.zeroPadValue(ethers.toBeHex(result), 32); } export function combineCallTypes(..._callTypes: string[]) { - let result: bigint = toBigInt(0); + let result: bigint = ethers.toBigInt(0); _callTypes.forEach((callType) => { - const callTypeAsBN = toBigInt(callType); + const callTypeAsBN = ethers.toBigInt(callType); result = result | callTypeAsBN; }); - return zeroPadValue(toBeHex(result), 4); + return ethers.zeroPadValue(ethers.toBeHex(result), 4); } export function encodeCompactBytesArray(inputKeys: BytesLike[]) { let compactBytesArray = '0x'; for (let i = 0; i < inputKeys.length; i++) { compactBytesArray += - zeroPadValue(toBeHex(inputKeys[i].toString().substring(2).length / 2), 2).substring(2) + - inputKeys[i].toString().substring(2); + ethers + .zeroPadValue(ethers.toBeHex(inputKeys[i].toString().substring(2).length / 2), 2) + .substring(2) + inputKeys[i].toString().substring(2); } return compactBytesArray; @@ -109,7 +98,9 @@ export function decodeCompactBytes(compactBytesArray: BytesLike) { let pointer = 2; const keysToExport: BytesLike[] = []; while (pointer < compactBytesArray.length) { - const length = getNumber('0x' + compactBytesArray.toString().substring(pointer, pointer + 4)); + const length = ethers.getNumber( + '0x' + compactBytesArray.toString().substring(pointer, pointer + 4), + ); keysToExport.push( '0x' + compactBytesArray.toString().substring(pointer + 4, pointer + 2 * (length + 2)), ); @@ -148,11 +139,11 @@ export function createValidityTimestamps( startingTimestamp: number, endingTimestamp: number, ): bigint { - const concatenatedHex = concat([ - zeroPadValue(toBeHex(startingTimestamp), 16), - zeroPadValue(toBeHex(endingTimestamp), 16), + const concatenatedHex = ethers.concat([ + ethers.zeroPadValue(ethers.toBeHex(startingTimestamp), 16), + ethers.zeroPadValue(ethers.toBeHex(endingTimestamp), 16), ]); - return toBigInt(concatenatedHex); + return ethers.toBigInt(concatenatedHex); } export async function signLSP6ExecuteRelayCall( @@ -172,7 +163,7 @@ export async function signLSP6ExecuteRelayCall( payload: _payload, }; - const encodedMessage = solidityPacked( + const encodedMessage = ethers.solidityPacked( ['uint256', 'uint256', 'uint256', 'uint256', 'uint256', 'bytes'], [ signedMessageParams.lsp25Version, diff --git a/tests/utils/tokens.ts b/packages/lsp-smart-contracts/tests/utils/tokens.ts similarity index 100% rename from tests/utils/tokens.ts rename to packages/lsp-smart-contracts/tests/utils/tokens.ts diff --git a/packages/lsp-smart-contracts/tsconfig.json b/packages/lsp-smart-contracts/tsconfig.json new file mode 100644 index 000000000..b7a34e03f --- /dev/null +++ b/packages/lsp-smart-contracts/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "tsconfig/contracts.json", + "include": ["**/*.ts"] +} diff --git a/packages/lsp0-contracts/hardhat.config.ts b/packages/lsp0-contracts/hardhat.config.ts index 722f3e905..3abbdc450 100644 --- a/packages/lsp0-contracts/hardhat.config.ts +++ b/packages/lsp0-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp0-contracts/package.json b/packages/lsp0-contracts/package.json index caca29e11..869cc3215 100644 --- a/packages/lsp0-contracts/package.json +++ b/packages/lsp0-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp1-contracts/hardhat.config.ts b/packages/lsp1-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100755 --- a/packages/lsp1-contracts/hardhat.config.ts +++ b/packages/lsp1-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp1-contracts/package.json b/packages/lsp1-contracts/package.json index 18c720197..0ca6fb3c7 100644 --- a/packages/lsp1-contracts/package.json +++ b/packages/lsp1-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp10-contracts/hardhat.config.ts b/packages/lsp10-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100755 --- a/packages/lsp10-contracts/hardhat.config.ts +++ b/packages/lsp10-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp10-contracts/package.json b/packages/lsp10-contracts/package.json index 2b356faf0..cc8814eae 100644 --- a/packages/lsp10-contracts/package.json +++ b/packages/lsp10-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp12-contracts/hardhat.config.ts b/packages/lsp12-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp12-contracts/hardhat.config.ts +++ b/packages/lsp12-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp12-contracts/package.json b/packages/lsp12-contracts/package.json index af9225f51..c5789dce9 100644 --- a/packages/lsp12-contracts/package.json +++ b/packages/lsp12-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp14-contracts/hardhat.config.ts b/packages/lsp14-contracts/hardhat.config.ts index 4e12de17e..0dbbcd62d 100755 --- a/packages/lsp14-contracts/hardhat.config.ts +++ b/packages/lsp14-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp14-contracts/package.json b/packages/lsp14-contracts/package.json index 1ec3ba564..8f0e27a44 100644 --- a/packages/lsp14-contracts/package.json +++ b/packages/lsp14-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp16-contracts/contracts/Mock/Account.sol b/packages/lsp16-contracts/contracts/Mocks/Account.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/Account.sol rename to packages/lsp16-contracts/contracts/Mocks/Account.sol diff --git a/packages/lsp16-contracts/contracts/Mock/AccountInit.sol b/packages/lsp16-contracts/contracts/Mocks/AccountInit.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/AccountInit.sol rename to packages/lsp16-contracts/contracts/Mocks/AccountInit.sol diff --git a/packages/lsp16-contracts/contracts/Mock/ContractNoConstructor.sol b/packages/lsp16-contracts/contracts/Mocks/ContractNoConstructor.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/ContractNoConstructor.sol rename to packages/lsp16-contracts/contracts/Mocks/ContractNoConstructor.sol diff --git a/packages/lsp16-contracts/contracts/Mock/FallbackContract.sol b/packages/lsp16-contracts/contracts/Mocks/FallbackContract.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/FallbackContract.sol rename to packages/lsp16-contracts/contracts/Mocks/FallbackContract.sol diff --git a/packages/lsp16-contracts/contracts/Mock/FallbackInitializer.sol b/packages/lsp16-contracts/contracts/Mocks/FallbackInitializer.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/FallbackInitializer.sol rename to packages/lsp16-contracts/contracts/Mocks/FallbackInitializer.sol diff --git a/packages/lsp16-contracts/contracts/Mock/ImplementationTester.sol b/packages/lsp16-contracts/contracts/Mocks/ImplementationTester.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/ImplementationTester.sol rename to packages/lsp16-contracts/contracts/Mocks/ImplementationTester.sol diff --git a/packages/lsp16-contracts/contracts/Mock/NonPayableContract.sol b/packages/lsp16-contracts/contracts/Mocks/NonPayableContract.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/NonPayableContract.sol rename to packages/lsp16-contracts/contracts/Mocks/NonPayableContract.sol diff --git a/packages/lsp16-contracts/contracts/Mock/NonPayableFallback.sol b/packages/lsp16-contracts/contracts/Mocks/NonPayableFallback.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/NonPayableFallback.sol rename to packages/lsp16-contracts/contracts/Mocks/NonPayableFallback.sol diff --git a/packages/lsp16-contracts/contracts/Mock/PayableContract.sol b/packages/lsp16-contracts/contracts/Mocks/PayableContract.sol similarity index 100% rename from packages/lsp16-contracts/contracts/Mock/PayableContract.sol rename to packages/lsp16-contracts/contracts/Mocks/PayableContract.sol diff --git a/packages/lsp16-contracts/hardhat.config.ts b/packages/lsp16-contracts/hardhat.config.ts index 6a0df5c2a..4dd6b3a54 100644 --- a/packages/lsp16-contracts/hardhat.config.ts +++ b/packages/lsp16-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp16-contracts/package.json b/packages/lsp16-contracts/package.json index c5bedc821..aa449a17f 100644 --- a/packages/lsp16-contracts/package.json +++ b/packages/lsp16-contracts/package.json @@ -34,12 +34,13 @@ ], "scripts": { "build": "hardhat compile --show-stack-traces", - "clean": "hardhat clean", + "build:foundry": "forge build", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'", "test": "hardhat test --no-compile tests/*.test.ts", - "test:foundry": "forge test --no-match-test Skip -vvv", + "test:foundry": "FOUNDRY_PROFILE=lsp16 forge test --no-match-test Skip -vvv", "test:coverage": "hardhat coverage" }, "dependencies": { diff --git a/packages/lsp16-contracts/tests/LSP16UniversalFactory.test.ts b/packages/lsp16-contracts/tests/LSP16UniversalFactory.test.ts index 7195284ba..67bb9293b 100644 --- a/packages/lsp16-contracts/tests/LSP16UniversalFactory.test.ts +++ b/packages/lsp16-contracts/tests/LSP16UniversalFactory.test.ts @@ -23,10 +23,10 @@ import { FallbackContract__factory, } from '../types'; -import web3 from 'web3'; - -import { provider, AddressOffset } from '../../../tests/utils/helpers'; import { UniversalProfile } from '../../../types'; +import { AbiCoder, concat } from 'ethers'; + +const abiCoder = new AbiCoder(); const AccountBytecode = Account__factory.bytecode; const NonPayableConstructorBytecode = NonPayableContract__factory.bytecode; @@ -103,7 +103,10 @@ describe('UniversalFactory contract', () => { const randomAddress = ethers.Wallet.createRandom(); // Set the Owner as the ZeroAddress - const UPBytecode = AccountBytecode + AddressOffset + randomAddress.address.substring(2); + const UPBytecode = concat([ + AccountBytecode, + abiCoder.encode(['address'], [randomAddress.address]), + ]); const bytecodeHash = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode]); @@ -126,7 +129,10 @@ describe('UniversalFactory contract', () => { const randomAddress = ethers.Wallet.createRandom(); - const UPBytecode = AccountBytecode + AddressOffset + randomAddress.address.substr(2); + const UPBytecode = concat([ + AccountBytecode, + abiCoder.encode(['address'], [randomAddress.address]), + ]); const bytecodeHash = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode]); @@ -152,8 +158,13 @@ describe('UniversalFactory contract', () => { it('should calculate a different address of a contract if the salt changed', async () => { const salt1 = ethers.solidityPackedKeccak256(['string'], ['Salt1']); const salt2 = ethers.solidityPackedKeccak256(['string'], ['Salt2']); + const salt1 = ethers.solidityPackedKeccak256(['string'], ['Salt1']); + const salt2 = ethers.solidityPackedKeccak256(['string'], ['Salt2']); - const UPBytecode = AccountBytecode + AddressOffset + ethers.ZeroAddress.substr(2); + const UPBytecode = concat([ + AccountBytecode, + abiCoder.encode(['address'], [ethers.ZeroAddress]), + ]); const bytecodeHash = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode]); @@ -178,13 +189,19 @@ describe('UniversalFactory contract', () => { it('should calculate a different address of a contract if the bytecode changed', async () => { const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); + const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); - const UPBytecode1 = AccountBytecode + AddressOffset + ethers.ZeroAddress.substr(2); + const UPBytecode1 = concat([ + AccountBytecode, + abiCoder.encode(['address'], [ethers.ZeroAddress]), + ]); const bytecodeHash1 = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode1]); - const UPBytecode2 = - AccountBytecode + AddressOffset + 'cafecafecafecafecafecafecafecafecafecafe'; + const UPBytecode2 = concat([ + AccountBytecode, + abiCoder.encode(['address'], ['0xcafecafecafecafecafecafecafecafecafecafe']), + ]); const bytecodeHash2 = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode2]); @@ -212,7 +229,10 @@ describe('UniversalFactory contract', () => { const randomAddress = ethers.Wallet.createRandom(); - const UPBytecode = AccountBytecode + AddressOffset + randomAddress.address.substring(2); + const UPBytecode = concat([ + AccountBytecode, + abiCoder.encode(['address'], [randomAddress.address]), + ]); await context.universalFactory.deployCreate2(UPBytecode, salt); @@ -223,9 +243,12 @@ describe('UniversalFactory contract', () => { it('should revert when sending value while deploying a non payable non-initializable contract', async () => { const salt = ethers.solidityPackedKeccak256(['string'], ['OtherSalt']); + const salt = ethers.solidityPackedKeccak256(['string'], ['OtherSalt']); - const KMBytecode = - NonPayableConstructorBytecode + AddressOffset + ethers.ZeroAddress.substr(2); + const KMBytecode = concat([ + NonPayableConstructorBytecode, + abiCoder.encode(['address'], [ethers.ZeroAddress]), + ]); await expect( context.universalFactory.deployCreate2(KMBytecode, salt, { @@ -258,8 +281,10 @@ describe('UniversalFactory contract', () => { it('should deploy an un-initializable contract and get the owner successfully', async () => { const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); - const UPBytecode = - AccountBytecode + AddressOffset + context.accounts.deployer3.address.substr(2); + const UPBytecode = concat([ + AccountBytecode, + abiCoder.encode(['address'], [context.accounts.deployer3.address]), + ]); const contractCreatedAddress = await context.universalFactory.deployCreate2.staticCall( UPBytecode, @@ -317,8 +342,13 @@ describe('UniversalFactory contract', () => { it('should calculate a different address of a contract if the salt changed', async () => { const salt1 = ethers.solidityPackedKeccak256(['string'], ['Salt1']); const salt2 = ethers.solidityPackedKeccak256(['string'], ['Salt2']); + const salt1 = ethers.solidityPackedKeccak256(['string'], ['Salt1']); + const salt2 = ethers.solidityPackedKeccak256(['string'], ['Salt2']); - const UPBytecode = AccountBytecode + AddressOffset + ethers.ZeroAddress.substr(2); + const UPBytecode = concat([ + AccountBytecode, + abiCoder.encode(['address'], [ethers.ZeroAddress]), + ]); const bytecodeHash = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode]); @@ -347,8 +377,12 @@ describe('UniversalFactory contract', () => { it('should calculate a different address of a contract if the initializeCalldata changed', async () => { const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); + const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); - const UPBytecode = AccountBytecode + AddressOffset + ethers.ZeroAddress.substr(2); + const UPBytecode = concat([ + AccountBytecode, + abiCoder.encode(['address'], [ethers.ZeroAddress]), + ]); const bytecodeHash = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode]); @@ -378,8 +412,12 @@ describe('UniversalFactory contract', () => { it('should calculate a different address of a contract if the bytecode changed', async () => { const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); + const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); - const UPBytecode1 = AccountBytecode + AddressOffset + ethers.ZeroAddress.substr(2); + const UPBytecode1 = concat([ + AccountBytecode, + abiCoder.encode(['address'], [ethers.ZeroAddress]), + ]); const initializeCallData = accountBaseContract.interface.encodeFunctionData('initialize', [ context.accounts.deployer1.address, @@ -387,8 +425,10 @@ describe('UniversalFactory contract', () => { const bytecodeHash1 = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode1]); - const UPBytecode2 = - AccountBytecode + AddressOffset + 'cafecafecafecafecafecafecafecafecafecafe'; + const UPBytecode2 = concat([ + AccountBytecode, + abiCoder.encode(['address'], ['0xcafecafecafecafecafecafecafecafecafecafe']), + ]); const bytecodeHash2 = ethers.solidityPackedKeccak256(['bytes'], [UPBytecode2]); @@ -437,8 +477,12 @@ describe('UniversalFactory contract', () => { it('should revert when deploying an initializable contract with sending value unmatched to the msgValue arguments', async () => { const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); + const salt = ethers.solidityPackedKeccak256(['string'], ['Salt']); - const UPBytecode = AccountBytecode + AddressOffset + ethers.ZeroAddress.substr(2); + const UPBytecode = concat([ + AccountBytecode, + abiCoder.encode(['address'], [ethers.ZeroAddress]), + ]); const initializeCallData = accountBaseContract.interface.encodeFunctionData('initialize', [ context.accounts.deployer1.address, @@ -880,6 +924,7 @@ describe('UniversalFactory contract', () => { await context.universalFactory .connect(context.accounts.deployer1) + .deployERC1167ProxyAndInitialize(payableContract.target, salt, PayableTrueCalldata, { .deployERC1167ProxyAndInitialize(payableContract.target, salt, PayableTrueCalldata, { value: valueSent, }); diff --git a/packages/lsp17-contracts/hardhat.config.ts b/packages/lsp17-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp17-contracts/hardhat.config.ts +++ b/packages/lsp17-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp17-contracts/package.json b/packages/lsp17-contracts/package.json index 56fdb2c9c..3a0f12707 100644 --- a/packages/lsp17-contracts/package.json +++ b/packages/lsp17-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp17contractextension-contracts/hardhat.config.ts b/packages/lsp17contractextension-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp17contractextension-contracts/hardhat.config.ts +++ b/packages/lsp17contractextension-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp17contractextension-contracts/package.json b/packages/lsp17contractextension-contracts/package.json index 7f4960912..f3f3d2881 100644 --- a/packages/lsp17contractextension-contracts/package.json +++ b/packages/lsp17contractextension-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp1delegate-contracts/hardhat.config.ts b/packages/lsp1delegate-contracts/hardhat.config.ts index 515203eae..7135783f0 100644 --- a/packages/lsp1delegate-contracts/hardhat.config.ts +++ b/packages/lsp1delegate-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp1delegate-contracts/package.json b/packages/lsp1delegate-contracts/package.json index 99191dee9..4564089f3 100644 --- a/packages/lsp1delegate-contracts/package.json +++ b/packages/lsp1delegate-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp2-contracts/hardhat.config.ts b/packages/lsp2-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100755 --- a/packages/lsp2-contracts/hardhat.config.ts +++ b/packages/lsp2-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp2-contracts/package.json b/packages/lsp2-contracts/package.json index 2b878115b..003a1a37a 100644 --- a/packages/lsp2-contracts/package.json +++ b/packages/lsp2-contracts/package.json @@ -35,8 +35,9 @@ ], "scripts": { "build": "hardhat compile --show-stack-traces", + "build:foundry": "forge build", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'", diff --git a/packages/lsp2-contracts/tests/LSP2UtilsLibrary.test.ts b/packages/lsp2-contracts/tests/LSP2UtilsLibrary.test.ts index 3b93fd750..2920a232a 100644 --- a/packages/lsp2-contracts/tests/LSP2UtilsLibrary.test.ts +++ b/packages/lsp2-contracts/tests/LSP2UtilsLibrary.test.ts @@ -2,8 +2,19 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomicfoundation/hardhat-ethers/signers'; import { LSP2UtilsLibraryTester, LSP2UtilsLibraryTester__factory } from '../types'; - -import { encodeCompactBytesArray } from '../../../tests/utils/helpers'; +import { BytesLike } from 'ethers'; + +function encodeCompactBytesArray(inputKeys: BytesLike[]) { + let compactBytesArray = '0x'; + for (let i = 0; i < inputKeys.length; i++) { + compactBytesArray += + ethers + .zeroPadValue(ethers.toBeHex(inputKeys[i].toString().substring(2).length / 2), 2) + .substring(2) + inputKeys[i].toString().substring(2); + } + + return compactBytesArray; +} describe('LSP2Utils', () => { let accounts: SignerWithAddress[]; diff --git a/packages/lsp20-contracts/hardhat.config.ts b/packages/lsp20-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100755 --- a/packages/lsp20-contracts/hardhat.config.ts +++ b/packages/lsp20-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp20-contracts/package.json b/packages/lsp20-contracts/package.json index 1173a1add..142c4e133 100644 --- a/packages/lsp20-contracts/package.json +++ b/packages/lsp20-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp23-contracts/hardhat.config.ts b/packages/lsp23-contracts/hardhat.config.ts index 8377906b9..bd647b8b8 100644 --- a/packages/lsp23-contracts/hardhat.config.ts +++ b/packages/lsp23-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp23-contracts/package.json b/packages/lsp23-contracts/package.json index 13f0970cb..2d3fd283a 100644 --- a/packages/lsp23-contracts/package.json +++ b/packages/lsp23-contracts/package.json @@ -35,7 +35,7 @@ ], "scripts": { "build": "hardhat compile --show-stack-traces", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp25-contracts/hardhat.config.ts b/packages/lsp25-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp25-contracts/hardhat.config.ts +++ b/packages/lsp25-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp25-contracts/package.json b/packages/lsp25-contracts/package.json index db329c0f1..bb4e3be3f 100644 --- a/packages/lsp25-contracts/package.json +++ b/packages/lsp25-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'", diff --git a/packages/lsp25-contracts/tests/LSP25MultiChannelNonce.test.ts b/packages/lsp25-contracts/tests/LSP25MultiChannelNonce.test.ts index 607d6253d..01dfc5121 100644 --- a/packages/lsp25-contracts/tests/LSP25MultiChannelNonce.test.ts +++ b/packages/lsp25-contracts/tests/LSP25MultiChannelNonce.test.ts @@ -1,11 +1,29 @@ import { ethers } from 'hardhat'; import { expect } from 'chai'; import { LSP25_VERSION } from '../constants'; -import { LOCAL_PRIVATE_KEYS } from '../../../tests/utils/helpers'; import { EIP191Signer } from '@lukso/eip191-signer.js'; import { LSP25MultiChannelNonceTester, LSP25MultiChannelNonceTester__factory } from '../types'; +/** + * Private keys for the accounts used in the tests. + * These are the private keys for the accounts generated by the hardhat node (local blockchain). + * The private keys are used to sign messages with lsp6-signers.js library. + * + * WARNING! These private keys and their related accounts are publicly known and should never be used in production. + * Any funds sent to them on Mainnet or any other live network WILL BE LOST. + */ +const LOCAL_PRIVATE_KEYS = { + ACCOUNT0: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80', + ACCOUNT1: '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', + ACCOUNT2: '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a', + ACCOUNT3: '0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6', + ACCOUNT4: '0x47e179ec197488593b187f80a00eb0da91f1b9d0b13f8733639f19c30a34926a', + ACCOUNT5: '0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba', + ACCOUNT6: '0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e', + ACCOUNT7: '0x030ab56c9834360e1c0dba6b9a955b6e127f3166cda462c2472f67e1ba773053', +}; + describe('LSP25MultiChannelNonce', () => { let contract: LSP25MultiChannelNonceTester; let account; diff --git a/packages/lsp3-contracts/hardhat.config.ts b/packages/lsp3-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp3-contracts/hardhat.config.ts +++ b/packages/lsp3-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp3-contracts/package.json b/packages/lsp3-contracts/package.json index 8fc02ea96..b27167061 100644 --- a/packages/lsp3-contracts/package.json +++ b/packages/lsp3-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" }, diff --git a/packages/lsp4-contracts/hardhat.config.ts b/packages/lsp4-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp4-contracts/hardhat.config.ts +++ b/packages/lsp4-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp4-contracts/package.json b/packages/lsp4-contracts/package.json index b15277820..03204e730 100644 --- a/packages/lsp4-contracts/package.json +++ b/packages/lsp4-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp5-contracts/hardhat.config.ts b/packages/lsp5-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp5-contracts/hardhat.config.ts +++ b/packages/lsp5-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp5-contracts/package.json b/packages/lsp5-contracts/package.json index b446f2546..0be4de2b0 100644 --- a/packages/lsp5-contracts/package.json +++ b/packages/lsp5-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp6-contracts/hardhat.config.ts b/packages/lsp6-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp6-contracts/hardhat.config.ts +++ b/packages/lsp6-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp6-contracts/package.json b/packages/lsp6-contracts/package.json index 12ea99a47..a711a73f5 100644 --- a/packages/lsp6-contracts/package.json +++ b/packages/lsp6-contracts/package.json @@ -35,8 +35,9 @@ ], "scripts": { "build": "hardhat compile --show-stack-traces", + "build:foundry": "forge build", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'", diff --git a/packages/lsp7-contracts/hardhat.config.ts b/packages/lsp7-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp7-contracts/hardhat.config.ts +++ b/packages/lsp7-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp7-contracts/package.json b/packages/lsp7-contracts/package.json index a1a1a1351..05490fb95 100644 --- a/packages/lsp7-contracts/package.json +++ b/packages/lsp7-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp8-contracts/hardhat.config.ts b/packages/lsp8-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp8-contracts/hardhat.config.ts +++ b/packages/lsp8-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp8-contracts/package.json b/packages/lsp8-contracts/package.json index 2efe3d8c3..b403a1c8d 100644 --- a/packages/lsp8-contracts/package.json +++ b/packages/lsp8-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/lsp9-contracts/hardhat.config.ts b/packages/lsp9-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/lsp9-contracts/hardhat.config.ts +++ b/packages/lsp9-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/lsp9-contracts/package.json b/packages/lsp9-contracts/package.json index 021e351c6..0fb7a2ec3 100644 --- a/packages/lsp9-contracts/package.json +++ b/packages/lsp9-contracts/package.json @@ -36,7 +36,7 @@ "scripts": { "build": "hardhat compile --show-stack-traces", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/packages/universalprofile-contracts/hardhat.config.ts b/packages/universalprofile-contracts/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/packages/universalprofile-contracts/hardhat.config.ts +++ b/packages/universalprofile-contracts/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/packages/universalprofile-contracts/package.json b/packages/universalprofile-contracts/package.json index 4524f97f1..e46a0ed58 100644 --- a/packages/universalprofile-contracts/package.json +++ b/packages/universalprofile-contracts/package.json @@ -35,7 +35,7 @@ ], "scripts": { "build": "hardhat compile --show-stack-traces", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'" diff --git a/template/build.config.ts b/template/build.config.ts new file mode 100644 index 000000000..71798d1ff --- /dev/null +++ b/template/build.config.ts @@ -0,0 +1,9 @@ +import { defineBuildConfig } from 'unbuild'; + +export default defineBuildConfig({ + entries: ['./constants'], + declaration: 'compatible', // generate .d.ts files + rollup: { + emitCJS: true, + }, +}); diff --git a/template/hardhat.config.ts b/template/hardhat.config.ts index 1f9e172b9..61d817cdb 100644 --- a/template/hardhat.config.ts +++ b/template/hardhat.config.ts @@ -16,7 +16,7 @@ import { resolve } from 'path'; import '@nomicfoundation/hardhat-toolbox'; // additional hardhat plugins -import 'hardhat-packager'; +// import 'hardhat-packager'; import 'hardhat-contract-sizer'; import 'hardhat-deploy'; diff --git a/template/package.json b/template/package.json index 6fde925c6..69bf393d1 100644 --- a/template/package.json +++ b/template/package.json @@ -28,13 +28,14 @@ ], "scripts": { "build": "hardhat compile --show-stack-traces", + "build:foundry": "forge build", "build:js": "unbuild", - "clean": "hardhat clean", + "clean": "hardhat clean && rm -Rf dist/", "format": "prettier --write .", "lint": "eslint . --ext .ts,.js", "lint:solidity": "solhint 'contracts/**/*.sol' && prettier --check 'contracts/**/*.sol'", "test": "hardhat test --no-compile tests/*.test.ts", - "test:foundry": "forge test --no-match-test Skip -vvv", + "test:foundry": "FOUNDRY_PROFILE=lspN forge test --no-match-test Skip -vvv", "test:coverage": "hardhat coverage" }, "dependencies": { diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index f534beb22..000000000 --- a/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2019", - "module": "commonjs", - "moduleResolution": "node", - "esModuleInterop": true, - "outDir": "dist", - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "lib": ["ES2019", "es2019.array", "ES2021.String"] - }, - "include": [ - "./tests", - "./deploy", - "hardhat", - "packages/LSP2ERC725YJSONSchema/tests/LSP2UtilsLibrary.test.ts" - ], - "files": ["./hardhat.config.ts"] -} diff --git a/tsconfig.module.json b/tsconfig.module.json deleted file mode 100644 index db1b7f1fd..000000000 --- a/tsconfig.module.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "./tsconfig", - "compilerOptions": { - "module": "esNext", - "target": "esNext", - "declaration": true, - "skipLibCheck": false - }, - "files": ["./constants.ts"] -} diff --git a/turbo.json b/turbo.json index 2e3c43347..0df2a29f1 100644 --- a/turbo.json +++ b/turbo.json @@ -7,25 +7,33 @@ "outputs": ["**/artifacts/**", "types/**", "**/types/**"], "cache": true }, + "build:foundry": { + "cache": true + }, "build:js": { "outputs": ["**/dist/**"], "cache": true }, + "clean": {}, "lint": { - "env": ["CONTRACT_VERIFICATION_TESTNET_PK"] + "env": [ + "CONTRACT_VERIFICATION_TESTNET_PK", + "CONTRACT_VERIFICATION_MAINNET_PK" + ] }, "lint:solidity": {}, - "clean": {}, + "package": {}, "test": { "cache": true, "env": ["COVERAGE"] }, - "test:foundry": { - "cache": true - }, "test:coverage": { "dependsOn": ["test"], "cache": false + }, + "test:foundry": { + "dependsOn": ["^build", "^build:foundry"], + "cache": true } } }