For the complete documentation index, see llms.txt. This page is also available as Markdown.

Gate state transitions with conditions

Attach condition contracts to issuance, deals, rounds, and secondary settlement

A condition is a contract implementing ICondition. Conditions gate state transitions on arbitrary onchain checks.

The interface

interface ICondition {
    function checkCondition(
        address _contract,
        bytes4 _functionSignature,
        bytes memory data
    ) external view returns (bool);
}

See Conditions for the built-in conditions (lexchexCondition, NonUSNationalityCondition, IssuerApprovalRecertificationCondition, OrCondition), plus the secondary-trading condition family in src/libs/conditions/secondary/ (eligibility, holding period, holder cap, Reg S distribution compliance, Rule 144 / Section 4(a)(7) disclosure, CFIUS, kill switch, and more).

Where conditions are attached

Conditions are passed as address[] (or ICondition[]) into the call that creates the gated thing:

Scripification / de-scripification — set when the scrip is deployed:

IIssuanceManager(issuanceManager).deployCyberScrip(
    certAddress,
    typeRestrictionHooks,
    certToScripConditions,   // ICondition[] gating scripifyCert
    scripToCertConditions,   // ICondition[] gating convertScripToCert
    /* ...remaining args... */
);

A fundraising round — in the Round built via RoundLib.setAgreement (roundConditions), and per-EOI in submitEOI(..., conditions, ...).

A deal — the conditions argument of DealManager.proposeDeal.

Secondary trades — configured on the DealManager as standing lists rather than per-call arguments, and evaluated at post, accept, and finalize:

See Run a secondary trade.

Writing a custom condition

Implement ICondition. Because checkCondition receives the calling contract, the selector, and arbitrary data, you can encode any onchain check:

Deploy it and pass its address wherever the protocol accepts a condition list.

Last updated

Was this helpful?