From 06a4d8c79e5e10a386fe21dca394128178d56acf Mon Sep 17 00:00:00 2001 From: danilo neves cruz Date: Mon, 25 Mar 2024 15:11:09 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20mise=20en=20place?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 1 + .github/workflows/test.yaml | 24 ++++++++++++++++++++++++ .gitignore | 14 ++++++++++++++ .gitmodules | 12 ++++++++++++ .solhint.json | 6 ++++++ foundry.toml | 7 +++++++ lib/forge-std | 1 + lib/modular-account | 1 + lib/solady | 1 + lib/webauthn-sol | 1 + package.json | 15 +++++++++++++++ remappings.txt | 11 +++++++++++ requirements.txt | 1 + slither.config.json | 4 ++++ 14 files changed, 99 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/test.yaml create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 .solhint.json create mode 100644 foundry.toml create mode 160000 lib/forge-std create mode 160000 lib/modular-account create mode 160000 lib/solady create mode 160000 lib/webauthn-sol create mode 100644 package.json create mode 100644 remappings.txt create mode 100644 requirements.txt create mode 100644 slither.config.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..161ddb7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @cruzdanilo diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..e58f03f --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,24 @@ +name: test +on: + push: + branches: [main] + pull_request: + workflow_dispatch: +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - uses: oven-sh/setup-bun@v1 + - uses: foundry-rs/foundry-toolchain@v1 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: pip + cache-dependency-path: requirements.txt + - run: pip install -r requirements.txt + - run: bun install + - run: bun run test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b496967 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +# foundry +cache/ +out/ +!/broadcast +/broadcast/*/31337/ +/broadcast/**/dry-run/ +docs/ + +.env +.vscode/ +node_modules/ +package-lock.json +bun.lockb +.DS_Store diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3ce8df0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "lib/forge-std"] + path = lib/forge-std + url = https://github.com/foundry-rs/forge-std +[submodule "lib/modular-account"] + path = lib/modular-account + url = https://github.com/alchemyplatform/modular-account +[submodule "lib/webauthn-sol"] + path = lib/webauthn-sol + url = https://github.com/base-org/webauthn-sol +[submodule "lib/solady"] + path = lib/solady + url = https://github.com/vectorized/solady diff --git a/.solhint.json b/.solhint.json new file mode 100644 index 0000000..4d69113 --- /dev/null +++ b/.solhint.json @@ -0,0 +1,6 @@ +{ + "extends": "solhint:recommended", + "rules": { + "func-visibility": ["error", { "ignoreConstructors": true }] + } +} diff --git a/foundry.toml b/foundry.toml new file mode 100644 index 0000000..be3d711 --- /dev/null +++ b/foundry.toml @@ -0,0 +1,7 @@ +[profile.default] +verbosity = 3 + +[fmt] +tab_width = 2 +bracket_spacing = true +number_underscore = "thousands" diff --git a/lib/forge-std b/lib/forge-std new file mode 160000 index 0000000..bb4ceea --- /dev/null +++ b/lib/forge-std @@ -0,0 +1 @@ +Subproject commit bb4ceea94d6f10eeb5b41dc2391c6c8bf8e734ef diff --git a/lib/modular-account b/lib/modular-account new file mode 160000 index 0000000..e40bcc6 --- /dev/null +++ b/lib/modular-account @@ -0,0 +1 @@ +Subproject commit e40bcc62f0368237c5c11b4ae8858c4c8ff369d8 diff --git a/lib/solady b/lib/solady new file mode 160000 index 0000000..3a4e387 --- /dev/null +++ b/lib/solady @@ -0,0 +1 @@ +Subproject commit 3a4e38702e1a87f53c21f6afaf70eb8738535560 diff --git a/lib/webauthn-sol b/lib/webauthn-sol new file mode 160000 index 0000000..d247aa1 --- /dev/null +++ b/lib/webauthn-sol @@ -0,0 +1 @@ +Subproject commit d247aa11831b5e398ca1eb8b5dbeea9b5ea0625c diff --git a/package.json b/package.json new file mode 100644 index 0000000..4962c09 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "webauthn-owner-plugin", + "scripts": { + "test": "concurrently 'npm:test:*' --group -c auto", + "test:fmt": "forge fmt --check", + "test:forge": "forge test", + "test:solhint": "solhint '{src,script,test}/**/*.sol'", + "test:slither": "slither .", + "prepare": "if git status &>/dev/null; then git submodule update --init --recursive; fi" + }, + "devDependencies": { + "concurrently": "^8.2.2", + "solhint": "^4.5.2" + } +} diff --git a/remappings.txt b/remappings.txt new file mode 100644 index 0000000..2b6fbec --- /dev/null +++ b/remappings.txt @@ -0,0 +1,11 @@ +solady/=lib/solady/src/ + +@alchemy/modular-account/=lib/modular-account/src/ +@eth-infinitism/account-abstraction/=lib/modular-account/lib/account-abstraction/contracts/ +@openzeppelin/contracts/=lib/modular-account/lib/openzeppelin-contracts/contracts/ + +webauthn-sol/=lib/webauthn-sol/src/ +openzeppelin-contracts/=lib/webauthn-sol/lib/openzeppelin-contracts/ + +ds-test/=lib/forge-std/lib/ds-test/src/ +forge-std/=lib/forge-std/src/ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..88b9cb3 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +slither-analyzer==0.10.1 diff --git a/slither.config.json b/slither.config.json new file mode 100644 index 0000000..170e67d --- /dev/null +++ b/slither.config.json @@ -0,0 +1,4 @@ +{ + "detectors_to_exclude": "solc-version,naming-convention", + "filter_paths": "lib/" +}