Skip to content

userOp override initialize hash #108

Open
@zhongeric

Description

@zhongeric

https://eips.ethereum.org/EIPS/eip-4337#support-for-eip-7702-authorizations

  • Bundlers will support relaying a signed authorization along with the UserOp (no contract changes required)
  • If the account is not yet delegated (which also means first UserOp)
  1. UserOp.initCode must start with 0x7702
  2. Entrypoint calculates userOpHash with the initCode set to sender
  3. Thus the hashOverride (if doing it yourself locally) is keccak256(abi.encodePacked(sender))
  • if userOp.initCode starts with 0x7702 but no authorization is given to the bundler it will revert
        // To be a valid EIP-7702 delegate, the first 3 bytes are EIP7702_PREFIX
        // followed by the delegate address
        if (bytes3(senderCode) != EIP7702_PREFIX) {
            // instead of just "not an EIP-7702 delegate", if some info.
            require(sender.code.length > 0, "sender has no code");
            revert("not an EIP-7702 delegate");
        }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions