Skip to content
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

Merged
merged 9 commits into from
Mar 2, 2025

Conversation

forshtat
Copy link
Contributor

No description provided.

@@ -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)
Copy link
Contributor

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', [
Copy link
Contributor

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 ?

Copy link
Contributor Author

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()
Copy link
Contributor

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)

Copy link
Contributor Author

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.

@forshtat forshtat merged commit 81864a7 into master Mar 2, 2025
4 checks passed
@forshtat forshtat deleted the AA-545-support-0x7702-flag branch March 2, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants