Skip to content

Conversation

naveen-imtb
Copy link

@naveen-imtb naveen-imtb commented Sep 2, 2025

This version of the Passport Wallet Smart Account upgrade adopts code heavily from Rhinestone's Nexus smart account implementation.

I've stripped out some items that I've deemed unnecessary for this initial PoC like UUPSUpgradeable, ComposableExecution etc.

Pre-work:

  • Bumped Solidity version to 0.8.27 here and evm_version (in this PR) to cancun to comply with the requirements of newly added project dependencies - e.g solady.

Key objectives:

  • Implement function executeFromExecutor(bytes32 mode, bytes calldata executionCalldata) external returns (bytes[] memory returnData); - this is implemented in MainModuleDynamicAuthV2.sol
  • Implement custom signature validation logic where we first check for an installed validator module and fallback to the existing signature validation logic - this is implemented in MainModuleDynamicAuthV2.sol

/// @dev Primary check: caller is an executor module. Secondary check: signature format indicates validator module.
function _shouldUseERC7579Validation() internal view returns (bool) {
// Primary: Check if caller is an executor module
if (_getAccountStorage().executors.contains(msg.sender)) {
Copy link

@zeroknots zeroknots Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but msg.sender in this case is the contract that's trying to validate the signature right? this does work for our intentexecutor, but in the case of a permit2 transfer or compact claim. _shouldUseERC7579Validation() returns false. so you lose single singature flows. target/preclaimops (executions) need to be signed differently than the permit2 / compact EIP712.

I would stick to the proposed solution in the call where you check against installed 7579 validators via the sig = abi.encodePacked(validatorModule, sig).
that's how much 7579 accounts do it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've had to make a small change to your suggestion because there is no valid DEFAULT_VALIDATOR in the current setup and its hard coded to be the zero address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants