DocsSmart Contracts

Smart Contracts Overview

The contract inventory, deployment status, inheritance, and the access-control matrix.

SEAT's contracts are Solidity 0.8.28, built with Foundry (via_ir, optimizer at 200 runs, cancun EVM), using OpenZeppelin contracts. Source: contracts/src/.

Inventory

ContractResponsibilityStatus
DeskVaultCustody, seat shares, NAV, fees, copies🟢 Deployed on 46630
DeskFactoryOne vault per leader; listing bonds🟢 Deployed on 46630
RiskModuleDeterministic copy decisions🟢 Deployed on 46630
SwapAdapterRestricted swap surface🟢 Deployed on 46630 (router 0)
FeeModuleFee math and splits🟢 Deployed on 46630
NavLibFixed-point NAV library🟢 (library; used by the vault)
ChainlinkOracleToken → AggregatorV3 prices🟡 Tested; not deployed on 46630
ExactInputRouter02Uniswap SwapRouter02 wrapper🟡 Tested; deploys with guarded mainnet scripts
SeatTokenFixed-supply $SEAT🟡 Tested; not deployed anywhere
StakingPoolStake $SEAT, earn USDG fees🟡 Tested; not deployed
LpLocker≥365-day Uni v3 NFT lock🟡 Tested; not deployed

Interfaces live in contracts/src/interfaces/: IDeskVault, IRiskModule, ISwapAdapter, IExactInputRouter, ISwapRouter02, IPriceOracle (in NavLib), IScaledUIAmount, IStakingPool, AggregatorV3Interface.

Access-control matrix

Function groupWho can call
DeskVault.deposit / redeem / processWithdrawalsAnyone (redeem: shareholders)
DeskVault.executeCopyThe desk's keeper only
DeskVault.set* / pause / unpauseOwner
RiskModule.configureDesk / setTokenAllowed / setSessionRiskOwner
SwapAdapter.setRouter / setAllowedTokenOwner
FeeModule.setParamsOwner
ChainlinkOracle.setFeedOwner
DeskFactory.createDesk / setListingParams / returnBondOwner
DeskFactory.listDeskAnyone with the $SEAT bond
StakingPool.stake / unstake / claimAnyone (stakers)
StakingPool.notifyRewardAnyone — desks call it; it pulls USDG from the caller
LpLocker.lock / withdrawOwner (withdraw only after unlock, to beneficiary)

There is no owner function that moves user funds out of a vault. The owner's powers are configuration, pausing, and bond custody.

Inheritance

  • DeskVault: Ownable, Pausable, ReentrancyGuard, IDeskVault
  • RiskModule, SwapAdapter, FeeModule, ChainlinkOracle, DeskFactory, LpLocker: Ownable (+ IERC721Receiver for the locker)
  • StakingPool: ReentrancyGuard, IStakingPool
  • SeatToken: OpenZeppelin ERC20

Testing

90 Foundry tests across 13 suites pass (forge test), including invariant tests (DeskInvariants.t.sol: NAV equals cash in the cash-only phase, accounting cash equals the vault's USDG balance, no shares ⇒ zero NAV per share) and a live-wiring simulation (DeskVaultLive.t.sol). See Development → Testing.