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

Feature/monorepo #74

Merged
merged 46 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0288e17
feat: monorepo prototype
zeroknots Feb 16, 2024
d207ebb
chore: clean repo
zeroknots Feb 16, 2024
02b3ba8
feat: added example demo
zeroknots Feb 16, 2024
31681cd
chore: cleaning up
zeroknots Feb 16, 2024
e6ad7d9
del: removing ci files we dont need
zeroknots Feb 16, 2024
3901e3a
chore: updating libs
zeroknots Feb 16, 2024
1326e23
feat: ported over all module examples and tests
zeroknots Feb 19, 2024
e7f6cc0
fmt
zeroknots Feb 19, 2024
9d431ad
cleaned safe account
zeroknots Feb 20, 2024
fee71bc
factory done
zeroknots Feb 20, 2024
3c650b4
works
zeroknots Feb 20, 2024
54a9a79
fix gas calculations
zeroknots Feb 20, 2024
3ae5239
fixed tests
zeroknots Feb 20, 2024
dfb252d
feat: implemented safe hook
zeroknots Feb 20, 2024
f9dc756
wip
zeroknots Feb 20, 2024
c21951d
using new sentinellist 4337
zeroknots Feb 21, 2024
ad17830
Merge pull request #77 from rhinestonewtf/feature/modulekit-to-packages
zeroknots Feb 21, 2024
f24bb1c
chore: renaming s/account/safe/
zeroknots Feb 21, 2024
2cd64be
Update packages/SessionKeyManager/package.json
zeroknots Feb 21, 2024
1cac382
Update examples/package.json
zeroknots Feb 21, 2024
6008cf6
Update accounts/safe7579/package.json
zeroknots Feb 21, 2024
7669994
update deps
zeroknots Feb 21, 2024
0ae520a
clean up
zeroknots Feb 21, 2024
d7a2fe3
fix: init/deinit module via safe account
zeroknots Feb 21, 2024
f1456fc
chore: cleanup
zeroknots Feb 21, 2024
830dda3
feat: hook calls in function
zeroknots Feb 21, 2024
1f1a30a
chore: version update
zeroknots Feb 21, 2024
8d63189
chore: gas optimizations in ExecutionHelper
zeroknots Feb 21, 2024
41adb63
feat: fallback working
zeroknots Feb 21, 2024
8a1d74b
fix: cleaning imports
zeroknots Feb 21, 2024
627b11c
hook destruct working
zeroknots Feb 22, 2024
b8d0ab6
updating CI
zeroknots Feb 23, 2024
d291b05
fix: session key manager missing imports
kopy-kat Feb 23, 2024
100d124
feat: update to latest erc version
kopy-kat Feb 23, 2024
98e8d7b
chore: cleanup mocks
kopy-kat Feb 23, 2024
4a1da43
chore: update readme
kopy-kat Feb 23, 2024
727ede4
fix: validation failed constant
kopy-kat Feb 23, 2024
8cd5456
Merge branch 'main' into feature/monorepo
kopy-kat Feb 23, 2024
5788ccf
chore: update deps
kopy-kat Feb 23, 2024
6edd03c
feat: update to v0.7 entrypoint address
kopy-kat Feb 23, 2024
3062f39
feat: improve file naming and port module fixes
kopy-kat Feb 23, 2024
867fafc
feat: add module examples readme
kopy-kat Feb 23, 2024
14acd9c
chore: add changelog
kopy-kat Feb 23, 2024
b855e37
chore: update changelog
kopy-kat Feb 23, 2024
7d923fa
fix: linting issues
kopy-kat Feb 23, 2024
39290e2
fix: cicd
kopy-kat Feb 23, 2024
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
55 changes: 55 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
- push
- pull_request

jobs:
lint:
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-lint.yaml@main"

build:
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-build.yaml@main"

test-unit:
needs: ["build"]
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-test.yaml@main"
with:
foundry-fuzz-runs: 5000
foundry-profile: "test"
match-path: "test/**/*.sol"
name: "Unit tests"

lint-safe7579:
needs: ["lint", "test-unit"]
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-lint-workspaces.yaml@main"
with:
match-workspace: "@rhinestone/safe7579"

test-safe7579:
needs: ["build", "test-unit"]
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-test-workspaces.yaml@main"
with:
match-workspace: "@rhinestone/safe7579"

lint-sessionkeymanager:
needs: ["lint", "test-unit"]
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-lint-workspaces.yaml@main"
with:
match-workspace: "@rhinestone/sessionkeymanager"

test-sessionkeymanager:
needs: ["build", "test-unit"]
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-test-workspaces.yaml@main"
with:
match-workspace: "@rhinestone/sessionkeymanager"

lint-modulekit-examples:
needs: ["lint", "test-unit"]
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-lint-workspaces.yaml@main"
with:
match-workspace: "@rhinestone/modulekit-examples"

test-modulekit-examples:
needs: ["build", "test-unit"]
uses: "rhinestonewtf/reusable-workflows/.github/workflows/forge-test-workspaces.yaml@main"
with:
match-workspace: "@rhinestone/modulekit-examples"
34 changes: 0 additions & 34 deletions .github/workflows/test.yml

This file was deleted.

Empty file removed .gitmodules
Empty file.
File renamed without changes.
File renamed without changes.
19 changes: 9 additions & 10 deletions src/accounts/safe/package.json → accounts/safe7579/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@rhinestone/safe-erc7579",
"name": "@rhinestone/safe7579",
"description": "Safe ERC7579 implementation",
"license": "MIT",
"version": "0.1.0",
Expand All @@ -8,23 +8,22 @@
"url": "https://rhinestone.wtf"
},
"bugs": {
"url": "https://github.com/rhinestonewtf/safe-erc7579/issues"
"url": "https://github.com/rhinestonewtf/modulekit/issues"
},
"devDependencies": {
"@openzeppelin/contracts": "5.0.1",
"@rhinestone/modulekit": "github:rhinestonewtf/modulekit",
"@rhinestone/modulekit": "workspace:*",
"@safe-global/safe-contracts": "^1.4.1",
"@rhinestone/sessionkeymanager": "github:rhinestonewtf/sessionkeymanager",
"account-abstraction": "github:eth-infinitism/account-abstraction#develop",
"ds-test": "github:dapphub/ds-test",
"@openzeppelin/contracts": "5.0.1",
"@ERC4337/account-abstraction": "github:kopy-kat/account-abstraction#develop",
"forge-std": "github:foundry-rs/forge-std",
"ds-test": "github:dapphub/ds-test",
"erc7579": "github:erc7579/erc7579-implementation",
"prettier": "^2.8.8",
"sentinellist": "github:zeroknots/sentinellist",
"solady": "github:vectorized/solady",
"solarray": "github:sablier-labs/solarray",
"solmate": "github:transmissions11/solmate",
"solhint": "^4.1.1",
"solmate": "github:transmissions11/solmate"
"prettier": "^2.8.8"
},
"files": [
"artifacts",
Expand All @@ -33,7 +32,6 @@
"CHANGELOG.md",
"LICENSE-GPL.md"
],
"homepage": "https://github.com/rhinestonewtf/safe-erc7579/#readme",
"keywords": [
"blockchain",
"ethereum",
Expand All @@ -47,6 +45,7 @@
},
"repository": "github.com/rhinestonewtf/modulekit-examples",
zeroknots marked this conversation as resolved.
Show resolved Hide resolved
"scripts": {
"fmt": "forge fmt",
"build": "forge build",
"build:optimized": "FOUNDRY_PROFILE=optimized forge build",
"build:smt": "FOUNDRY_PROFILE=smt forge build",
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions accounts/safe7579/remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ds-test/=node_modules/ds-test/src/
forge-std/=node_modules/forge-std/src/
account-abstraction/=node_modules/@ERC4337/account-abstraction/contracts/
erc7579/=node_modules/erc7579/src/
sentinellist/=node_modules/sentinellist/src/
solmate/=node_modules/solmate/src/
solady/=node_modules/solady/
solarray/=node_modules/solarray/src/
@rhinestone/=node_modules/@rhinestone/
@safe-global/=node_modules/@safe-global/
@ERC4337/=node_modules/@ERC4337/
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import "./HookManager.sol";
import "./ExecutionHelper.sol";
import "./ModuleManager.sol";
import "./interfaces/ISafeOp.sol";
import { UserOperationLib } from "account-abstraction/core/UserOperationLib.sol";
import { _packValidationData } from "account-abstraction/core/Helpers.sol";
import { UserOperationLib } from "@ERC4337/account-abstraction/contracts/core/UserOperationLib.sol";
import { _packValidationData } from "@ERC4337/account-abstraction/contracts/core/Helpers.sol";

contract SafeERC7579 is
ISafeOp,
Expand Down
8 changes: 8 additions & 0 deletions accounts/safe7579/test/Foo.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import "forge-std/Test.sol";

contract FooTest is Test {
function setUp() public { }
function test_foo() public {
// This is a test
}
}
19 changes: 19 additions & 0 deletions examples/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

[profile.default]
src = "src"
out = "out"
libs = ["lib"]
fs_permissions = [{ access = "read", path = "out-optimized" }]
allow_paths = ["*", "/"]

[fmt]
bracket_spacing = true
int_types = "long"
line_length = 100
multiline_func_header = "all"
number_underscore = "thousands"
quote_style = "double"
tab_width = 4
wrap_comments = true

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
68 changes: 68 additions & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "@rhinestone/modulekit-examples",
"description": "ModuleKit Examples",
"license": "MIT",
"version": "0.1.0",
"author": {
"name": "zeroknots.eth",
"url": "https://rhinestone.wtf"
},
"bugs": {
"url": "https://github.com/rhinestonewtf/modulekit/issues"
},
"devDependencies": {
"@openzeppelin/contracts": "5.0.1",
"@rhinestone/modulekit": "workspace:*",
"@rhinestone/sessionkeymanager": "workspace:*",
"@prb/math": "^4.0.2",
"erc4337-validation": "github:rhinestonewtf/erc4337-validation",
"@ERC4337/account-abstraction": "github:kopy-kat/account-abstraction#develop",
"@ERC4337/account-abstraction-v0.6": "github:eth-infinitism/account-abstraction#v0.6.0",
"forge-std": "github:foundry-rs/forge-std",
"ds-test": "github:dapphub/ds-test",
"erc7579": "github:erc7579/erc7579-implementation",
"sentinellist": "github:zeroknots/sentinellist",
"solady": "github:vectorized/solady",
"solarray": "github:sablier-labs/solarray",
"solmate": "github:transmissions11/solmate",
"solhint": "^4.1.1",
"prettier": "^2.8.8"
},
"files": [
"artifacts",
"src",
"test/utils",
"CHANGELOG.md",
"LICENSE-GPL.md"
],
"keywords": [
"blockchain",
"ethereum",
"foundry",
"smart-contracts",
"solidity",
"web3"
],
"publishConfig": {
"access": "public"
},
"repository": "github.com/rhinestonewtf/modulekit-examples",
zeroknots marked this conversation as resolved.
Show resolved Hide resolved
"scripts": {
"fmt": "forge fmt",
"build": "forge build",
"build:optimized": "FOUNDRY_PROFILE=optimized forge build",
"build:smt": "FOUNDRY_PROFILE=smt forge build",
"clean": "rm -rf artifacts broadcast cache docs out out-optimized out-svg",
"gas:report": "forge test --gas-report --mp \"./test/integration/**/*.sol\" --nmt \"test(Fuzz)?_RevertWhen_\\w{1,}?\"",
"gas:snapshot": "forge snapshot --mp \"./test/integration/**/*.sol\" --nmt \"test(Fuzz)?_RevertWhen_\\w{1,}?\"",
"gas:snapshot:optimized": "pnpm run build:optimized && FOUNDRY_PROFILE=test-optimized forge snapshot --mp \"./test/integration/**/*.sol\" --nmt \"test(Fork)?(Fuzz)?_RevertWhen_\\w{1,}?\"",
"lint": "pnpm run lint:sol && bun run prettier:check",
"lint:sol": "forge fmt --check && pnpm solhint \"{script,src,test}/**/*.sol\"",
"prepack": "pnpm install",
"prettier:check": "prettier --check \"**/*.{json,md,svg,yml}\"",
"prettier:write": "prettier --write \"**/*.{json,md,svg,yml}\"",
"test": "forge test",
"test:lite": "FOUNDRY_PROFILE=lite forge test",
"test:optimized": "pnpm run build:optimized && FOUNDRY_PROFILE=test-optimized forge test"
}
}
15 changes: 15 additions & 0 deletions examples/remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ds-test/=node_modules/ds-test/src/
forge-std/=node_modules/forge-std/src/
account-abstraction/=node_modules/@ERC4337/account-abstraction/contracts/
account-abstraction-v0.6/=node_modules/@ERC4337/account-abstraction-v0.6/contracts/
@openzeppelin/=node_modules/@openzeppelin/
erc7579/=node_modules/erc7579/src/
sentinellist/=node_modules/sentinellist/src/
solmate/=node_modules/solmate/src/
solady/=node_modules/solady/
solarray/=node_modules/solarray/src/
@rhinestone/=node_modules/@rhinestone/
@safe-global/=node_modules/@safe-global/
erc4337-validation/=node_modules/erc4337-validation/src/
@ERC4337/=node_modules/@ERC4337/
@prb/math/=node_modules/@prb/math/
Loading
Loading