Open
Description
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)
- UserOp.initCode must start with 0x7702
- Entrypoint calculates userOpHash with the
initCode
set tosender
- 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");
}