Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial v4 #145

Merged
merged 6 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export API_KEY_INFURA=

export API_KEY_ETHERSCAN=
export API_KEY_POLYGONSCAN=
export API_KEY_ARBISCAN=
export API_KEY_OPTIMISTIC_ETHERSCAN=

export FOUNDRY_PROFILE="default"
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
with:
node-version: 18.x
- run: npm ci --ignore-scripts
- run: npm run lint
# - run: npm run lint

commit-lint:
name: Commit Lint
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.x
- uses: foundry-rs/foundry-toolchain@v1
- run: npm ci
- run: npm run test

Expand All @@ -27,4 +28,4 @@ jobs:
with:
node-version: 18.x
- run: npm ci --ignore-scripts
- run: npm run build
# - run: npm run build
67 changes: 0 additions & 67 deletions contracts/DocumentStore.sol

This file was deleted.

62 changes: 0 additions & 62 deletions contracts/DocumentStoreWithRevokeReasons.sol

This file was deleted.

45 changes: 45 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[profile.default]
auto_detect_solc = false
block_timestamp = 1_680_220_800 # March 31, 2023 at 00:00 GMT
bytecode_hash = "none"
evm_version = "paris"
fuzz = { runs = 1_000 }
gas_reports = ["*"]
optimizer = true
optimizer_runs = 10_000
out = "out"
script = "script"
solc = "0.8.23"
src = "src"
test = "test"

[profile.ci]
fuzz = { runs = 10_000 }
verbosity = 4

[etherscan]
arbitrum = { key = "${API_KEY_ARBISCAN}" }
mainnet = { key = "${API_KEY_ETHERSCAN}" }
optimism = { key = "${API_KEY_OPTIMISTIC_ETHERSCAN}" }
polygon = { key = "${API_KEY_POLYGONSCAN}" }
mumbai = { key = "${API_KEY_POLYGONSCAN}" }
sepolia = { key = "${API_KEY_ETHERSCAN}" }

[rpc_endpoints]
arbitrum = "https://arbitrum-mainnet.infura.io/v3/${API_KEY_INFURA}"
localhost = "http://localhost:8545"
mainnet = "https://mainnet.infura.io/v3/${API_KEY_INFURA}"
optimism = "https://optimism-mainnet.infura.io/v3/${API_KEY_INFURA}"
polygon = "https://polygon-mainnet.infura.io/v3/${API_KEY_INFURA}"
mumbai = "https://polygon-mumbai.infura.io/v3/${API_KEY_INFURA}"
sepolia = "https://sepolia.infura.io/v3/${API_KEY_INFURA}"

[fmt]
bracket_spacing = true
int_types = "long"
line_length = 120
multiline_func_header = "params_first"
number_underscore = "thousands"
quote_style = "double"
tab_width = 2
wrap_comments = true
16 changes: 0 additions & 16 deletions interfaces/IKnowForwarderAddress.sol

This file was deleted.

42 changes: 33 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 18 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,33 @@
"build:js:copy-src": "babel src -d dist --ignore src/**/*.spec.ts,src/**/*.test.ts -x .js,.ts,.tsx --copy-files",
"build:js:copy-types": "cp ./src/contracts/*.d.ts ./dist/types/contracts",
"build:js": "tsc --emitDeclarationOnly && npm run build:js:copy-src && npm run build:js:copy-types",
"build": "npm run clean:build && npm run build:sol && npm run posttypechain && npm run build:js",
"build:old": "npm run clean:build && npm run build:sol && npm run posttypechain && npm run build:js",
"clean:build": "rm -rf ./dist && rm -rf build && rm -rf ./src/contracts",
"commit": "git-cz",
"commit:retry": "npm run commit -- --retry",
"lint:js": "eslint . --ext .js",
"lint:js:fix": "eslint . --ext .js --fix",
"lint:sol": "./node_modules/.bin/solhint contracts/**/*.sol",
"lint:sol:old": "./node_modules/.bin/solhint contracts/**/*.sol",
"lint:sol:fix": "./node_modules/.bin/prettier --write contracts/**/*.sol",
"lint": "npm run lint:sol && npm run lint:js",
"lint:old": "npm run lint:sol && npm run lint:js",
"lint:fix": "npm run lint:sol:fix && npm run lint:js:fix",
"test:sol": "hardhat test",
"test:js": "jest --testPathPattern=src",
"test": "npm run test:sol && npm run test:js",
"test:old": "npm run test:sol && npm run test:js",
"benchmark": "hardhat test ./benchmark/*",
"typechain": "typechain --target ethers-v6 --out-dir src/contracts './artifacts/contracts/**/*[^dbg].json'",
"posttypechain": "node scripts/postTypechain.js",
"prepare": "npm run build",
"semantic-release": "semantic-release"
"semantic-release": "semantic-release",
"clean": "rm -rf cache out",
"build": "forge build",
"lint": "bun run lint:sol && bun run prettier:check",
"lint:sol": "forge fmt --check && bun solhint {script,src,test}/**/*.sol",
"prettier:check": "prettier --check **/*.{json,md,yml} --ignore-path=.prettierignore",
"prettier:write": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore",
"test": "forge test",
"test:coverage": "forge coverage",
"test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage"
},
"jest": {
"globalSetup": "./jest/setup.ts",
Expand All @@ -60,8 +69,8 @@
"@commitlint/prompt": "^12.1.1",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@opengsn/contracts": "^2.2.6",
"@openzeppelin/contracts": "^4.2.0",
"@openzeppelin/contracts-upgradeable": "^4.2.0",
"@openzeppelin/contracts": "^5.0.1",
"@openzeppelin/contracts-upgradeable": "^5.0.1",
"@openzeppelin/upgrades": "^2.8.0",
"@typechain/ethers-v6": "^0.4.3",
"@typechain/hardhat": "^8.0.0",
Expand All @@ -72,6 +81,7 @@
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"commitizen": "^4.2.3",
"ds-test": "github:dapphub/ds-test#e282159d5170298eb2455a6c05280ab5a73a4ef0",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^8.3.0",
Expand All @@ -80,6 +90,7 @@
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.4.0",
"ethers": "^6.7.1",
"forge-std": "github:foundry-rs/forge-std#v1.7.6",
"ganache-cli": "^6.12.2",
"git-cz": "^4.7.6",
"hardhat": "^2.4.1",
Expand Down
4 changes: 4 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/
forge-std/=node_modules/forge-std/src/
ds-test/=node_modules/ds-test/src/
Loading
Loading