CCengine
Docs/Guides
Guide / Statements

Statements

Read Statement prices and scores, compose, buy, and restyle held Statements.

Read a Statement

Core.statementInfo(uint256 sid) → (held, cost, composedAt)

Check custody and cost before reading a sale quote.

ControllerV1.priceOf(uint256 sid) → uint256

Current ETH ask. Statement age excludes paused time; the curve and reference can still change.

CreditScoreLens.statementScore(uint256 statementId) → uint256

Stored total score across a Statement's pages, including overprints.

Buy a Statement

01

Choose an ID from Core.heldStatements. Read ControllerV1.priceOf(sid), then simulate buy(sid) with at least that much ETH.

02

The Controller sends the current price to the Core, transfers the Statement to the buyer, and refunds excess ETH. The quote can change before inclusion.

03

Read ControllerV1.Bought and Core.StatementSoldTo for the final price and sale split.

ControllerV1.buy(uint256 sid) payable

Buy a held Statement at its current ask. Send at least priceOf(sid).

Compose a Statement

01

Read ControllerV1.nextPage(). Once ready, call Core.compose() for its chosen format or Core.compose(format) for a specific format.

02

Core.composeChosen requires chosenComposeOn, the minimum CC holding, and 80 eligible pile Credit IDs. Check the sale window before submitting.

03

Composition emits Core.Composed. The resulting Statement stays held by the Core for sale.

04

A caller holding at least minCcToChoose CC can change the format of a held Statement with Core.setHeldFormat(sid, format).

Core.compose() / Core.compose(uint8 format)

Compose the next eligible page of 80 pile Credits.

Core.composeChosen(uint256[80] ids, uint8 format)

Compose 80 chosen eligible pile Credits when the feature is enabled.

Core.setHeldFormat(uint256 sid, uint8 format)

Change a held Statement's format when the caller meets the CC holding requirement.

Statement events

01

Use Composed and StatementSoldTo for Statement activity. Pair each log with its transaction and block.