Aevum Builder Challenge · Testnet

Give an agent a key that can only spend a little.

SpendGuard is a scoped session-key vault for tUSD8 on the Aevum testnet. Deposit once. Grant a key that pays only approved recipients, within a cap, before an expiry. Take it back in one click. The contract enforces every bound, not the interface.

Deposit once, grant a key with a cap and an expiry, take it back in one click.

Open the app

Vault dashboard

0x048a…65Ac · chain 44005

Vault balance

…tUSD8

Read live from the contract

Active sessions

…

0 granted in total

Payments executed

…

All within caps

Vault owner

…

Grants, revokes, pause, sweep

Recent activity

Loading on-chain activity…

Data refreshes automatically over the public RPC. Full history on the Aevum explorer.

…
tUSD8 in the vault, live
…
Sessions granted, on-chain
…
Payments executed, on-chain
44,005
Aevum testnet chain id
Why SpendGuard

Agents need to pay. Giving one your wallet key is how a small mistake becomes a total loss.

SpendGuard turns spending authority into something you can grant. The owner keeps the only full key. Every agent, bot, or cashier gets a session key that pays only approved recipients, only up to a cap, only until an expiry. The contract enforces every bound. A compromised key can lose at most its remaining cap, and the owner takes it back in one click.

0Security invariants in the threat model, all tested
0/56Foundry tests passing, including 15 scripted adversarial scenarios
0Randomized fuzz calls in the invariant suite, zero failures
How it works

Three steps to bounded spending

Aevum has no session-key tooling yet. The official SDK ships in Q1 2027, and no published bundler, paymaster, or factory is usable by builders today. SpendGuard is that missing piece, built in plain Solidity. It works on the testnet now, with a plain wallet.

1

Deposit once

Approve exactly the amount you want to deposit, then deposit it. The vault pulls exactly that amount. No unlimited approvals anywhere. It credits what actually arrived.

2

Grant a session key

Name the key, its recipient allowlist, its per-payment limit, its total cap, and its expiry. Review the summary, sign once. The key is live the moment the grant is mined.

3

The key pays, within bounds

The session key pays merchants itself. Every payment is checked on-chain: caller, active, unexpired, within caps, recipient allowlisted, vault funded, vault unpaused. Anything else reverts with a plain-language reason.

Revoke in one click

A revoked key can never spend again. Re-granting starts fresh at zero spent.

Expiry is a hard cutoff

A payment in the exact expiry second reverts. There is no grace period to exploit.

Testnet only, test tokens only

SpendGuard runs on the Aevum testnet with tUSD8 test tokens. No tokens are issued or promised.

Core capabilities

Bounded delegation, enforced by the contract

The interface shows state and submits transactions. It never authorizes anything. Every check lives in the vault itself.

Scoped session keys

Each key carries its own allowlist, per-payment limit, total cap, and expiry. A key is good for exactly one job. Nothing more.

Caps that cannot be bypassed

Every check runs on-chain before the transfer. No frontend, script, or prompt can talk the contract out of it.

Instant revocation

One owner transaction and the key is dead forever. A fresh grant starts at zero spent. A revoked key never comes back.

Full audit trail

Every deposit, grant, payment, revoke, and sweep emits an event. The full history of the vault is readable on-chain. No logins. No private database.

For developers

Build with SpendGuard, don't rebuild it

A TypeScript SDK that wraps the factory and vaults. Create a vault, grant a session key, pay within bounds, revoke in one click. It follows the Aevum rules for you: legacy transactions, the 1,000-block log limit, exact approvals.

npm install spendguard-sdk viem

const { vault } = await client.createVault();
await client.deposit(vault, toBaseUnits("3.00"));
await client.grantSession(vault, {
  sessionKey: agent,
  recipients: [merchant],
  maxPerTx: toBaseUnits("0.10"),
  spendCap: toBaseUnits("1.00"),
  expiresAt: 1795363200n, // one week out
}, { fundGas: true }); // also sends 0.01 tQDAY so the key can pay gas
Guarantees

What the contract promises

Bounded loss, always

The worst case for one compromised key is its remaining cap. A stolen key, a malicious recipient, reentrancy, a frontrun: none of them turns a bounded loss into a vault drain.

Proven by INV-1, INV-9, INV-10 in the threat model.

Pause never blocks recovery

Pausing freezes every payment instantly. The owner sweep works in every state: paused, keys revoked, keys expired. Recovery is never locked behind the circuit breaker.

Proven by INV-4, INV-6 and adversarial test T-7.

No silent state changes

Every state-changing operation emits an event with full parameters. If it happened, it is on the chain, readable by anyone, forever.

Proven by INV-15; verified in the unit suite with event assertions.

Three roles, one vault

Built for whoever holds the key

Full control, one key, zero sharing

You deposit once and hand out bounded keys instead of your wallet. You see every session's spent against its cap, live. You can revoke any key, pause all payments, or sweep the whole balance at any moment, including while paused.

  • Grant with a confirmation summary: key, recipients, caps, expiry
  • One-click revoke. Immediate once mined.
  • Pause freezes spending, never recovery
Setup guide

From zero to a working session

Five steps. No code, no SDK, no smart account. A plain browser wallet is enough.

1

Install a wallet

Install MetaMask, Rabby, or any injected wallet in your browser. SpendGuard works with plain wallets. No smart account is needed.

2

Add the Aevum testnet

Connect your wallet on this page and approve the network switch when your wallet asks. If your wallet cannot add the network on its own, add it manually with these values:

Network nameQDay Aevum Testnet
Chain ID44005
RPC URLhttps://rpc-test.qday.info
Explorerhttps://explorer-test.qday.info
CurrencytQDAY
3

Claim test tokens

You need tQDAY for gas and tUSD8 to deposit. The web faucet gives 1 tUSD8 per claim, with a 24 hour cooldown. The Discord #faucet channel gives 1 tQDAY plus 5 tUSD8 once per person. Gas costs a fraction of a tQDAY per transaction.

4

Deposit

Connect your wallet, open the vault below, and approve exactly the amount you want to deposit. The vault pulls exactly that amount and credits what actually arrived.

5

Grant a key

Name the key, its recipients, its per-payment limit, its total cap, and its expiry. Sign once. The key pays within those bounds, and you can revoke it in one click.

You are ready

The vault is live on the Aevum testnet with real test tokens. Deposit, grant, pay, and revoke for real.

Open the vault
FAQ

Questions, answered honestly

A session key is an address the vault owner authorizes to spend within tight bounds: approved recipients, a maximum per payment, a maximum total, and an expiry time. The key has no other power. It cannot grant, revoke, pause, or sweep.

The thief can spend at most the key's remaining cap, only to its approved recipients, only until expiry. The owner can revoke the key instantly. The loss is bounded by design. It can never become a vault drain. Keep caps small and expiries short, and revoke fast.

Yes. The owner sweep recovers the full remaining balance in every state: paused or not, keys revoked or expired. Pausing freezes payments only. It never blocks recovery.

No. QDay's session-key and smart-account infrastructure is announced but has no published bundler, paymaster, factory, or SDK addresses usable by builders, and the official SDK ships in Q1 2027. SpendGuard implements scoped session keys natively in Solidity, so it works today with plain wallets. No ERC-4337, ERC-8004, or x402 integration is claimed.

Both come from the Aevum faucets: the web faucet at faucet.qday.info gives 1 tUSD8 per claim with a 24-hour cooldown, and the Discord #faucet channel gives 1 tQDAY plus 5 tUSD8 once per person. Gas on the testnet is a fraction of a tQDAY per transaction.

No, and that is deliberate. Caps, recipients, spent amounts, and expiries are readable on-chain by anyone. That transparency is the audit trail. SpendGuard promises no privacy it does not deliver.

Nothing but testnet gas. There are no fees, no subscriptions, and no tokens. This is a hackathon build on a testnet, and the vault charges nothing for deposits, grants, or payments.

Stop handing agents your wallet key.

Grant a bounded key instead. The vault is live on Aevum testnet. Deposit, grant, pay, and revoke for real, with test tokens.

Open the app