updated 5mo ago
Use this skill when the user wants to integrate an external service, dApp, or backend with the wallet contracts in this repository.
Platon Aawallet で何ができる?
name: platon-aawallet description: Guide for third-party integrators to use this repository's ERC-4337 AA wallet contracts from any language or SDK, including wallet creation, address prediction, UserOperation construction, paymaster integration, signature packing, and troubleshooting.
PlatON AAWallet Integration
Use this skill when the user wants to integrate an external service, dApp, or backend with the wallet contracts in this repository.
This skill is for third-party integration, not for contract development, protocol design, or contract deployment authoring.
What this skill covers
- Understanding the main contracts involved in third-party integration
- Preparing required chain and contract configuration
- Creating wallets or predicting wallet addresses
- Building
initCodeandUserOperationpayloads in a language-agnostic way - Integrating
SponsorPaymasterorTokenPaymaster - Troubleshooting common integration failures
Main contracts
BaseWallet: wallet implementation and signature validation entryWalletProxyFactory: wallet address prediction and wallet creationEntryPoint: ERC-4337 execution entryTokenPaymaster: token-based gas paymentSponsorPaymaster: sponsor-funded gas payment
Read the project-specific interface details from:
references/overview.mdreferences/contract-api.mdreferences/signature-model.md
Workflow
- Identify the user's goal:
- understand the architecture
- prepare integration config
- create or predict a wallet
- build
initCode - build
UserOperation - integrate a paymaster
- troubleshoot a failed request
- Read only the relevant reference files:
references/overview.mdreferences/prerequisites.mdreferences/contract-api.mdreferences/signature-model.mdreferences/cases-create-wallet.mdreferences/cases-userop.mdreferences/cases-paymaster.mdreferences/troubleshooting.md
- Answer using this structure when useful:
- goal
- prerequisites
- contract flow
- minimal
viemexample - project-specific notes
- common mistakes
Repository-specific rules
These rules are critical. Prefer them over generic ERC-4337 patterns.
1. Signature format is project-specific and must be described at byte level
Do not assume a plain raw signature over userOpHash is sufficient.
This repository uses:
- project-specific signature mode values
- project-specific signature packing
- derived signing hashes based on
userOpHash - ordered multi-owner signature concatenation
When describing signing, prefer the repository's signing model over generic signMessage(userOpHash) examples.
The explanation must be language-agnostic first, with byte layout, field order, and hash derivation explicit enough for Go, Rust, Java, or TypeScript implementations.
If a generic viem signing example is shown for orientation, clearly label it as conceptual and not the final production format.
For final code intended to run against this repository:
- do not set
userOp.signatureto a rawsignMessage({ raw: userOpHash })result - do not use an EIP-191 prefixed message signing flow as the production signature
- do use the repository's derived signing hash and packed signature wrapper
- do prefer the exact owner-flow details in
references/signature-model.md
2. Standard execution path uses module-wrapped calls
In this repository, tested ERC-4337 execution flows typically do not use top-level userOp.callData = BaseWallet.execute(...).
Instead, the normal path is:
- encode
BaseWallet.execute(...) - wrap it inside
ModuleManager.executeFromModule(...)
This works because the wallet enables EntryPoint as a module during setup.
3. First wallet creation with TokenPaymaster has special constraints
If the wallet is being created in the same UserOperation and TokenPaymaster is used:
initCodemust point to the configured wallet factory flowcallDatamust useexecuteBatchFromModule(bytes[])- batch items must encode
BaseWallet.execute(...) - the flow must include token
approve(...)for the paymaster
Do not describe first-activation token paymaster usage as a generic paymaster flow.
4. Owner ordering matters
When multiple owners sign:
- owner addresses must be handled consistently
- signatures must be concatenated in ascending owner-address order
Do not treat multi-owner signatures as unordered.
5. Counterfactual address inputs must match exactly
Wallet prediction and wallet creation must use the exact same:
- wallet logic address
- initializer bytes
- salt
- factory
Any difference in setup inputs such as owners, threshold, fallback handler, initializer target, initializer data, or lock period changes the derived wallet address.
6. Do not confuse factory address with wallet address
WalletProxyFactory and the deployed wallet instance are different contracts with different roles.
For final code:
- do not use
walletFactoryasuserOp.sender - do use the predicted wallet address or the already deployed wallet address as
sender - do verify wallet identity by reading wallet methods such as
entryPoint(),threshold(),owners(...), orisOwner(...)when troubleshooting
If those wallet reads revert, first suspect that the address is not a wallet instance.
7. For deployed wallets, prefer reading nonce from BaseWallet.nonce()
In this repository, deployed-wallet integrations should first read nonce from the wallet itself.
- do prefer
BaseWallet.nonce()for an already deployed wallet - only use
EntryPoint.getNonce(...)when the target deployment is confirmed to expose and support that path - do not silently fall back to
0when nonce reads fail
8. Prefer protocol rules over SDK-specific examples
This skill may include viem examples for convenience, but those examples are not the actual contract interface specification.
For any topic that affects interoperability across languages, make sure the answer includes:
- exact field order
- exact hashing inputs
- exact byte layout
- ordering rules
- any repository-specific deviations from generic ERC-4337 assumptions
The goal is that an integrator using Go, Rust, Java, Python, or TypeScript can implement the flow directly from the skill without depending on viem.
Constraints
- Prefer language-agnostic protocol descriptions first
viemexamples are optional convenience examples, not the primary specification- Prefer examples specific to this repository's contracts
- Prefer scenario-driven answers over abstract API descriptions
- Do not give broad ERC-4337 explanations unless they are needed to explain this repository's behavior
- Do not present speculative paymaster or signature formats as confirmed behavior
Output style
When possible, provide:
- the contract(s) involved
- required inputs
- exact order of operations
- a minimal
viemexample - the main project-specific constraints
- the likely failure points
Reference map
- architecture overview:
references/overview.md - required config and deployment inputs:
references/prerequisites.md - main contract interfaces:
references/contract-api.md - signature rules:
references/signature-model.md - wallet creation flows:
references/cases-create-wallet.md - user operation flows:
references/cases-userop.md - paymaster flows:
references/cases-paymaster.md - error diagnosis:
references/troubleshooting.md
インストール
Platon Aawallet をクライアントに追加します。お使いのものを選んでください。
npx skills add PlatONnetwork/platon-dev-skillsInstalls every skill in the repository, then prompts for which to keep.
/plugin marketplace add PlatONnetwork/platon-dev-skillsAdds the repository as a plugin marketplace; install individual plugins with `/plugin install`.
git clone https://github.com/PlatONnetwork/platon-dev-skills
cp -r platon-aawallet ~/.claude/skills/A skill is a plain directory. Copy it into `.claude/skills/` in a project or in your home directory.
スコア
66 / 100
良好