Docs Técnicas
What Is TREA?
TREA is a deterministic contract language for AtlasDB.
TREA is a deterministic contract language for AtlasDB.
Unlike a general-purpose smart contract language, TREA is intentionally narrow. It is built for financial workflows where journal shape, obligations, settlement, corrections, storage layout, and audit evidence matter as much as state mutation.
Mental Model
A TREA contract is:
- a named contract module;
- a storage schema;
- read-only
@viewentrypoints; - mutating
@txentrypoints; - deterministic expressions and bounded loops;
- explicit ledger effects such as
send(...)andpost(...).
The compiler validates source and produces artifacts.
The runtime executes contract code and returns an execution result.
The ledger decides whether the resulting effects are admissible under the active accounting and policy rules.
A successful local execution does not guarantee ledger commit.
What TREA Is Good For
TREA is good for:
- loan lifecycle workflows;
- sparse business state;
- governed contract versioning;
- accounting-aware events and posting plans;
- deterministic contract execution;
- auditable financial state transitions.
What TREA Is Not
TREA is not a general-purpose VM surface.
The current profile does not support:
- recursion;
while;- cross-contract calls;
- arbitrary method calls;
- unbounded iteration;
- automatic incompatible storage migration transforms.
Product module stdlib helpers (loan, fees, fx, installments, insurance, yield, provisioning_loss, nfa) are available. See Intrinsics.
Those may become future versioned scopes, but they are outside the current executable profile.