SKUdesk
SKUdesk/Contracts
Robinhood Chain Testnet · Run + live chain reads
Desk

Contracts

The contracts behind every number on this site, deployed on Robinhood Chain Testnet.

What you are looking at

Smart contracts, small programs that live on a blockchain, and the wallets that play each role. The vault (SKUdeskCore) enforces the owner’s mandate. At the end of the run it held $5,913.50 of testnet money FIXED SNAPSHOT · end of run. Every address below is real and opens on the block explorer, where you can read the verified source code.

An address is an account on the chain. Source verified means the explorer compiled the published source and confirmed it produces exactly the code that is deployed. Deployed at block 128,228,499. Contracts are not audited. They are testnet prototypes; use test money only.

Deployed contracts chain id 46630 ONCHAIN · addresses open on the explorer

SKUdeskCore

The vault and rulebook. It holds the money, stores the owner’s mandate, re-derives the agent’s economics, derives the spend itself, and moves each lot through a fixed set of states. This is the contract every page on this site reads.

0x3799747B933Ed7FEfAd6097998749Fd95fCD8c2A
Source file
packages/contracts/src/SKUdeskCore.sol
Deploy block
128,228,499
Constructor

Constructor also sets the starting mandate: $2,500.00 per trade, $5,000.00 new commitments per UTC day, 18% margin floor, 180s quote freshness. The deployer becomes the owner.

Test USDG (mUSDG)

A testnet stand-in token with 6 decimals and an owner-only mint. It exists because the real testnet USDG cannot be minted publicly. It is not USDG and not real USDC; it has no value.

0x0B71c1B397A9d33198e0A6a5701E12011AC84D95
Source file
packages/contracts/src/MockUSDC.sol
Deploy block
128,228,499
Constructor
none

No constructor arguments. The deployer becomes the token owner.

AgentFactory

Creates a user’s agent in one transaction: a MandateVault owned by the caller, a locked ERC-4337 account that is the vault’s only agent, and an identity token. Used by the Deploy agent page.

0xeA8407948e8BE12Ea2365d1BEdBADf364aadaaE0
Source file
packages/contracts/src/AgentFactory.sol
Deploy block
128,228,618
Constructor

Each agent is registered in that ERC-8004 registry and the token is handed to its owner. The vault and account it creates are separate contracts (MandateVault and AgentAccount); their addresses are in the AgentCreated event and on the Deploy your agent page.

TokenFaucet

Gives each wallet 1,000 test mUSDG once a day so a visitor can fund their own vault. Test money only.

0x4A349Eb630157881e9c39d2eEB0Aa5879Ca764FD
Source file
packages/contracts/src/TokenFaucet.sol
Deploy block
128,228,618
Constructor

Pre-funded with 500,000 mUSDG by the token owner.

BlindBook

The sealed-bid market on the Agent market page. Traders commit a hidden order, reveal it, and each round the contract clears everything at one price. The traded units are test units issued by the market owner, not real stock.

0x8b4dFd26ab2A7Bdfd2090e434bcfB2C10A296E5d
Source file
packages/contracts/src/BlindBook.sol
Deploy block
128,228,560
Constructor
  • _token = 0x0B71c1B397A9d33198e0A6a5701E12011AC84D95The settlement token (mUSDG).
  • _epochLen = 45Seconds per round.
  • _commitEnd = 20Orders are hidden until this second of the round.
  • _revealEnd = 35Orders are revealed until this second; the contract clears after it.
  • _bond = 2000000Bond per order in base units (2.00 mUSDG), forfeited if the order is never revealed.

The deployer becomes the market owner: it lists markets, issues the test units and can pause.

OrderEscrow

Holds a buyer’s payment for one product until a named verifier confirms delivery, with a bond from the seller. Shown on the Orders tab. One address chosen at deployment decides whether goods arrived.

0x8b4BBad117aD6a0D85D9b48Ed5526Bde9BF4Eb59
Source file
packages/contracts/src/OrderEscrow.sol
Deploy block
128,256,841
Constructor

Also fixes the product id, the 20% seller bond and the time limits at deployment.

Who plays each role

Four addresses. The contract only ever pays escrow to the supplier and only ever pulls settlement from the payer, because the owner put exactly those two on allowlists.

Owner

Deployed the contracts, funded the vault, and is the only address that can change the mandate, allowlist payees and payers, pause the agent, or withdraw free funds. The owner can act as the agent only by replacing it with setAgent, which is on chain.

Agent

The AI agent’s public address. It can commit opportunities and move lots through their states within the mandate. It cannot change the mandate, and it cannot pay itself: escrow only goes to allowlisted payees.

Supplier

The allowlisted payee: the only kind of address escrow can be released to. A fixed test address standing in for a real supplier.

Payer

The allowlisted payer that settlement pulls proceeds from. On testnet it is the deployer wallet, standing in for a marketplace payout.

What the deploy script does

One script (script/Deploy.s.sol) creates both contracts and prepares the vault, in this order: deploy the test USDG token; deploy SKUdeskCore with the token and the agent address; mint 10,000.00 mUSDG to the deployer; approve the vault; deposit 5,000.00 mUSDG into the vault; allowlist the supplier as a payee; allowlist the deployer as a payer. The other 5,000.00 mUSDG stays with the payer wallet as the float that settlement later pulls from.

Reproduce it yourself

These are the commands from the repository README. The first two need nothing but the code; the last two need your own testnet wallets and a model API key, and never run in your browser.

Run the contract tests

cd packages/contracts && forge test

Foundry unit, fuzz and invariant tests. No network or keys needed.

Run the TypeScript tests

node --test packages/economics/test/*.test.ts packages/matching/test/*.test.ts

Economics (integer cents) and identity gates, from the repository root.

Deploy to Robinhood Chain Testnet

cd packages/contracts && forge script script/Deploy.s.sol --rpc-url $ROBINHOOD_RPC --broadcast

Needs DEPLOYER_PRIVATE_KEY and AGENT_ADDRESS in the environment and a wallet funded with testnet ETH. Writes packages/contracts/deployments/46630.json.

Run the agent and record a run

cd apps/web && node --env-file=../../.env tools/run-agent.ts

Needs the model API key, AGENT_PRIVATE_KEY and ROBINHOOD_RPC in .env. Calls the language model, sends the transactions and writes src/data/run.json.