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: downgrade solc version #160

Merged
merged 43 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8ec0790
feat: downgrade solc version
kopy-kat Nov 11, 2024
b63e990
refactor: remove safe7579 dep
highskore Nov 12, 2024
0495721
fix: use new revert error
highskore Nov 14, 2024
4cdac00
refactor: remove kernel dep
highskore Nov 14, 2024
357fe17
fix: fix setselector bytecode
highskore Nov 14, 2024
bd45de7
chore: update solc
highskore Nov 14, 2024
930643a
refactor: remove erc7579 ref dep
highskore Nov 14, 2024
9981d5c
fix: cast variables
highskore Nov 14, 2024
63c8999
fix: cast variables
highskore Nov 14, 2024
f27558e
fix: update pgrama
highskore Nov 14, 2024
33e3fba
chore: fix imports
highskore Nov 14, 2024
aa4b10e
chore: fix import
highskore Nov 14, 2024
939a08b
chore: bump solc
highskore Nov 14, 2024
a77a885
chore: remove erc7579 from package
highskore Nov 14, 2024
3c435f3
chore: bump solc to resolve simulate failing
highskore Nov 14, 2024
77abebb
chore: fix solc
highskore Nov 14, 2024
a02e707
refactor: remove registry dep
highskore Nov 14, 2024
1de653f
fix: fix tstore
highskore Nov 15, 2024
b04bfb1
chore: bump solc to >=0.8.24
highskore Nov 15, 2024
6d288e5
chore: remove unnnecessary casting
highskore Nov 15, 2024
40b813c
refacor: import module-bases code
highskore Nov 26, 2024
23a2be9
chore: bump solc to make sim work on ci
highskore Nov 26, 2024
12778f1
chore: remove unused remappings
highskore Nov 26, 2024
1ffaac8
fix: revert modulekit remapping
highskore Nov 26, 2024
0688636
Merge pull request #161 from rhinestonewtf/refactor/remove-account-de…
highskore Nov 28, 2024
5ee7cf8
Merge from main
highskore Nov 28, 2024
e68ed9c
chore: add module-bases remapping
highskore Nov 28, 2024
4fd28bd
Revert "chore: add module-bases remapping"
highskore Nov 28, 2024
c0abfd0
feat: add external imports for backwards compatibility
highskore Nov 28, 2024
bbf4ad6
chore: fix import
highskore Nov 28, 2024
ea80c7d
chore: remove external 7579
highskore Nov 28, 2024
48d4028
fix: import ExecutionLib
highskore Nov 28, 2024
49c7e8c
chore: rename file
highskore Nov 28, 2024
349b538
chore: fix import
highskore Nov 28, 2024
914bd27
fix: use relative imports
highskore Nov 28, 2024
5f38b07
fix: use relative imports
highskore Nov 28, 2024
a00b8bb
chore: fix import
highskore Nov 28, 2024
a851f0b
fix: use relative imports
highskore Nov 28, 2024
8326672
chore: fix some more imports🧑‍🍳
highskore Nov 28, 2024
2e7bc4c
fix: make all imports relative
highskore Nov 28, 2024
8e7abdd
refactor: cleanup
highskore Nov 29, 2024
c0a6b45
Merge pull request #163 from rhinestonewtf/refactor/big-cleanup
highskore Dec 3, 2024
70bce4e
chore: bump package
highskore Dec 6, 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
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[profile.default]
solc_version = "0.8.25"
evm_version = "cancun"
src = "src"
out = "out"
Expand Down
13 changes: 4 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rhinestone/modulekit",
"version": "0.4.17",
"version": "0.5.0",
"description": "A development kit for building and testing smart account modules.",
"license": "GPL-3.0",
"author": {
Expand Down Expand Up @@ -29,24 +29,19 @@
"dependencies": {
"@ERC4337/account-abstraction": "github:kopy-kat/account-abstraction#develop",
"@ERC4337/account-abstraction-v0.6": "github:eth-infinitism/account-abstraction#v0.6.0",
"@prb/math": "^4.0.2",
"@prb/math": "^4.1.0",
"@rhinestone/erc4337-validation": "^0.0.4",
"@rhinestone/module-bases": "github:rhinestonewtf/module-bases#6ed072249860c7143d3f29b153187ab6d5924e84",
"@rhinestone/safe7579": "github:rhinestonewtf/safe7579#v1.0.0",
"@rhinestone/sentinellist": "github:rhinestonewtf/sentinellist",
"@rhinestone/registry": "github:rhinestonewtf/registry#v1.0",
"@safe-global/safe-contracts": "^1.4.1",
"@zerodev/kernel": "github:kopy-kat/kernel#patch",
"ds-test": "github:dapphub/ds-test",
"erc7579": "github:erc7579/erc7579-implementation",
"excessively-safe-call": "github:nomad-xyz/ExcessivelySafeCall",
"forge-std": "github:foundry-rs/forge-std",
"solady": "github:vectorized/solady",
"solarray": "github:sablier-labs/solarray"
},
"devDependencies": {
"@changesets/cli": "^2.27.2",
"solhint": "^5.0.1"
"@changesets/cli": "^2.27.9",
"solhint": "^5.0.3"
},
"files": [
"src",
Expand Down
323 changes: 26 additions & 297 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

11 changes: 1 addition & 10 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
@rhinestone/=node_modules/@rhinestone/
sentinellist/=node_modules/@rhinestone/sentinellist/src/
erc4337-validation/=node_modules/@rhinestone/erc4337-validation/src/
safe7579/=node_modules/@rhinestone/safe7579/src/
modulekit/=node_modules/@rhinestone/modulekit/src/
module-bases/=node_modules/@rhinestone/module-bases/src/
registry/=node_modules/@rhinestone/registry/src/

@ERC4337/=node_modules/@ERC4337/
account-abstraction/=node_modules/@ERC4337/account-abstraction/contracts/
account-abstraction-v0.6/=node_modules/@ERC4337/account-abstraction-v0.6/contracts/

modulekit/=node_modules/@rhinestone/modulekit/src/
@openzeppelin/=node_modules/@openzeppelin/
@safe-global/=node_modules/@safe-global/
ds-test/=node_modules/ds-test/src/
erc7579/=node_modules/erc7579/src/
forge-std/=node_modules/forge-std/src/
solady/=node_modules/solady/src/
solarray/=node_modules/solarray/src/
@prb/math/=node_modules/@prb/math/src/
kernel/=node_modules/@zerodev/kernel/src/
ExcessivelySafeCall/=node_modules/excessively-safe-call/src/
27 changes: 25 additions & 2 deletions src/Accounts.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
pragma solidity >=0.8.23 <0.9.0;

/* solhint-disable no-unused-import */
import { Execution, IERC7579Account } from "./external/ERC7579.sol";

/*//////////////////////////////////////////////////////////////
COMMON
//////////////////////////////////////////////////////////////*/

import { IERC7579Account } from "./accounts/common/interfaces/IERC7579Account.sol";

/*//////////////////////////////////////////////////////////////
7579 REFERENCE
//////////////////////////////////////////////////////////////*/

import { IMSA } from "./accounts/erc7579/interfaces/IMSA.sol";

/*//////////////////////////////////////////////////////////////
KERNEL
//////////////////////////////////////////////////////////////*/

import { IERC7579Account as IKernelAccount } from "./accounts/kernel/interfaces/IERC7579Account.sol";

/*//////////////////////////////////////////////////////////////
SAFE
//////////////////////////////////////////////////////////////*/

import { ISafe7579 } from "./accounts/safe/interfaces/ISafe7579.sol";
2 changes: 0 additions & 2 deletions src/Core.sol

This file was deleted.

40 changes: 34 additions & 6 deletions src/Helpers.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
pragma solidity >=0.8.23 <0.9.0;

/* solhint-disable no-unused-import */

/*//////////////////////////////////////////////////////////////
4337
//////////////////////////////////////////////////////////////*/

import { ERC4337Helpers } from "./test/utils/ERC4337Helpers.sol";

/*//////////////////////////////////////////////////////////////
7579 REFERENCE
//////////////////////////////////////////////////////////////*/

import { ERC7579Helpers } from "./test/helpers/ERC7579Helpers.sol";
import { sign as vmSign } from "./test/utils/Vm.sol";

function ecdsaSign(uint256 privKey, bytes32 digest) pure returns (bytes memory signature) {
(uint8 v, bytes32 r, bytes32 s) = vmSign(privKey, digest);
return abi.encodePacked(r, s, v);
}
/*//////////////////////////////////////////////////////////////
KERNEL
//////////////////////////////////////////////////////////////*/

import { KernelHelpers } from "./test/helpers/KernelHelpers.sol";

/*//////////////////////////////////////////////////////////////
NEXUS
//////////////////////////////////////////////////////////////*/

import { NexusHelpers } from "./test/helpers/NexusHelpers.sol";

/*//////////////////////////////////////////////////////////////
SAFE
//////////////////////////////////////////////////////////////*/

import { SafeHelpers } from "./test/helpers/SafeHelpers.sol";

/*//////////////////////////////////////////////////////////////
UTIL
//////////////////////////////////////////////////////////////*/

import { ecdsaSign } from "./test/utils/ECDSA.sol";
12 changes: 11 additions & 1 deletion src/Integrations.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
pragma solidity >=0.8.23 <0.9.0;

/* solhint-disable no-unused-import */

/*//////////////////////////////////////////////////////////////
ERCs
//////////////////////////////////////////////////////////////*/

import { ERC20Integration } from "./integrations/ERC20.sol";
import { ERC721Integration } from "./integrations/ERC721.sol";
import { ERC4626Integration } from "./integrations/ERC4626.sol";

/*//////////////////////////////////////////////////////////////
UNIV3
//////////////////////////////////////////////////////////////*/

import { UniswapV3Integration, SWAPROUTER_ADDRESS } from "./integrations/uniswap/v3/Uniswap.sol";
29 changes: 17 additions & 12 deletions src/Interfaces.sol
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
pragma solidity >=0.8.23 <0.9.0;

/* solhint-disable no-unused-import */

/*//////////////////////////////////////////////////////////////
ERCs
//////////////////////////////////////////////////////////////*/
import { IERC1271, EIP1271_MAGIC_VALUE } from "module-bases/interfaces/IERC1271.sol";
import { IERC7484 } from "module-bases/interfaces/IERC7484.sol";

import { IERC1271, EIP1271_MAGIC_VALUE } from "./module-bases/interfaces/IERC1271.sol";
import { IERC7484 } from "./module-bases/interfaces/IERC7484.sol";
import {
IERC6682,
IERC3156FlashLender,
IERC3156FlashBorrower
} from "./module-bases/interfaces/Flashloan.sol";

/*//////////////////////////////////////////////////////////////
Modules
MODULES
//////////////////////////////////////////////////////////////*/
import { IStatelessValidator } from "module-bases/interfaces/IStatelessValidator.sol";

import { IStatelessValidator } from "./module-bases/interfaces/IStatelessValidator.sol";
import { IPolicy } from "./module-bases/interfaces/IPolicy.sol";

/*//////////////////////////////////////////////////////////////
Misc
TYPES
//////////////////////////////////////////////////////////////*/
import {
FlashLoanType,
IERC6682,
IERC3156FlashLender,
IERC3156FlashBorrower
} from "module-bases/interfaces/Flashloan.sol";

import { FlashLoanType } from "./module-bases/interfaces/Flashloan.sol";
30 changes: 16 additions & 14 deletions src/Mocks.sol
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
pragma solidity >=0.8.23 <0.9.0;

/* solhint-disable no-unused-import */

/*//////////////////////////////////////////////////////////////
Aux
AUX
//////////////////////////////////////////////////////////////*/

import { MockRegistry } from "module-bases/mocks/MockRegistry.sol";
import { MockTarget } from "module-bases/mocks/MockTarget.sol";
import { MockHookMultiPlexer } from "module-bases/mocks/MockHookMultiPlexer.sol";
import { MockPolicy } from "module-bases/mocks/MockPolicy.sol";
import { MockRegistry } from "./module-bases/mocks/MockRegistry.sol";
import { MockTarget } from "./module-bases/mocks/MockTarget.sol";
import { MockHookMultiPlexer } from "./module-bases/mocks/MockHookMultiPlexer.sol";
import { MockPolicy } from "./module-bases/mocks/MockPolicy.sol";

/*//////////////////////////////////////////////////////////////
Modules
MODULES
//////////////////////////////////////////////////////////////*/

import { MockValidator } from "module-bases/mocks/MockValidator.sol";
import { MockStatelessValidator } from "module-bases/mocks/MockStatelessValidator.sol";
import { MockHybridValidator } from "module-bases/mocks/MockHybridValidator.sol";
import { MockExecutor } from "module-bases/mocks/MockExecutor.sol";
import { MockHook } from "module-bases/mocks/MockHook.sol";
import { MockFallback } from "module-bases/mocks/MockFallback.sol";
import { MockValidator } from "./module-bases/mocks/MockValidator.sol";
import { MockStatelessValidator } from "./module-bases/mocks/MockStatelessValidator.sol";
import { MockHybridValidator } from "./module-bases/mocks/MockHybridValidator.sol";
import { MockExecutor } from "./module-bases/mocks/MockExecutor.sol";
import { MockHook } from "./module-bases/mocks/MockHook.sol";
import { MockFallback } from "./module-bases/mocks/MockFallback.sol";

/*//////////////////////////////////////////////////////////////
Tokens
TOKENS
//////////////////////////////////////////////////////////////*/

import { MockERC20 } from "forge-std/mocks/MockERC20.sol";
import { MockERC721 } from "forge-std/mocks/MockERC721.sol";
14 changes: 11 additions & 3 deletions src/ModuleKit.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
pragma solidity >=0.8.23 <0.9.0;

/* solhint-disable no-unused-import */

/*//////////////////////////////////////////////////////////////
MODULEKIT
//////////////////////////////////////////////////////////////*/

import {
UserOpData,
AccountInstance,
RhinestoneModuleKit,
AccountType
} from "./test/RhinestoneModuleKit.sol";
import { ModuleKitHelpers } from "./test/ModuleKitHelpers.sol";
import { ModuleKitUserOp } from "./test/ModuleKitUserOp.sol";

/*//////////////////////////////////////////////////////////////
4337
////////////////////////////////////////////////////////////*/

import { PackedUserOperation } from "./external/ERC4337.sol";
/* solhint-enable no-unused-import */
70 changes: 50 additions & 20 deletions src/Modules.sol
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
pragma solidity >=0.8.23 <0.9.0;

/* solhint-disable no-unused-import */
import { ERC7579ValidatorBase } from "module-bases/ERC7579ValidatorBase.sol";
import { ERC7579StatelessValidatorBase } from "module-bases/ERC7579StatelessValidatorBase.sol";
import { ERC7579ExecutorBase } from "module-bases/ERC7579ExecutorBase.sol";
import { ERC7579HookBase } from "module-bases/ERC7579HookBase.sol";
import { ERC7579HookDestruct } from "module-bases/ERC7579HookDestruct.sol";
import { ERC7579FallbackBase } from "module-bases/ERC7579FallbackBase.sol";
import { SchedulingBase } from "module-bases/SchedulingBase.sol";

/*//////////////////////////////////////////////////////////////
INTERFACES
//////////////////////////////////////////////////////////////*/

import {
IERC7579Validator,
IERC7579Executor,
IERC7579Fallback,
IERC7579Hook
} from "./external/ERC7579.sol";
import { ERC7484RegistryAdapter } from "module-bases/ERC7484RegistryAdapter.sol";
import { ERC7579ModuleBase } from "module-bases/ERC7579ModuleBase.sol";
import { TrustedForwarder } from "module-bases/utils/TrustedForwarder.sol";
import { ERC1271Policy } from "module-bases/ERC1271Policy.sol";
import { ERC7579ActionPolicy } from "module-bases/ERC7579ActionPolicy.sol";
import { ERC7579PolicyBase } from "module-bases/ERC7579PolicyBase.sol";
import { ERC7579UserOpPolicy } from "module-bases/ERC7579UserOpPolicy.sol";
IValidator as IERC7579Validator,
IExecutor as IERC7579Executor,
IFallback as IERC7579Fallback,
IHook as IERC7579Hook,
IModule as IERC7579Module
} from "./accounts/common/interfaces/IERC7579Module.sol";

/*//////////////////////////////////////////////////////////////
BASES
//////////////////////////////////////////////////////////////*/

// Core
import { ERC7579ModuleBase } from "./module-bases/ERC7579ModuleBase.sol";

// Validators
import { ERC7579ValidatorBase } from "./module-bases/ERC7579ValidatorBase.sol";
import { ERC7579StatelessValidatorBase } from "./module-bases/ERC7579StatelessValidatorBase.sol";
import { ERC7579HybridValidatorBase } from "./module-bases/ERC7579HybridValidatorBase.sol";

// Executors
import { ERC7579ExecutorBase } from "./module-bases/ERC7579ExecutorBase.sol";

// Hooks
import { ERC7579HookBase } from "./module-bases/ERC7579HookBase.sol";
import { ERC7579HookDestruct } from "./module-bases/ERC7579HookDestruct.sol";

// Fallbacks
import { ERC7579FallbackBase } from "./module-bases/ERC7579FallbackBase.sol";

// Misc
import { SchedulingBase } from "./module-bases/SchedulingBase.sol";
import { ERC7484RegistryAdapter } from "./module-bases/ERC7484RegistryAdapter.sol";

// Policies
import { ERC7579PolicyBase } from "./module-bases/ERC7579PolicyBase.sol";
import { ERC1271Policy } from "./module-bases/ERC1271Policy.sol";
import { ERC7579ActionPolicy } from "./module-bases/ERC7579ActionPolicy.sol";
import { ERC7579UserOpPolicy } from "./module-bases/ERC7579UserOpPolicy.sol";

/*//////////////////////////////////////////////////////////////
UTIL
//////////////////////////////////////////////////////////////*/

import { TrustedForwarder } from "./module-bases/utils/TrustedForwarder.sol";
Loading
Loading