Setup (one-time)
Before the agent can transact, the developer configures the account: The developer has configured:- Spending limit: 1000 USDC per day
- Allowed contracts: Uniswap Router only
- Rate limit: 10 transactions per hour
The transaction
The agent wants to swap 500 USDC for ETH on Uniswap.Step 1: Agent signs
The agent signs a UserOp with its session key. The UserOp contains the swap calldata targeting the Uniswap Router.Step 2: Signature validation
The validator confirms: this is keyId 0xabc, the signature is valid, and the key is active in the KeyStore.Step 3: Policy enforcement (preCheck)
Step 4: Execution
The smart account executes the Uniswap swap. 500 USDC leaves the account, ETH arrives.Step 5: Post-execution verification (postCheck)
What each component did
| Component | Role |
|---|---|
| KeyStore | Confirmed keyId 0xabc is active and valid |
| WebAuthnValidator | Verified the P-256 signature against the KeyStore |
| FunctorPolicyHook (pre) | Enforced all policies, collected fee, cached state |
| Smart Account | Executed the Uniswap swap |
| FunctorPolicyHook (post) | Updated counters, verified outcome, emitted audit event |