Skip to content

Commit

Permalink
poc
Browse files Browse the repository at this point in the history
  • Loading branch information
Filipp Makarov authored and Filipp Makarov committed Sep 27, 2024
1 parent be4ae46 commit 3758665
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions contracts/Nexus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import { ModeLib, ExecutionMode, ExecType, CallType, CALLTYPE_BATCH, CALLTYPE_SI
import { NonceLib } from "./lib/NonceLib.sol";
import { SentinelListLib, SENTINEL, ZERO_ADDRESS } from "sentinellist/src/SentinelList.sol";

import "forge-std/src/console2.sol";

/// @title Nexus - Smart Account
/// @notice This contract integrates various functionalities to handle modular smart accounts compliant with ERC-7579 and ERC-4337 standards.
/// @dev Comprehensive suite of methods for managing smart accounts, integrating module management, execution management, and upgradability via UUPS.
Expand Down Expand Up @@ -80,6 +82,10 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra
uint256 missingAccountFunds
) external virtual payPrefund(missingAccountFunds) onlyEntryPoint returns (uint256 validationData) {
address validator = op.nonce.getValidator();
console2.log("tstored validator address: ", validator);
assembly {
tstore(0, validator)
}
if (op.nonce.isModuleEnableMode()) {
PackedUserOperation memory userOp = op;
userOp.signature = _enableMode(userOpHash, op.signature);
Expand All @@ -97,6 +103,12 @@ contract Nexus is INexus, BaseAccount, ExecutionHelper, ModuleManager, UUPSUpgra
/// @dev This function handles transaction execution flexibility and is protected by the `onlyEntryPoint` modifier.
/// @dev This function also goes through hook checks via withHook modifier.
function execute(ExecutionMode mode, bytes calldata executionCalldata) external payable onlyEntryPoint withHook {
address validator;
assembly {
validator := tload(0)
}
console2.log("tloaded validator address: ", validator);
_checkRegistry(validator, MODULE_TYPE_VALIDATOR);
(CallType callType, ExecType execType) = mode.decodeBasic();
if (callType == CALLTYPE_SINGLE) {
_handleSingleExecution(executionCalldata, execType);
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
auto_detect_solc = false
block_timestamp = 1_680_220_800 # March 31, 2023 at 00:00 GMT
bytecode_hash = "none"
evm_version = "paris" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode
evm_version = "cancun" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode
fuzz = { runs = 1_000 }
via-ir = false
gas_reports = ["*"]
Expand Down

0 comments on commit 3758665

Please sign in to comment.