Scripify and settle a secondary trade
Make part of a cyberCERT tradable as cyberSCRIP, trade it, and recertify the buyer
In this tutorial you make part of a cyberCERT tradable as fungible cyberSCRIP, transfer it to a buyer, and convert it back into a cyberCERT.
Code is illustrative of the flow and uses the real signatures from
cybercorps-contracts(develop).
Prerequisites
A cyberCERT from Tutorial 1 — say tokenId = 1 on the Common Stock printer at commonPrinter, held by alice. You also need the issuanceManager address.
1. Deploy a CyberScrip for the printer
A CyberScrip is deployed per cert printer via deployCyberScrip. This is also where you set the scrip ratio, conversion conditions, and which compliance powers exist.
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 cert units read as one whole scrip token in wallets. (The deploy call is onlyOwner — an officer runs it.)
All certificate unit quantities are 18-decimal fixed point — one share = 1e18 units — and cyberSCRIP is an 18-decimal ERC-20. Passing raw share counts (e.g. 1_000_000 instead of 1_000_000e18) under-scales by a factor of 10¹⁸.
2. Scripify part of the cert
Alice — the cert's registered owner — calls scripifyCert herself (legalOwnerOf is checked against the caller):
This reduces the cert's unitsRepresented, records the scripified units in the scrip pool, and mints cyberSCRIP to Alice (1_000_000e18 base units — 1,000,000 whole tokens — at the 1:1 ratio above). Units reserved for pending deals cannot be scripified. The cyberSCRIP is the same security in fungible form — see the dual-token model.
3. Sell the scrip
If a transfer hook is installed, the transfer must satisfy it (see Restrict cyberSCRIP transfers).
4. (New holder) issuer pre-approves recertification
Because Bob is not yet a registered holder, an officer pre-sets the certificate metadata he will receive on de-scripification:
5. Convert scrip back to a cyberCERT
Bob presents his cyberSCRIP:
This burns Bob's cyberSCRIP, withdraws the units from the scrip pool, and — using the approved metadata — puts Bob on the register. The approval requirement for new holders is enforced by the conversion flow itself: if the caller holds no active cert on that printer, the call reverts RecertificationApprovalRequired unless an officer approval from step 4 is on file. (If the caller already has an active cert, the units are added to it instead.) An IssuerApprovalRecertificationCondition can additionally be included among the scripToCertConditions as an opt-in, admin-managed approval list.
What you just did
Deployed a cyberSCRIP and scripified part of a cyberCERT.
Traded the security in fungible form.
Recertified a new holder back onto the register, under issuer approval.
Next
How-to: Restrict cyberSCRIP transfers.
Reference: CyberScrip, IssuanceManager.
Last updated
Was this helpful?
