Sanctum

Safe Intent based agentic defi: agents operate inside explicit boundaries

Sanctum

Created At

Open Agents

Project Description

Sanctum is a settlement system for ERC4626 vault reallocations on Arbitrum One. Users express safety and economic constraints (vault allowlists, fee caps, slippage floors, cooldowns, executor choice, and execution-specific checks) inside a structured EIP-712 payload (IntentParams) tied to a two-step intent lifecycle in intents-api (reserve, then commit with signatures). A keeper or agent obtains calldata for Sanctum.settleWithIntent, submits the transaction, and the API verifies the receipt before marking the intent settled. On-chain, settleWithIntent verifies the intent signature, validates the unsigned SettleBundle against the signed policy, and runs deposit / fee / swap / IExecutor.execute in one atomic path—reverting with named errors on any violation. The design goal is user-sovereign policy: constraints live in the user’s signature, not in a trusted off-chain rules engine. The repo also ships a React dashboard, an MCP server for agent workflows, an optional settlement-worker, Morpho-aware planning, Uniswap quotes for cross-asset paths, and KeeperHub workflow examples for operators.

How it's Made

Sanctum is a pnpm monorepo. Solidity 0.8.35 contracts live under p, built and tested with Foundry (forge build / forge test), including fork tests against Arbitrum-style state. The Sanctum contract coordinates Permit3-style allowances, fee collection, optional Uniswap-style swaps via a router interface, and pluggable IExecutor implementations (including Morpho composite execution). Off-chain services are TypeScript on Node 20+: p holds shared types, Postgres-backed storage, EIP-712 helpers, settlement verification with viem, and an HTTP router; p exposes Express REST routes for intent lifecycle and calldata; p runs SQL migrations for intents metadata (including intentRef). p is Vite + React 18 with wagmi, viem, and RainbowKit, Tailwind + DaisyUI, and Morpho GraphQL-backed position reads. p uses the Model Context Protocol SDK so agents can reserve/commit intents and fetch quotes. p is an optional poller that builds and submits settlement txs. p demonstrates KeeperHub workflow integration. CI/deploy use GitHub Actions; local and stack runs use Docker-oriented config under d. Partner surfaces: Morpho Blue-style execution, Uniswap quoting, KeeperHub for keeper orchestration, and an internal 0g-adapter workspace package where the build graph requires it.

background image mobile

Join the mailing list

Get the latest news and updates

Sanctum | ETHGlobal