Skip to content

Commit

Permalink
Merge 980a7f0 into def913d
Browse files Browse the repository at this point in the history
  • Loading branch information
b00ste authored Jan 23, 2024
2 parents def913d + 980a7f0 commit f435bb8
Show file tree
Hide file tree
Showing 82 changed files with 27,138 additions and 20,808 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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',
},
};
12 changes: 0 additions & 12 deletions .eslintrc.json

This file was deleted.

16 changes: 12 additions & 4 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,20 @@ jobs:
run: npm ci

- name: 🔍 Run Solidity Linter
run: npm run lint:solidity
run: |
npm run lint:solidity
npm run lint:turbo:solidity
- name: 🎨 Run ESLint on JS/TS files
run: npm run lint
run: |
npm run lint
npm run lint:turbo
# This will also generate the Typechain types used by the Chai tests
- name: 🏗️ Build contract artifacts
run: npx hardhat compile
run: |
npm run build
npm run build:turbo
- name: 📤 cache dependencies + build
uses: actions/cache@v2
Expand All @@ -55,6 +61,9 @@ jobs:
exit 1
fi
- name: 🧪 Run Turbo tests
run: npm run test:turbo

test-suites:
strategy:
matrix:
Expand All @@ -63,7 +72,6 @@ jobs:
"up",
"upinit",
"lsp1",
"lsp2",
"lsp6",
"lsp6init",
"lsp7",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/solc_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
if [[ "<" == "${{ steps.comparison.outputs.comparison-result }}" ]]
then
solc $(ls contracts/**/*.sol | grep -v "Extension4337\|contracts/LSP8IdentifiableDigitalAsset/LSP8IdentifiableDigitalAsset") \
--allow-paths $(pwd)/node_modules/ \
--allow-paths $(pwd)/node_modules/,$(pwd)/packages/ \
@=node_modules/@ \
solidity-bytes-utils/=node_modules/solidity-bytes-utils/ \
../=$(pwd)/contracts/
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,9 @@ gas_benchmark.md

# test temporary folder
/.test

# Turborepo
.turbo

# Custom setup
foundry_artifacts/
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "lib/forge-std"]
path = lib/forge-std
url = git@github.com:foundry-rs/forge-std.git
url = https://github.com/foundry-rs/forge-std.git
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"options": {
"tabWidth": 4,
"printWidth": 80,
"compiler": "0.8.15"
"compiler": "0.8.17"
}
}
]
Expand Down
9 changes: 9 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineBuildConfig } from 'unbuild';

export default defineBuildConfig({
entries: ['./constants'],
declaration: 'compatible', // generate .d.ts files
rollup: {
emitCJS: true,
},
});
1 change: 1 addition & 0 deletions config/eslint-config-custom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# `eslint-custom-config`
14 changes: 14 additions & 0 deletions config/eslint-config-custom/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
ignorePatterns: ['artifacts/', 'cache/', 'dist/', 'types/', 'contracts.ts'],
extends: ['turbo', 'prettier'],
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/no-explicit-any': 'off',
},
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
};
13 changes: 13 additions & 0 deletions config/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "eslint-config-custom",
"version": "0.0.0",
"main": "index.js",
"private": true,
"dependencies": {
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint-config-prettier": "^8.8.0",
"eslint-config-turbo": "^1.9.3",
"eslint-plugin-prettier": "^4.2.1"
}
}
17 changes: 17 additions & 0 deletions config/tsconfig/contracts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"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", "hardhat", "./deploy"],
"files": ["./hardhat.config.ts"]
}
11 changes: 11 additions & 0 deletions config/tsconfig/contracts.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig",
"compilerOptions": {
"module": "esNext",
"target": "esNext",
"outDir": "module",
"declaration": true,
"skipLibCheck": false
},
"files": ["./constants.ts"]
}
13 changes: 13 additions & 0 deletions config/tsconfig/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "tsconfig",
"version": "0.0.0",
"private": true,
"license": "Apache-2.0",
"publishConfig": {
"access": "public"
},
"files": [
"contracts.json",
"contracts.module.json"
]
}
4 changes: 3 additions & 1 deletion contracts/LSP0ERC725Account/LSP0ERC725AccountCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import {
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// modules
import {ERC725YCore} from "@erc725/smart-contracts/contracts/ERC725YCore.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP10ReceivedVaults/LSP10Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP9} from "../LSP9Vault/LSP9Constants.sol";
Expand Down
4 changes: 1 addition & 3 deletions contracts/LSP17Extensions/OnERC721ReceivedExtension.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ import {LSP17Extension} from "../LSP17ContractExtension/LSP17Extension.sol";
* to allow it to receive ERC721 tokens via `safeTransferFrom`.
*/
// solhint-disable-next-line no-empty-blocks
contract OnERC721ReceivedExtension is ERC721Holder, LSP17Extension {

}
contract OnERC721ReceivedExtension is ERC721Holder, LSP17Extension {}
4 changes: 3 additions & 1 deletion contracts/LSP1UniversalReceiver/LSP1Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ pragma solidity ^0.8.4;
import {
ERC165Checker
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {ILSP1UniversalReceiver as ILSP1} from "./ILSP1UniversalReceiver.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP5ReceivedAssets/LSP5Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import {
} from "@erc725/smart-contracts/contracts/interfaces/IERC725Y.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP6KeyManager/LSP6Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
import {ILSP6KeyManager} from "./ILSP6KeyManager.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP7DigitalAsset/LSP7DigitalAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import {LSP7DigitalAssetCore} from "./LSP7DigitalAssetCore.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP7} from "./LSP7Constants.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP7DigitalAsset/LSP7DigitalAssetInitAbstract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import {LSP7DigitalAssetCore} from "./LSP7DigitalAssetCore.sol";
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP7} from "./LSP7Constants.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP8, _LSP8_TOKENID_FORMAT_KEY} from "./LSP8Constants.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import {
import {LSP17Extendable} from "../LSP17ContractExtension/LSP17Extendable.sol";

// libraries
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// constants
import {_INTERFACEID_LSP8, _LSP8_TOKENID_FORMAT_KEY} from "./LSP8Constants.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/LSP9Vault/LSP9VaultCore.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import {
ERC165Checker
} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {LSP1Utils} from "../LSP1UniversalReceiver/LSP1Utils.sol";
import {LSP2Utils} from "../LSP2ERC725YJSONSchema/LSP2Utils.sol";
import {
LSP2Utils
} from "../../packages/LSP2ERC725YJSONSchema/contracts/LSP2Utils.sol";

// modules
import {ERC725XCore} from "@erc725/smart-contracts/contracts/ERC725XCore.sol";
Expand Down
19 changes: 16 additions & 3 deletions docs/contracts/ERC725/ERC725.md
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,12 @@ mapping(bytes32 => bytes) _store
:::

```solidity
event ContractCreated(uint256 indexed operationType, address indexed contractAddress, uint256 value, bytes32 indexed salt);
event ContractCreated(
uint256 indexed operationType,
address indexed contractAddress,
uint256 value,
bytes32 indexed salt
);
```

_Deployed new contract at address `contractAddress` and funded with `value` wei (deployed using opcode: `operationType`)._
Expand Down Expand Up @@ -781,7 +786,12 @@ Emitted when data at a specific `dataKey` was changed to a new value `dataValue`
:::

```solidity
event Executed(uint256 indexed operationType, address indexed target, uint256 value, bytes4 indexed selector);
event Executed(
uint256 indexed operationType,
address indexed target,
uint256 value,
bytes4 indexed selector
);
```

_Called address `target` using `operationType` with `value` wei and `data`._
Expand Down Expand Up @@ -811,7 +821,10 @@ Emitted when calling an address `target` (EOA or contract) with `value`.
:::

```solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
```

#### Parameters
Expand Down
Loading

0 comments on commit f435bb8

Please sign in to comment.