Skip to content
MandatesMake your own

Make your own agent wallet.

Connect a NEAR testnet wallet, give a new agent a budget and rules, fund it, then try to steal from it yourself. You sign every step; the agent only ever gets a key that can ask for payments.

Step 1

Connect a testnet wallet

Meteor, Intear, Nightly, Ledger and other NEAR wallets that support testnet. No testnet NEAR yet? Get some from the NEAR testnet faucet. You will sign every step yourself; this page never sees your wallet key.

  1. Set the rulesToken, budget, cap per payment, guardian threshold, allowed shops, expiry. One approval creates the agent, the guardian and the mandate.
  2. Fund itwNEAR (wrapped in the same transaction) or testnet USDC goes into the mandate, not to the agent.
  3. Be your own agentPay with the agent's key, gasless through the relayer. Then try to overspend.
  4. Revoke and withdrawStop the agent at any time and take back what is left.
No wallet?

Simulate the rules in your browser first

Mandate settings

Change any value, then try a payment on the right. The same rules as the contract run here, in your browser.

Must be distinct from the agent account.

Create it for real: connect a wallet above

This form only checks your input and shows the contract call. To create a real mandate on testnet, connect a wallet at the top of this page. To pay as an agent without a wallet, open Try to steal.

Try a payment

Pretend to be the agent. The same rules as the contract run here in your browser. No wallet needed, nothing is sent.

Or try an attack:

Press a button to see what the contract would do.

Simulation only. The recorded runs on testnet are listed on the verify page.

Show the contract call this form builds

The create_mandate call

JSON

The arguments this form would send. Amounts are exact token units (6 decimals for USDC), computed with BigInt, never floating point.

{
  "agent": "agent.example.testnet",
  "guardian": "guardian.example.testnet",
  "token": "usdc.example.testnet",
  "budget": "50000000",
  "per_payment_cap": "5000000",
  "approval_threshold": "2000000",
  "expires_at_ms": 1794700740000,
  "recipients": [
    "merchant-a.example.testnet",
    "merchant-b.example.testnet"
  ]
}

The contract refuses to create a mandate unless

  • the budget is at least the cap per payment, and the approval threshold at most the cap
  • owner, agent and guardian are three different accounts
  • there are 1 to 16 distinct recipients
  • the expiry is in the future