Source: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.
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
| Role | Set at | Powers |
|---|---|---|
owner | constructor; rotatable via setOwner | Adapter allowlist (enable/disable), setReserveBps, setOperator |
operator | constructor; rotatable via setOperator | deployIdle, requestUnstake, claimFrom |
principal | immutable | Sole caller of recallToPrincipal |
Reserve floor
deployIdle(adapter, amount) enforces:
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.
