Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.signalium.site/llms.txt

Use this file to discover all available pages before exploring further.

Source: packages/contracts/src/yield/Treasury.sol The Treasury is deliberately generic — not coupled to PredictionMarket — so the same implementation can serve any future market type. One Treasury per principal; the principal address is immutable and the only address allowed to call recallToPrincipal.

Roles

RoleSet atPowers
ownerconstructor; rotatable via setOwnerAdapter allowlist (enable/disable), setReserveBps, setOperator
operatorconstructor; rotatable via setOperatordeployIdle, requestUnstake, claimFrom
principalimmutableSole caller of recallToPrincipal

Reserve floor

uint256 public reserveBps = 5_000; // default 50%
Every deployIdle(adapter, amount) enforces:
idleAfter = address(this).balance − amount
minIdle  = totalAssets() × reserveBps / BPS
require(idleAfter >= minIdle, WouldBreachReserve);
So at most half the float can be in adapters at any time. Owner-tunable.

Adapter lifecycle

enableAdapter checks the adapter reports this Treasury as its principal and uses native asset only (asset() == address(0)). Subsequent disableAdapter requires deployedTo == 0 && totalAssets() == 0 && pendingClaim() == 0 — strand-prevention so funds never silently drop out of accounting.

Reentrancy + gates

All native-sending paths (deployIdle, requestUnstake, claimFrom, recallToPrincipal) carry an explicit nonReentrant modifier. State writes happen before the external call in every case; the guard is belt-and-suspenders.