-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AA-545: Support accepting '0x7702' flag in the 'factory' field #249
Conversation
packages/utils/src/ERC4337Utils.ts
Outdated
@@ -152,10 +152,15 @@ export function packUserOp (op: UserOperation): PackedUserOperation { | |||
} | |||
paymasterAndData = packPaymasterData(op.paymaster, op.paymasterVerificationGasLimit, op.paymasterPostOpGasLimit, op.paymasterData) | |||
} | |||
let initCode = op.factory == null ? '0x' : hexConcat([op.factory, op.factoryData ?? '']) | |||
if (op.factory === EIP_7702_MARKER_INIT_CODE) { | |||
const eip7702FlagInitCode = EIP_7702_MARKER_INIT_CODE + '0'.repeat(36) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think marker.pad(42, '0')
looks better (took me time to undestand what "36" means. 42 is known to be "hex address length"
} | ||
} | ||
} | ||
return await (entryPoint.provider as JsonRpcProvider).send('eth_call', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not entryPoint.callStatic.getUserOpHash ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that ethers.js for getUserOpHash(userOp: PackedUserOperationStruct, overrides?: CallOverrides)
does not support EIP-7702 tuples at all. This code can be replaced when EIP-7702 support becomes wider.
@@ -276,7 +276,9 @@ export class ERC7562Parser { | |||
recursionDepth: number, | |||
delegatecallStorageAddress: string | |||
): void { | |||
if (erc7562Call.to.toLowerCase() === this.entryPointAddress.toLowerCase()) { | |||
if (erc7562Call.to.toLowerCase() === this.entryPointAddress.toLowerCase() || | |||
erc7562Call.to.toLowerCase() === this.senderCreatorAddress.toLowerCase() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed? senderCreator is not the entrypoint
(afaik, it doesn't cause an issue, because senderCreator's code is simple enoughL: doesn't have any storage access , and have requireFromEntryPoint on all methods)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SenderCreator
call is in the calls
array and without this exception rules are applied to it. And the recent change added the banned GAS
opcode use there.
No description provided.