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 #73

Closed
wants to merge 5 commits into from
Closed
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
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",
"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",
"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