SafeMultiChainSigAccount, Simple7702AccountV09 and AllowAllPaymaster#62
SafeMultiChainSigAccount, Simple7702AccountV09 and AllowAllPaymaster#62sherifahmed990 merged 78 commits intomainfrom
Conversation
- Fix operator precedence in factory/factoryData validation (utilsTenderly.ts) - Fix inverted gas calculation logic for paymaster detection (utils.ts) - Replace locale-sensitive toLocaleLowerCase() with toLowerCase() for addresses - Remove unreachable dead code in owner index validation - Replace fragile magic number checks with proper ENTRYPOINT_V9 constant comparison 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add missing `new` keyword before RangeError throws (95 occurrences) - Fix typo: safeModuleSetupddress -> safeModuleSetupAddress (25+ locations) - Fix wrong Promise array in Simple7702Account.ts:259-265 (was using gasPriceOp instead of nonceOp) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Export |
fixed |
|
There's a bug where I am using the |
|
// Current - requires awkward casting
const signature = await walletClient.signTypedData({
domain: eip712Data.domain as Parameters<typeof walletClient.signTypedData>[0]['domain'],
types: eip712Data.types,
primaryType: 'MerkleTreeRoot',
message: eip712Data.messageValue as unknown as Record<string, unknown>
}); We can either:
|
|
missing JSDoc examples for multichain signing methods |
|
for the EIP-712 Type, developers need to know the correct primary type for EIP-712 signing. There's no way for developers to know it is 'MerkleTreeRoot'. So I suggest to export it as constant |
|
@sherifahmed990 while doing a demo with |
The default AllowanceModule address changed from v0.1.0 to v1.0.0 due to a bug in the old contract. Export the old address as ALLOWANCE_MODULE_V0_1_0_ADDRESS so consumers with active allowances on the legacy module can still interact with it. Add a breaking-change note to the class JSDoc.
- getDelegatedAddress(address, rpc): checks EIP-7702 delegation via eth_getCode, returns checksummed delegatee address or null - Case-insensitive hex check for EIP-7702 prefix - createRevokeDelegationAuthorization (internal): creates signed zero-address authorization for revoking delegation
- isDelegatedToThisAccount(rpc): checks if EOA is delegated to this account's expected delegatee address - createRevokeDelegationTransaction(privateKey, rpc, overrides?): builds signed type-4 transaction for revoking delegation, with guard that verifies delegation state before revoking - Auto-skip eip7702Auth in createUserOperation when already delegated to the correct address (parallel eth_getCode check, zero added latency) - Delegation pre-check is best-effort (catches errors, proceeds as if not delegated) to avoid breaking createUserOperation on flaky RPC
V0.8: delegate (sponsored), auto-check skip, revoke, revoke-when-not-delegated V0.9: delegate, auto-check skip, revoke
|
formatSignaturesToUseroperationsSignatures and getMultiChainSingleSignatureUserOperationsEip712Hash are using different default safe4337ModuleAddress values:
The fix should be in formatSignaturesToUseroperationsSignatures. it should default to DEFAULT_SAFE_4337_MODULE_ADDRESS when safe4337ModuleAddress isn't provided, same asgetMultiChainSingleSignatureUserOperationsEip712Hash does. When isInit: false, formatSignaturesToUseroperationsSignatures computes the WebAuthn signer address using the base class defaults , including the eip7212WebAuthnPrecompileVerifier and eip7212WebAuthnContractVerifier |
The pre-test cleanup now detects which delegatee the account is currently delegated to and uses the matching account class to revoke, instead of always using Simple7702Account (v0.8).
…ress in multi-chain EIP-712 helper Bundler.sendUserOperation and estimateUserOperationGas now accept UserOperationV9, matching what SafeAccount passes. The static getMultiChainSingleSignatureUserOperationsEip712Data now forwards entrypointAddress to getUserOperationEip712Hash_V9 so it no longer silently defaults to ENTRYPOINT_V9. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
With only one UserOperation, generateMerkleProofs produces a 32-byte proof that fails the merkleProofLength < 128 check in formatSignaturesToUseroperationSignature. Skip the Merkle tree for length==1 and format with isMultiChainSignature and depth 0, matching the signUserOperations instance method behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…atures The static method was falling through to base SafeAccount defaults for safe4337ModuleAddress, eip7212WebAuthnPrecompileVerifier, and eip7212WebAuthnContractVerifier instead of using the ExperimentalSafeMultiChainSigAccount values. This caused hash mismatches for the WebAuthn external-signer path. Resolve defaults up front and propagate them to all code paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
|
Summary by CodeRabbit