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

Scripify and settle a secondary trade

Turn part of a LET into scrip, trade the scrip, and convert it back into a LET in the buyer's name

This guide converts part of a Ledger Entry Token (LET) into scrip, the fungible ERC-20 token that tracks the LET's units, transfers the scrip to a buyer, and converts it back into a LET in the buyer's name. To settle on the LET itself through the DealManager's offer flow, see Run a secondary trade.

The example starts from the LET issued in Incorporate a cyberCORP: tokenId = 1 on the Common Stock LET contract at commonPrinter, held by alice. You also need the company's issuanceManager address.

1. Deploy the CyberScrip for the LET contract

Each LET contract gets its own CyberScrip, deployed with deployCyberScrip. The same call sets the scrip ratio, the conditions on conversion in each direction, and which compliance powers exist. The call is onlyOwner, so an officer runs it.

address cyberScrip = IIssuanceManager(issuanceManager).deployCyberScrip(
    commonPrinter,
    typeRestrictionHooks,   // ITransferRestrictionHook[]
    certToScripConditions,  // ICondition[] gating scripification
    scripToCertConditions,  // ICondition[] gating de-scripification
    1e18,                   // scripToCertMinimum (in scrip, one whole token)
    1,                      // scripRatioNumerator
    1,                      // scripRatioDenominator
    new uint256[](0),       // scripifyWhitelistIds
    false,                  // scripifyWhitelistEnabled
    true,                   // enableForceTransfer
    true,                   // enableForceBurn
    true                    // enableFreeze
);

Scrip minted = units × scripRatioNumerator / scripRatioDenominator, with no implicit rescaling, so the 1 : 1 ratio makes one share's worth of LET units read as one whole scrip token in wallets.

2. Scripify part of Alice's LET

Alice, the LET's registered owner, calls scripifyCert herself. The IssuanceManager checks legalOwnerOf against the caller.

The call reduces the LET's unitsRepresented, records the scripified units in the scrip pool, and mints scrip to Alice: 1_000_000e18 base units, or 1,000,000 whole tokens at the 1:1 ratio. Units reserved for pending deals cannot be scripified, and neither can a void LET. The scrip's transfer hooks also apply to this mint, so with a WhitelistTransferHook installed, Alice must be whitelisted first. What rights scrip carries is set by the company's governing documents; LETs and scrip explains how the two forms relate.

3. Transfer the scrip to the buyer

The transfer must pass every installed transfer hook; see Restrict scrip and LET transfers.

4. Pre-approve the buyer's recertification

Bob holds no LET on this contract yet, so an officer sets the details of the LET he will receive when he converts his scrip:

5. Convert the scrip back into a LET

Bob presents his scrip:

The call burns Bob's scrip, withdraws the units from the scrip pool, and registers Bob as holder of record on a LET with the approved details. The conversion enforces the approval itself: if the caller holds no active LET on that contract, the call reverts RecertificationApprovalRequired unless an officer's setRecertificationApproval for the caller is on file. If the caller already holds an active LET, the units are added to it instead. An issuer that wants an admin-managed approval list as well can add an IssuerApprovalRecertificationCondition to the scripToCertConditions.

Function-level detail is in CyberScrip and IssuanceManager.

Last updated

Was this helpful?