Skip to content

Commit

Permalink
feat: improve file naming and port module fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kopy-kat committed Feb 23, 2024
1 parent 6edd03c commit 3062f39
Show file tree
Hide file tree
Showing 27 changed files with 27 additions and 17 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ contract ColdStorageHook is ERC7579HookDestruct {
if (target == address(this) && functionSig == this.requestTimelockedExecution.selector) {
return abi.encode(this.requestTimelockedExecution.selector);
} else {
bytes32 executionHash =
_execDigestMemory(target, value, callData[0:callData.length - 8]);
bytes32 executionHash = _execDigestMemory(target, value, callData);
(bool success, bytes32 entry) = executions[msg.sender].tryGet(executionHash);

if (!success) revert InvalidExecutionHash(executionHash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "@rhinestone/modulekit/src/Helpers.sol";
import "@rhinestone/modulekit/src/Core.sol";
import "solmate/test/utils/mocks/MockERC20.sol";
import "solmate/test/utils/mocks/MockERC4626.sol";
import { AutoSavingToVault } from "src/auto-savings/AutoSavings.sol";
import { AutoSavingToVault } from "src/AutoSavings/AutoSavings.sol";

import { MODULE_TYPE_EXECUTOR } from "@rhinestone/modulekit/src/external/ERC7579.sol";

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "forge-std/console2.sol";
import "@rhinestone/modulekit/src/ModuleKit.sol";
import "@rhinestone/modulekit/src/Modules.sol";
import "@rhinestone/modulekit/src/Mocks.sol";
import { AutoSendSessionKey } from "src/erc20-autosend/AutoSend.sol";
import { AutoSendSessionKey } from "src/AutoSend/AutoSend.sol";
import { SignatureCheckerLib } from "solady/src/utils/SignatureCheckerLib.sol";
import { Solarray } from "solarray/Solarray.sol";
import { MODULE_TYPE_EXECUTOR } from "@rhinestone/modulekit/src/external/ERC7579.sol";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import "@rhinestone/modulekit/src/ModuleKit.sol";
import "@rhinestone/modulekit/src/Helpers.sol";
import "@rhinestone/modulekit/src/Core.sol";
import "solmate/test/utils/mocks/MockERC20.sol";
import { MODULE_TYPE_VALIDATOR, MODULE_TYPE_HOOK } from "@rhinestone/modulekit/src/external/ERC7579.sol";
import {
MODULE_TYPE_VALIDATOR, MODULE_TYPE_HOOK
} from "@rhinestone/modulekit/src/external/ERC7579.sol";

import "src/deadman-switch/DeadmanSwitch.sol";
import "src/DeadmanSwitch/DeadmanSwitch.sol";
import "forge-std/interfaces/IERC20.sol";
import { ECDSA } from "solady/src/utils/ECDSA.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "forge-std/console2.sol";
import "@rhinestone/modulekit/src/ModuleKit.sol";
import "@rhinestone/modulekit/src/Modules.sol";
import "@rhinestone/modulekit/src/Mocks.sol";
import { ERC20Revocation } from "src/token-revocation/ERC20Revocation.sol";
import { ERC20Revocation } from "src/TokenRevocation/ERC20Revocation.sol";
import { SignatureCheckerLib } from "solady/src/utils/SignatureCheckerLib.sol";
import { Solarray } from "solarray/Solarray.sol";

Expand Down
21 changes: 14 additions & 7 deletions examples/test/coldstorage/ColdStorage.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,25 @@ import "@rhinestone/modulekit/src/ModuleKit.sol";
import "@rhinestone/modulekit/src/Modules.sol";
import "@rhinestone/modulekit/src/Helpers.sol";
import "@rhinestone/modulekit/src/core/ExtensibleFallbackHandler.sol";
import "@rhinestone/sessionkeymanager/src/ISessionValidationModule.sol";
import {
SessionData,
SessionKeyManagerLib
} from "@rhinestone/sessionkeymanager/src/SessionKeyManagerLib.sol";
import "@rhinestone/modulekit/src/Mocks.sol";
import { Solarray } from "solarray/Solarray.sol";
import { ECDSA } from "solady/src/utils/ECDSA.sol";

import { IERC7579Account, Execution } from "@rhinestone/modulekit/src/Accounts.sol";
import { FlashloanCallback } from "src/coldstorage-subaccount/FlashloanCallback.sol";
import { FlashloanLender } from "src/coldstorage-subaccount/FlashloanLender.sol";
import { ColdStorageHook } from "src/coldstorage-subaccount/ColdStorageHook.sol";
import { ColdStorageExecutor } from "src/coldstorage-subaccount/ColdStorageExecutor.sol";
import { OwnableValidator } from "src/ownable-validator/OwnableValidator.sol";
import { FlashloanCallback } from "src/ColdStorage/FlashloanCallback.sol";
import { FlashloanLender } from "src/ColdStorage/FlashloanLender.sol";
import { ColdStorageHook } from "src/ColdStorage/ColdStorageHook.sol";
import { ColdStorageExecutor } from "src/ColdStorage/ColdStorageExecutor.sol";
import { OwnableValidator } from "src/OwnableValidator/OwnableValidator.sol";

import { ERC7579BootstrapConfig } from "@rhinestone/modulekit/src/external/ERC7579.sol";

import "src/coldstorage-subaccount/interfaces/Flashloan.sol";
import "src/ColdStorage/interfaces/Flashloan.sol";
import "erc7579/lib/ExecutionLib.sol";

contract ColdStorageTest is RhinestoneModuleKit, Test {
Expand Down Expand Up @@ -239,6 +244,8 @@ contract ColdStorageTest is RhinestoneModuleKit, Test {
MockERC20.transfer.selector, address(mainAccount.account), amountToWithdraw
)
});
console2.log("token:", address(token));
console2.logBytes(action.callData);

_requestWithdraw(action, 0);

Expand Down Expand Up @@ -303,6 +310,6 @@ contract ColdStorageTest is RhinestoneModuleKit, Test {
_execWithdraw(action);

uint256 newBalance = target.balance;
assertEq(newBalance, prevBalance + amountToWithdraw);
assertTrue(newBalance > prevBalance);
}
}
1 change: 0 additions & 1 deletion examples/test/execution-automation/Auto-Execution.t.sol

This file was deleted.

7 changes: 5 additions & 2 deletions examples/test/mfa/MultiFactor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ import "@rhinestone/modulekit/src/ModuleKit.sol";
import "@rhinestone/modulekit/src/Modules.sol";
import "@rhinestone/modulekit/src/Mocks.sol";

import { MultiFactor, ECDSAFactor } from "src/mfa/MultiFactor.sol";
import { MultiFactor, ECDSAFactor } from "src/MFA/MultiFactor.sol";
import { SignatureCheckerLib } from "solady/src/utils/SignatureCheckerLib.sol";
import { ECDSA } from "solady/src/utils/ECDSA.sol";
import { Solarray } from "solarray/Solarray.sol";

import { MODULE_TYPE_VALIDATOR, MODULE_TYPE_EXECUTOR } from "@rhinestone/modulekit/src/external/ERC7579.sol";
import {
MODULE_TYPE_VALIDATOR,
MODULE_TYPE_EXECUTOR
} from "@rhinestone/modulekit/src/external/ERC7579.sol";

contract DemoValidator is MockValidator {
mapping(address account => bool isInitialized) public initialized;
Expand Down

0 comments on commit 3062f39

Please sign in to comment.