permissionless 0.6.0
permissionless: ^0.6.0 copied to clipboard
A Dart implementation of permissionless.js for ERC-4337 smart accounts. Supports Safe, Simple, Kernel, and Etherspot accounts with bundler and paymaster clients.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.6.0 - 2026-11-06 #
A structural refactor of the package plus the behaviour fixes it turned up (#90). Each fix landed with a test that failed first. Nothing exported was removed or renamed, so calling code keeps compiling. Some things can still break you, all under Changed:
- Subclasses that override a method which gained a parameter must add it.
- Some invalid configurations now throw where they used to build.
- Two Safe setups get a different counterfactual address.
- EntryPoint v0.6 accounts with a paymaster use different RPC methods.
- WebAuthn accounts no longer get a 900,000 verification-gas floor.
Added #
EntryPointVersionedandentryPointVersionOfAccount: an interface for accounts that know their EntryPoint version, and a helper that reads it. Every built-in account implements it, so the client andsendUserOperationSyncno longer have to guess the version from the EntryPoint address.EtherspotSmartAccountandTrustSmartAccountgain the publicentryPointVersiongetter the other accounts already had (#90).DeploymentCallsEncoder: the interface an account implements when its first, deploying operation needs different call data. Safe ERC-7579 uses it for thesetupSafewrapper.SmartAccountClientchecks for this interface instead of checking forSafeSmartAccount(#90).hashMessageBytes: EIP-191 hash of raw bytes, like viem'shashMessage({ raw }).hashMessageand every account now share this one implementation (#90).getUserOperationTypedData: the EIP-712 typed data an EntryPoint v0.8 account signs, under viem's name (#90).PermissionlessExceptionis exported.SendUserOperationSyncErroralready extended it, but there was no way to catch the library's errors by their common type (#90).- Solidity signature constants for the selector tables, such as
erc7579ExecuteSignature,erc7579InstallModuleSignature,simpleAccountCreateAccountSignatureandetherspotInitMsaSignature. The selector tables are now derived from these strings (#90). defaultReceiptTimeout(120 s) anddefaultReceiptPollingInterval(2 s): the defaults every receipt wait uses (#90).- New optional parameters. Each one defaults to the old behaviour
(#90):
BundlerClient.sendUserOperationandestimateUserOperationGas:entryPoint(defaults to the client's) andauthorization(sent as the operation'seip7702Auth).SmartAccountClient.sendPreparedUserOperation:authorization.SmartAccountClient.sendUserOperationAndWait:callGasLimit,verificationGasLimit,preVerificationGas,signature,factoryandfactoryData, forwarded tosendUserOperation. Before, theAndWaitvariant had no way to pass them.sendUserOperationV06AndWaitgainssignature.PimlicoClient.getTokenQuotes,estimateErc20PaymasterCostandvalidateSponsorshipPolicies:entryPoint(defaults to the client's).- ERC-7579 queries
supportsExecutionMode,supportsModule,isModuleInstalledandgetAccountId:publicClientis optional and defaults to theSmartAccountClient's own. - Experimental
prepareUserOperationForErc20Paymaster:publicClientis optional and defaults to theSmartAccountClient's own. ExperimentalestimateErc20PaymasterCostgainsentryPoint. Hex.fromBytesaccepts anyList<int>, not onlyUint8List.SmartAccountClient.sendUserOperationV06andsendUserOperationV06AndWait:callGasLimit,verificationGasLimit,preVerificationGas,initCodeandstateOverride, forwarded toprepareUserOperationV06. They now take every parameterprepareUserOperationV06takes exceptskipFinalPaymasterData, which a sent operation can't use. A supplied gas limit skips the bundler estimate for that field (#90).SmartAccountClient.prepareUserOperationV06:stateOverride, sent witheth_estimateUserOperationGas, andskipFinalPaymasterData, which keeps the stubpaymasterAndDataand skipspm_getPaymasterData. Both work as they do inprepareUserOperation(#90).
PaymasterStubData.fromJsonandPaymasterData.fromJsonaccept the ERC-7677 v0.6 response{ paymasterAndData, sponsor?, isFinal? }. They splitpaymasterAndDataintopaymaster(the first 20 bytes) andpaymasterData(the rest), sowithPaymasterStubV06andwithPaymasterDataV06rebuild the same bytes. A value shorter than an address throwsFormatException. Responses that carrypaymasterparse as before (#90).
Changed #
- Subclasses that override these methods must add the new named
parameters.
BundlerClient.sendUserOperationandestimateUserOperationGas,SmartAccountClient.sendPreparedUserOperation,sendUserOperationAndWaitandsendUserOperationV06AndWait, and every other method listed under Added → New optional parameters. An override that keeps the old parameter list no longer compiles. An override ofPaymasterClient.sponsorUserOperationthat declaresrequired BigInt chainIdmust make it optional. Code that only calls these methods is unaffected (#90). - The EntryPoint v0.6 paymaster flow is ERC-7677,
as in viem and the v0.7 path. This affects EntryPoint v0.6 accounts that
pass a
paymastertocreateSmartAccountClient: Simple, Light, Thirdweb or Safe on v0.6, Kernel v0.2, Biconomy and Trust. v0.7/v0.8 accounts, and v0.6 accounts without a paymaster, see no change (#90).prepareUserOperationV06, and the v0.6 send methods through it, no longer callpm_sponsorUserOperation. They callpm_getPaymasterStubData, theneth_estimateUserOperationGason the bundler if a gas field is missing, thenpm_getPaymasterData. A stub withisFinal: trueskips the last call.- Pimlico serves ERC-7677 on v0.6, so Pimlico setups keep working. Only the
methods on the wire change. Update request logs, mocks and allow-lists
keyed on
pm_sponsorUserOperation. callGasLimit,verificationGasLimitandpreVerificationGasnow come from the bundler's estimate with the client'sgasMultipliersapplied, not from the paymaster's sponsorship response. Values you pass are still used as given.- Any ERC-7677 paymaster now works with v0.6 accounts. Before, non-Pimlico paymasters failed with "method not found".
PaymasterClient.sponsorUserOperationis still there as an explicit Pimlico action, as in permissionless.js, if you want the old single call.
- WebAuthn accounts no longer get a 900,000
verification-gas floor.
SmartAccountClientused to raiseverificationGasLimitto at least 900,000 for every account withisWebAuthn. They now get the bundler estimate times the configuredgasMultipliers, like every other account and as in permissionless.js. The estimate is now realistic because the Kernel WebAuthn stub was fixed (see Fixed). To keep a minimum, passverificationGasLimitor use customgasMultipliers. TheGasMultipliers.webAuthnpreset is still there and is opt-in (#90). - Two Safe setups get a different counterfactual address. Both old
addresses were wrong
(#90):
- A Safe in ERC-7579 mode with a WebAuthn owner now lists that owner as the
SafeWebAuthnSharedSigner, as standard mode and permissionless.js do. The old setup data listed a placeholder address that nobody can sign for. - A Safe v1.5.0 built without a
publicClientnow uses the v1.5.0 proxy creation code. Before, every offline v1.5.0 address was derived from the v1.4.1 proxy code.
- A Safe in ERC-7579 mode with a WebAuthn owner now lists that owner as the
- Invalid account configs throw
ArgumentErrorat construction instead of building an account that cannot work (#90):- Kernel
customAddresseswithout anecdsaValidator, for every version. Kernel v0.2.x used to put the account implementation in the validator slot, so the initCode could never deploy. - Kernel with a WebAuthn owner on v0.2.x, or without a
webAuthnValidatoraddress. This used to be aStateErrorfrom the middle ofprepareUserOperation, after RPC calls had already run. - Safe with more than one WebAuthn owner. Every WebAuthn owner maps to the
same shared-signer address, so
Safe.setupreverted with GS203/GS204, and the shared signer holds only one P-256 key. permissionless.js accepts this config and derives an address that can't be deployed. - Thirdweb with EntryPoint v0.8. It used to fall back to the v0.6 factory and EntryPoint without saying so.
- Light Account pairs other than 1.1.0 with v0.6 and 2.0.0 with v0.7. Other pairs used to sign the wrong hash or use the wrong factory.
- Safe with a WebAuthn owner when the resolved
addresses lack
webAuthnSharedSignerAddress, or, outside ERC-7579 mode,safeP256VerifierAddress. The built-in Safe 1.4.1 + EntryPoint v0.6 table has neither, so that pair now throws here. In 0.5.0 these configs failed later, with a null-checkTypeErroror aStateErrorfromgetAddress,getStubSignatureor signing. This deliberately differs from permissionless.js, which reads these addresses only when it builds the setup and silently skipsconfigure()without a verifier. Kernel already checkswebAuthnValidatorthe same way. One config that used to work now throws: a pre-setaddressof an already-deployed Safe with a WebAuthn owner and custom addresses that have a shared signer but no verifier, in standard mode (#90).
- Kernel
- Encoders range-check their inputs and throw
ArgumentError, as viem does (#90):AbiEncoderrejects out-of-rangeuintN/intNvalues and type widths Solidity doesn't have (uint7,int264,bytes33,bytes0), including inside arrays and tuples. Before, debug builds threwAssertionErrorand release builds encoded the bad value.hashTypedDatarejects out-of-range integers, abytesNvalue longer than N bytes and invalid widths. ShorterbytesNvalues are still right-padded.ExecutionMode.encodeandencode7579ExecuteModereject a selector over 4 bytes, a context over 22 bytes, and acallType/execTypeover one byte. They used to truncate (0x100became call mode). Valid inputs encode as before.
- Some failures now throw, or throw a different type. Check handlers that
catch the old type
(#90):
- Safe with a
publicClient: an RPC error fromproxyCreationCode()now propagates and nothing is cached. A0xor empty result throwsStateError. Before, any failure fell back to the canonical proxy code and cached that address for the account's lifetime, which is wrong for a customsafeProxyFactoryAddress. Without apublicClientnothing changes. - Kernel signing an operation layout that doesn't match its EntryPoint
version throws
ArgumentError. It used to return a signature that could never validate (see Fixed). PimlicoClient.getSupportedTokensthrows when the result is not a JSON array. It used to return[]for any unexpected shape and also accepted an undocumented{tokens: [...]}object.estimateErc20PaymasterCostthrowsStateErrorwhen the token quote has noexchangeRateNativeToUsd. It used to report a cost of $0.
- Safe with a
- Top-level ERC-7579 queries and ERC-20 reads
throw
StateErrorwhen the call returns no data (0x), as viem'sreadContractdoes (#90):isModuleInstalled,supportsModule,getAccountIdandgetInstalledModulesOfTypeused to returnfalse,''or[]. An account returns0xwhen it has no code on that chain, for example because it is not deployed yet. For a counterfactual account, use theSmartAccountClientmethods of the same names. They retry through the factory, as permissionless.js does.getTokenAllowanceandgetTokenBalanceused to return 0 for an address with no code, such as a token on the wrong chain or a mistyped address.getApprovalCallIfNeededand the experimentalprepareUserOperationForErc20Paymasterpass the error on instead of building anapprove()call for a non-token.- The decoders
decode7579BoolResult,decode7579StringResultanddecodeUint256Resultstill map0xto the default value.
Eip7702Authorization.toJsonreturns theyParitywire shape, the same map astoRpcFormat, sojsonEncode(authorization)is what bundlers and viem expect. It used to emit the legacyv(27/28) (#90).GasUnitsrounds sub-wei digits half up, like viem'sparseUnits.GasUnits.parse('1.5 wei')is now 2; it used to truncate to 1. Gwei and ether inputs already rounded this way (#90).- WebAuthn owners are recognised by class.
isWebAuthnAccount(owner)isowner is WebAuthnAccountOwner. AnAccountOwnerthat reportstype == 'webAuthn'without extendingWebAuthnAccountOwneris treated as an ECDSA owner. Kernel and Safe used to crash on it with aTypeError(#90). - SimpleAccount on EntryPoint v0.6 ignores
Call.valuein a batch of more than one call, and this is now documented oncreateSimpleSmartAccount,SimpleSmartAccountConfigandSimpleSmartAccount.encodeCalls. The v0.6 contract'sexecuteBatch(address[],bytes[])has no value field. There is no runtime change, matching permissionless.js. To send value, use a single call or EntryPoint v0.7/v0.8. Every other account and version carries value per call (#90).
Deprecated #
All of these still work. All but the last come from #90.
BundlerClient.sendUserOperationWithAuthorizationandestimateUserOperationGasWithAuthorization. UsesendUserOperation(userOp, authorization: ...)andestimateUserOperationGas(userOp, authorization: ...). The old methods only ever sent the first authorization in the list.PaymasterClient.sponsorUserOperation(chainId:). The parameter was never read, becausepm_sponsorUserOperationtakes no chain id. It is now optional; drop it.PaymasterRpcError. Nothing throws it; paymaster RPC errors arrive asBundlerRpcError.erc20PaymasterGasBuffer. Unused; the cost formula usesPimlicoTokenQuote.postOpGas.shouldUseP256Precompile. UsesupportsRip7212, which it aliased.Hex.encode. UseHex.fromBytes.UserOperationGasEstimate.withMinimumVerificationGas.SmartAccountClientno longer calls it. For an explicit limit, passverificationGasLimittoprepareUserOperation(#90).
Fixed #
-
The Kernel WebAuthn gas-estimation stub was far from a real signature.
getDummyKernelWebAuthnSignature, whichKernelSmartAccount.getStubSignaturereturns for a WebAuthn owner, used an r outside the P-256 curve order. So bundlers priced a signature check that fails early, and estimates came out far too low. It is now byte-identical to the permissionless.js 0.5.2 stub, with the same r, s, authenticatorData and clientDataJSON, and it always encodesusePrecompiled = false. Expect higher, realistic estimates. On a local test chain, Kernel v0.3.1 WebAuthn operations got about 630,000 verification gas, or about 945,000 for the operation that deploys the account. The stub prices the Solidity P-256 verifier, so chains with the RIP-7212 precompile get the same estimate while the operation uses about 120,000. permissionless.js behaves the same; the cost is a larger required prefund. In 0.5.0 the stub could also price the precompile path for the first operation on a chain whose node lacked it, then send the Solidity encoding (#90). -
SimpleSmartAccount.signMessageandEip7702SimpleSmartAccount.signMessageapplied the EIP-191 prefix twice. The signature verified against neither the message nor its hash, soisValidSignatureon Simple7702Account rejected every message signed from Dart. Both now return the owner'spersonal_signof the message. permissionless.js throws forSimpleSmartAccount.signMessagebecause SimpleAccount is not ERC-1271; this package keeps signing so existing callers keep working (#90). -
Kernel signed with the wrong UserOperation hash across versions. Kernel v0.2.x
signUserOperationhashed a v0.7 layout for the v0.6 EntryPoint, and v0.3.xsignUserOperationV06hashed a v0.6 layout for v0.7. Neither signature could validate. Kernel now hashes by its EntryPoint version and implementsSmartAccountV06, soSmartAccountClient.signUserOperationV06accepts Kernel v0.2.x (#90). -
EntryPoint v0.6 operations always used nonce 0.
prepareUserOperationV06never readEntryPoint.getNonce, so every v0.6 operation after the first failed with AA25 unless you passednonceyourself (#90). -
SmartAccountClientestimated and sent to the bundler's EntryPoint. The nonce, paymaster data and signature came fromaccount.entryPoint, but the estimate and the send went tobundler.entryPoint. An EIP-7702 Simple account (v0.8) paired with a bundler built onEntryPointAddresses.v07had a v0.8-signed operation simulated and sent on v0.7. Everything now usesaccount.entryPoint, as viem does (#90). -
The ERC-20 paymaster helper quoted tokens for the wrong EntryPoint.
prepareUserOperationForErc20Paymasterasked Pimlico for quotes against thePimlicoClient's EntryPoint while the operation ran on the account's. When the two differed, the approval went to the wrong paymaster and the cost used the wrongpostOpGasand exchange rate (#90). -
The first EIP-7702 operation on EntryPoint v0.7 reverted with AA10. The client set the
0x7702initCode marker for every first-time 7702 operation, but the marker only exists on EntryPoint v0.8. On v0.7,Eip7702KernelSmartAccountcould never send its first operation. The marker is now set only on v0.8, and on v0.7 the authorization goes alone, as in permissionless.js (#90). -
Paymaster gas limits below 10,000 were replaced. A
paymasterVerificationGasLimitorpaymasterPostOpGasLimitunder 10,000, including the 0 that a paymaster withoutpostOpreturns, was swapped for the bundler's estimate. The operation then carried a different gas field from the one the paymaster signed, which usually fails with AA34. The paymaster's values are now kept (#90). -
The ERC-20 paymaster cost left out paymaster verification gas.
estimateTokenCost,PimlicoClient.estimateErc20PaymasterCostand the experimental helpers under-quoted the token amount, so the approval could be too small. They now share one formula built on the required prefund, as permissionless.js does. Expect higher, correct quotes (#90). -
The experimental ERC-20 paymaster helper dropped the Safe ERC-7579
setupSafewrapper. It re-encoded the calls without it, so the first operation of an undeployed ERC-7579 Safe failed. v0.6 deploying operations now follow the same rule as v0.7 (#90). -
sendUserOperationSyncrejected accounts with a custom EntryPoint address as unsupported, thoughsendUserOperationworked for them. It now reads the account's configured EntryPoint version (#90). -
stateOverridesToJsonlet overrides for the same address replace each other. A balance override and an allowance override for one token kept only the last. Serialization now merges them (#90). -
UserOperationV07.fromJsoncould not read the0x7702factory marker thattoJsonwrites, so a 7702 operation failed to round-trip with aFormatException(#90). -
EIP-7702 authorizations built with a 0/1 recovery id threw "must fit in uint8" from
toRpcFormat. Both 0/1 and 27/28 now work (#90). -
The RIP-7212 probe cached
falseafter one failed call. A timeout or RPC error inisRip7212Supporteddisabled the precompile for that chain for the rest of the process. Now only a real answer is cached; a failed call returnsfalseand the next call probes again (#90). -
GasUnitslost precision throughdouble.parse,gweiToWeiandetherToWeidropped digits past 2^53 and saturated at 2^63 wei, so'10 ether'came back as 9223372036854775807.formatprinted1e+21 ETHfor large values. Both now use exact decimal arithmetic (#90). -
decode7579StringResultmangled non-ASCII text.getAccountIdreturned mojibake (ñ✓becameñâ). It now decodes UTF-8 (#90). -
decode7579Callsrejected upper-case selectors and returned no calls for a truncated batch. It now accepts either case, throws on truncated input, and follows ABI head offsets (#90). -
EtherspotSelectors.executeheld0x61461954instead of the ERC-7579execute(bytes32,bytes)selector0xe9ae5c53. The account's own call data was always correct; only code that read the constant was affected (#90).
0.5.0 - 2026-11-04 #
Parity with permissionless.js 0.5.2: the new sendUserOperationSync
Pimlico action. This release also fixes two signing bugs found by a new property
test that checks every account signs exactly the userOpHash the EntryPoint
verifies, across v0.6, v0.7 and v0.8
(#80). Minor bump: new public API, and v0.7/v0.8 signing now
throws on out-of-range gas fields (see Changed).
Added #
sendUserOperationSync(permissionless.js 0.5.1/0.5.2 parity): newPimlicoActionsextension onSmartAccountClient. It prepares, signs and sends a user operation withpimlico_sendUserOperationNowand returns its receipt. A reverted call comes back assuccess: false, not a throw. If the outcome is unclear it polls for the receipt untiltimeout(default: the bundler RPC timeout) and never resends. Failures throwSendUserOperationSyncError, whosekind(rejected,bundleReverted,pending,notFound) andcanResendsay what happened and whether resending is safe. EntryPoint v0.7 and v0.8 (#87).getUserOperationHashandentryPointVersionOf: public helpers for the EntryPoint v0.7/v0.8 user operation hash, byte-identical to viem, including the EIP-7702initCodedelegation rule (#87).BundlerHttpError: non-200 HTTP responses from the RPC endpoint now throw thisBundlerRpcErrorsubclass, so callers can tell an HTTP failure from a JSON-RPC error. Existingon BundlerRpcErrorhandlers still catch it (#87).- Kernel ERC-1271 helpers: public
wrapMessageHash,signKernelMessageandsignKernelTypedData(unprefixed wrap-and-sign). AccountsignMessage/signTypedDatastill prefix (0x01‖validatoron v0.3.x,0x00on 7702) (#75). sortAddresses: public helper that copies, then sorts addresses by lowercased0xhex (UTF-16 code-unit order). Safe ERC-7579 and Nexus attester encoding use it. Counterfactual addresses are unchanged (#75).
Changed #
- Packed gas fields outside uint128 now throw before signing.
signUserOperationon every v0.7/v0.8 account throwsArgumentErrorwhencallGasLimit,verificationGasLimit,maxFeePerGas,maxPriorityFeePerGas,paymasterVerificationGasLimitorpaymasterPostOpGasLimitis negative or ≥ 2^128. It used to return a signature over a malformed preimage that the EntryPoint would reject.getPackedUserOperation,getAccountGasLimits,getGasFeesandgetPaymasterAndDatathrow the same way. Valid inputs encode byte-for-byte as before; v0.6 is unchanged (#82). - Range-checked low-level encoders.
Hex.fromBigInt(value, byteLength: n)throwsArgumentErrorfor a negative value or one wider thannbytes, and takes a new optionalname:for the error.AbiEncoder.encodeUint128andencodeUint48(new optionalname:) now check 16 and 6 bytes. Calls withoutbyteLengthare unchanged (#82).
Fixed #
- Etherspot and Safe (EntryPoint v0.7):
factorywith a nullfactoryDatano longer signsinitCode = 0x. The EntryPoint hashesfactory ‖ factoryData, so these ops failed with AA24. A nullfactoryDatais now treated as empty. Only callers who setfactorythemselves were affected;getFactoryDataalways returns both fields. Etherspot now matches permissionless.js. Safe intentionally differs from permissionless.js, which has the same bug, and follows the Safe 4337 module instead (#81).
0.4.1 - 2026-07-14 #
EIP-7702 + paymaster release: a paymaster-sponsored first 7702 operation no longer fails AA34. Contributed by @KabaDH in #50; verified live on Sepolia against Pimlico (first-time delegation installed and gas paid in the ERC-20 token by an EOA holding zero ETH).
Fixed #
eip7702Authis now forwarded to paymaster RPCs.PaymasterClient.getPaymasterStubDataandgetPaymasterDataaccept an optionalauthorizationand serialize it aseip7702Authinsideparams[0], matching viem'sformatUserOperationRequest.prepareUserOperationWithAuthpasses the authorization to both calls, so the paymaster simulates against the delegated account instead of an empty EOA.prepareUserOperationForErc20Paymasterno longer discards the signed authorization — it is returned asresult.authorizationfor submission viasendPreparedUserOperationWithAuth.- Paymaster gas limits survive the final
pm_getPaymasterDatacall. The helper now mutates onlycallDataon the prepared operation instead of rebuilding it field by field, mirroring permissionless.js's spread-merge. - Removed a redundant (paid)
pm_getPaymasterDatacall during preparation: the flow is now 1× stub + 1× estimate + a single real data call, matching permissionless.js.
Added #
skipFinalPaymasterDataonprepareUserOperationWithAuth(defaultfalse) to stop after the stub for flows that fetch real paymaster data themselves.example/erc20_paymaster_example.dart— gasless ERC-20 transfer where gas is paid in the token itself, including automatic first-time 7702 delegation.- Per-version example runners and configs for Kernel, Light, Safe, Simple, and Thirdweb accounts (#45).
Changed #
- Bumped
web3dartto 3.0.3 (#36).
0.4.0 - 2026-07-12 #
Parity release: fixes every P0/P1 divergence found by the Dart-vs-JS parity audit and aligns behavior with permissionless.js across accounts, clients, and actions.
Breaking changes #
- Safe default threshold is now
owners.length(all owners must sign), matching permissionless.jstoSafeSmartAccount. Previously defaulted to1. Multi-owner Safes created without an explicitthresholdproduce a different setup calldata and therefore a different counterfactual address. Passthreshold: BigInt.oneto keep the previous 1-of-n default. - Thirdweb salt is now UTF-8-encoded (was hex-decoded), matching permissionless.js
toHex(salt). Any account created with a non-defaultsaltgets differentfactoryDataand a different counterfactual address. The old decoding was a parity bug — addresses it produced never matched the TypeScript SDK's. - ERC-1271
signMessage/signTypedDataoutputs changed across accounts (Light, Thirdweb, Trust, Etherspot, Biconomy, Kernel, Safe). Previous releases double-prefixed digests (EIP-712 wrapper digest signed viapersonal_sign), skipped validator prefixes (Kernel), or omitted the SafeMessage wrapper and eth_sign V adjustment (Safe) — producing signatures that failed on-chainisValidSignature. Signatures now byte-match permissionless.js. - ERC-7579
revertOnErrorexecution-mode bit polarity flipped to match the JS encoding; execution modes built withrevertOnErrornow encode the correctModeSelectorbyte. - ERC-7579 query actions (
supportsModule,supportsExecutionMode,isModuleInstalled,getAccountId) no longer swallow errors tofalse/''. On call failure they retry with the account'sfactory/factoryData(counterfactual path), matching permissionless.js; other errors propagate.
Added #
- PasskeyServerClient (
createPasskeyServerClient) — port of permissionless.jsclients/passkeyServer+actions/passkeyServer. Exposes all fivepks_*RPC methods:startRegistration,verifyRegistration,startAuthentication,verifyAuthentication, andgetCredentials. Placed in the corepermissionlesspackage for JS layout parity (client-side passkey creation remains inpermissionless_passkeys). PublicClient.calldeployless factory path — optionalfactory/factoryDataparameters perform a viem-style deploylesseth_callviadeploylessCallViaFactoryBytecode, enabling counterfactual ERC-7579 reads.BundlerRpcError.aaErrorDescription— short descriptions for known ERC-4337 AA## codes;toStringincludes the description when available.CallsStatus.parseCallsStatusCode— public helper matching viemgetCallsStatusnumeric ranges and legacy string statuses.
Changed #
- Safe batch
encodeCallsroutes through MultiSendCallOnly (not MultiSend), matching permissionless.js safety property (no inner delegatecalls). - Safe stub signatures byte-match permissionless.js (ECDSA ecrecover-path dummy and WebAuthn dummy with realistic authenticatorData / long clientDataFields).
writeContractnow encodes calldata via web3dart's ABI encoder instead of a hand-rolled encoder that mis-encoded dynamicbytesand lacked support for strings, arrays, and tuples.
Fixed #
-
Four wrong hard-coded ERC-7579 selectors (
utils/erc7579.dart):uninstallModule(0xa4d6f1d2→0xa71763a8),isModuleInstalled(0x6d61fe70→0x112d3a7d),supportsModule(0x12d79da3→0xf2dc691d), andaccountId(0x7b60424a→0x9cfd7cff). Previously, uninstall calldata reverted and queries silently returnedfalse/''. -
Kernel v0.2.4
execute/executeBatchnow use the Kernel v2 selectors (0x51945447/0x34fcd5be) with matching parameter encoding; the previous SimpleAccount-style calldata reverted on every v0.2.4 call. -
Nexus
signUserOperationreturns the bare 65-byte signature, matching permissionless.js. Previously the K1 validator address was prepended (85 bytes), causing AA24 signature errors on-chain (Nexus selects the validator via the nonce key). -
Pimlico client actions aligned with the Pimlico API:
validateSponsorshipPoliciessendspm_validateSponsorshipPolicies(was a nonexistentpimlico_*method),estimateErc20PaymasterCostcomputes the cost locally from quotes (was calling a nonexistent RPC method), andsendCompressedUserOperationsends the correct 3-parameter shape. -
Safe v1.5.0
MULTI_SEND_CALL_ONLYaddress corrected to0xA83c336B20401Af773B6219BA5027174338D1836. -
Simple account EntryPoint-version encode/sign paths: v0.6
executeBatchemits the v0.6 selector0x18dfb3c7(address[],bytes[]) instead of the v0.7 3-array form, and v0.8 non-7702 batching/signing follow the v0.8 shapes. -
EntryPoint v0.6
signUserOperationis now implemented for accounts that accept a v0.6 configuration (previously configured-but-unimplemented: accounts derived v0.6 addresses, then threw or mis-packed at signing). -
Safe CREATE2 address derivation fetches
proxyCreationCode()from the configured SafeProxyFactory viapublicClientwhen available, with fallback to the verified hardcoded v1.4.1 constant. Avoids silent getAddress-vs-deploy mismatch for v1.5.0 and custom factories. -
BundlerRpcError.aaErrorCodescans bothmessageanddata, case-insensitively (matches viemgetBundlerError); previously only scanneddatawithAA\d+. -
CallsStatus.fromJsonaccepts walletstatusfield, numeric strings, and legacy"CONFIRMED"/"PENDING"strings without throwing onas int.
Deliberate deviations from permissionless.js (parity audit 018) #
The following items were reviewed and intentionally not ported in this release:
- EIP-712 edge cases (
message_hash.dart): customEIP712Domaintypes, value-range/bytesNvalidation, and UTF-8 type-string hashing remain deferred. Standard ASCII domains and types match JS/viem. - ERC-20 paymaster flow shape (
experimental/pimlico/erc20_paymaster.dart): Dart still uses a stub+real estimation path with a re-fetch rather than JS's stub-substitution + single final data fetch; standalone function API vs JS decorator remains. Functional sponsorship works; round-trip efficiency is a follow-up. - install/uninstall / signMessage / sendTransaction surfaces: per-op
paymaster/authorization/appended-
callsoverrides on install/uninstall, raw-bytessignMessage, and batch/userop-paramssendTransactionare not ported (narrower Dart API; core flows work via existing methods). AccountNotFoundError: structurally unnecessary — Dart always requires an account onSmartAccountClientconstruction, so the JS error cannot arise at action time.
0.3.0 - 2026-04-17 #
Added #
useMultiSendForSetupoption onSafeSmartAccount/createSafeSmartAccount— port of the same option from permissionless.js@0.3.5.- Default
truepreserves the existing MultiSend-wrapped setup — no changes to counterfactual addresses for existing users. - When
falseand there is exactly one setup transaction (the defaultenableModulescall, no WebAuthn owners, no ERC-7579 modules),Safe.setupis called directly with that call'sto/datainstead of being wrapped through MultiSend. - Set
useMultiSendForSetup: falseto produce CREATE2 addresses compatible with Safe Protocol Kit / relay-kit address derivation. - The flag has no effect in ERC-7579 mode (the launchpad path is independent) or when a WebAuthn owner is present (extra setup calls force MultiSend).
- Default
0.2.0 - 2026-02-20 #
Added #
- RIP-7212 Dynamic Detection:
isRip7212Supported(PublicClient)probes the P256 precompile viaeth_callwith a known-valid Wycheproof test vector, detecting support on any chain- Results cached per chain ID for the lifetime of the application
clearRip7212Cache()for testing- Falls back gracefully when the precompile is not deployed (revert →
false)
- RIP-7212 Static Detection:
supportsRip7212(chainId:)andshouldUseP256Precompile(chainId:)check against a curated set of 67 chain IDs known to support the P256 precompile - RIP-7212 Chain Support: Comprehensive
rip7212SupportedChainIdsset. - RIP-7212 Constants:
p256PrecompileAddress(0x0000...0100) - Kernel Precompile Integration: Kernel WebAuthn accounts now dynamically detect P256
precompile support via
isRip7212Supportedwhen apublicClientis availablesignUserOperation,signMessage,signTypedDatause dynamic detection (async)getStubSignatureuses static chain ID list (sync, for gas estimation)- Falls back to static
shouldUseP256Precompilewhen nopublicClientis configured
Changed #
- Dependencies: Bumped
web3dartto^3.0.2 - Monorepo: Restructured as a Dart pub workspace monorepo
- Package moved to
packages/permissionless/ - Uses native Dart pub workspaces (
resolution: workspace) - Melos 7.x for workspace management
- Package moved to
- SDK: Minimum SDK version bumped to
>=3.5.0(required for pub workspaces)
Added #
- Passkeys Package: New
permissionless_passkeyssibling package for WebAuthn/Passkeys support
0.1.3 - 2025-12-29 #
Fixed #
- WebAuthn/Passkeys: Fixed Safe account
isWebAuthndetectionSafeSmartAccount.isWebAuthnnow correctly returnstruewhen WebAuthn owners are configured- This enables proper gas estimation with 900k minimum verification gas for P256 on-chain verification
- Previously always returned
false, causing AA26 (over verificationGasLimit) errors
- WebAuthn/Passkeys: Fixed paymaster gas limit handling for WebAuthn accounts
- Smart fallback logic for paymaster verification and post-op gas limits
- Uses stub values when valid, falls back to bundler estimates when needed
- Fixes AA33 (paymaster reverted) errors for Kernel WebAuthn accounts
- Nonce: Fixed
nonceKeynot passed togetAccountNonce()inSmartAccountClient- Kernel v0.3.x accounts now correctly fetch nonces using their validator-encoded nonce key
- Safe accounts unaffected (use default key 0)
Added #
- Examples: Added WebAuthn examples for Safe and Kernel accounts
example/safe_webauthn_example.dart- Safe with passkey ownerexample/kernel_webauthn_example.dart- Kernel v0.3.1 with WebAuthn validator
0.1.2 - 2025-12-18 #
Changed #
- Documentation: Achieved 100% dartdoc coverage (1192/1192 API elements)
- Added documentation to all
fromJsonfactory constructors - Documented all UserOperation fields for both v0.6 and v0.7
- Added dartdoc comments to Safe, Kernel, Pimlico, and Paymaster types
- Documented all public class constructors and their parameters
- Added field-level documentation for gas limits, fees, and paymaster data
- Added documentation to all
0.1.1 - 2025-12-18 #
Changed #
- BREAKING: Replaced custom
EthAddressclass withEthereumAddressfrom thewalletpackageEthAddress('0x...')→EthereumAddress.fromHex('0x...')EthAddress.zero→zeroAddress(top-level constant)- Added
EthereumAddressExtensionwith.hex,.checksummed,.bytes,.isZero,.toAbiEncoded()methods - Added
StringToAddressextension:'0x...'.toAddress()
- BREAKING: Removed
includeFactoryDataparameter fromSmartAccountClientmethodsprepareUserOperation,prepareUserOperationWithAuth,sendUserOperation,sendUserOperationAndWaitprepareUserOperationV06,sendUserOperationV06,sendUserOperationV06AndWait- The SDK now automatically detects deployment status via
publicClient.isDeployed()and includes factory data only when needed - Important:
publicClientparameter is now required inSmartAccountClientconstructor for auto-detection to work - This simplifies the API - users no longer need to track deployment status themselves
- Added
walletpackage as direct dependency forEthereumAddresstype
Fixed #
- Improved interoperability with web3dart ecosystem by using standard types
- Fixed inconsistency between v0.6 and v0.7 UserOperation preparation
- v0.6 now properly checks deployment status before including
initCode, matching v0.7 behavior
- v0.6 now properly checks deployment status before including
0.1.0 - 2025-12-15 #
Initial release of permissionless.dart - a Dart implementation of permissionless.js for ERC-4337 smart accounts.
Added #
Smart Accounts
- SafeSmartAccount - Gnosis Safe with 4337 module support
- Safe v1.4.1 (EntryPoint v0.6 and v0.7)
- Safe v1.5.0 (EntryPoint v0.7)
- Multi-signature support with threshold
- EIP-712 typed data signing
- SimpleSmartAccount - Minimal single-owner account
- EntryPoint v0.6 and v0.7 support
- Eip7702SimpleSmartAccount - EIP-7702 delegated Simple account
- EOA code delegation support
- EntryPoint v0.7
- KernelSmartAccount - ZeroDev's modular account
- Kernel v0.2.4 (EntryPoint v0.6)
- Kernel v0.3.1 (EntryPoint v0.7, ERC-7579 compliant)
- Eip7702KernelSmartAccount - EIP-7702 delegated Kernel account
- EOA code delegation with modular architecture
- EntryPoint v0.7
- EtherspotSmartAccount - ModularEtherspotWallet (EntryPoint v0.7)
- ERC-7579 modular architecture
- NexusSmartAccount - Biconomy's ERC-7579 modular account (EntryPoint v0.7)
- K1 validator for ECDSA signatures
- LightSmartAccount - Alchemy's gas-efficient account
- Version 1.1.0 (EntryPoint v0.6)
- Version 2.0.0 (EntryPoint v0.7, signature type prefix)
- ThirdwebSmartAccount - Thirdweb SDK smart account
- EntryPoint v0.6 and v0.7 support
- TrustSmartAccount - Trust Wallet's Barz account
- Diamond proxy pattern (EIP-2535)
- EntryPoint v0.6 only
- BiconomySmartAccount (deprecated) - Use NexusSmartAccount instead
Clients
- BundlerClient - ERC-4337 bundler RPC methods
eth_sendUserOperationeth_estimateUserOperationGaseth_getUserOperationReceipteth_getUserOperationByHasheth_supportedEntryPointswaitForUserOperationReceipt- Polling with configurable timeout
- PaymasterClient - Paymaster integration
pm_getPaymasterStubDatapm_getPaymasterDatapm_validateSponsorshipPolicies
- SmartAccountClient - High-level account operations
prepareUserOperationsignUserOperationsendUserOperationsendPreparedUserOperationwaitForReceipt
- PimlicoClient - Pimlico bundler extensions
pimlico_getUserOperationGasPricepimlico_getUserOperationStatuspimlico_sendCompressedUserOperationgetSupportedTokens- Get supported ERC-20 tokens for gas paymentgetTokenQuotes- Get exchange rates and paymaster info for tokens
- EtherspotClient - Etherspot (Skandha) bundler extensions
skandha_getGasPrice
- PublicClient - Standard Ethereum JSON-RPC
eth_chainIdeth_getCode/isDeployedeth_calleth_getTransactionReceiptgetSenderAddressgetAccountNonce
Smart Account Actions
signMessage- EIP-191 personal message signing for all accountssignTypedData- EIP-712 typed data signing for all accounts
ERC-7579 Actions
installModule- Install a single module on the smart accountinstallModules- Batch install multiple modules in one UserOperationuninstallModule- Remove a module from the smart accountisModuleInstalled- Check if a module is installed on an accountsupportsModule- Check if an account supports a module type
ERC-20 Paymaster Support (Experimental)
prepareUserOperationForErc20Paymaster- Prepare UserOperations for ERC-20 gas payment- Automatic token approval injection
- USDT special case handling (approval reset)
- Max cost calculation in tokens
estimateErc20PaymasterCost- Estimate gas cost in ERC-20 tokens
Constants
EntryPointAddresses- Canonical EntryPoint contract addresses- v0.6, v0.7, and v0.8 support
EntryPointVersion- Enum for version selection
Types
UserOperationV06- EntryPoint v0.6 UserOperationUserOperationV07- EntryPoint v0.7 UserOperationEthereumAddress- Ethereum address type (from wallet package) with extensionsCall- Transaction call representationTypedData/TypedDataDomain/TypedDataField- EIP-712 typed dataCallsStatus/CallReceipt- ERC-5792 response typesPackedUserOperation- Packed UserOperation format utilitiesEip7702Authorization- EIP-7702 EOA code delegation authorizationAccountOwner/PrivateKeyOwner- Unified owner interface for all signing modes
Utilities
- Gas Estimation
totalGasLimitcalculationgetRequiredPrefundfor account funding- Gas multipliers for estimation buffers
- ERC-7579 - Modular account call encoding
encode7579Executefor single callsencode7579ExecuteBatchfor batch callsencodeInstallModule/encodeUninstallModuledecode7579Calls
- ABI Encoding - Solidity ABI encoding utilities
AbiEncoder.encodeAddressAbiEncoder.encodeUint256AbiEncoder.encodeBytes
- MultiSend - Safe batch transaction encoding
encodeMultiSendencodeMultiSendCall
- Message Hashing
hashMessage- EIP-191 personal message hashhashTypedData- EIP-712 typed data hash
- PackedUserOperation Utilities
packUserOperation/unpackUserOperationtoPackedUserOperation/fromPackedUserOperation
- ERC-20 Utilities
encodeApprove/encodeTransfer- Token operation encodingErc20Selectors- Function selector constantserc20BalanceOverride- Simulate token balanceserc20AllowanceOverride- Simulate token allowancesmergeStateOverrides- Combine multiple state overrides
- Units - Wei/Gwei/Ether conversions
parseEther/formatEtherparseGwei/formatGweiparseUnits/formatUnits
- Hex Utilities
Hex.concat/Hex.sliceHex.fromBigInt/Hex.toBigIntHex.fromBytes/Hex.decode
- Nonce Utilities
encodeNonce/decodeNonce- 2D nonce encoding
Examples
simple_example.dart- Simple account usagesafe_example.dart- Safe account with multi-sigsafe_7579_example.dart- Safe with ERC-7579 moduleskernel_example.dart- Kernel v0.3.1 (ERC-7579)kernel_v024_example.dart- Kernel v0.2.4 (EntryPoint v0.6)etherspot_example.dart- Etherspot modular accountlight_example.dart- Light account with version comparisonnexus_example.dart- Nexus (Biconomy) accountbiconomy_example.dart- Legacy Biconomy accountthirdweb_example.dart- Thirdweb accounttrust_example.dart- Trust Wallet Barz accounteip7702_simple_example.dart- EIP-7702 Simple account delegationeip7702_kernel_example.dart- EIP-7702 Kernel account delegationerc20_paymaster_example.dart- ERC-20 gas paymenterc7579_modules_example.dart- Module installation and management