This page covers how to deploy, configure, and integrate with the Stock Token contract suite. It assumes you have the license source code and a deployment environment targeting an EVM-compatible chain.Documentation Index
Fetch the complete documentation index at: https://docs.trusset.org/llms.txt
Use this file to discover all available pages before exploring further.
Deployment Sequence
The contracts must be deployed in order due to their interdependencies. Each contract uses a UUPS proxy pattern, so you deploy a proxy pointing to an implementation contract, then callinitialize() on the proxy.
Deploy the implementation, then a UUPS proxy. Initialize with a Gnosis Safe (multi-sig) as
DEFAULT_ADMIN_ROLE and a legal operator address for upgrade authorization.After initialization, add your KYC provider, register operator, and compliance officer via the Safe:
identityRegistry.addKYCProvider(kycProviderAddress, "Provider Name");
identityRegistry.addRegisterOperator(operatorAddress, "Operator Name");
identityRegistry.addComplianceOfficer(complianceOfficerAddress);
Deploy the implementation and proxy. Initialize with the identity registry address, issuer, and legal operator.
stockToken.initialize(
"Acme Corp Class A", // name
"ACME-A", // symbol
"DE000A0D9PT0", // ISIN
"https://example.com/meta.json", // metadata URI
address(identityRegistry), // identity registry
issuerAddress, // receives ISSUER_ROLE + DEFAULT_ADMIN_ROLE
legalOperatorAddress // receives LEGAL_OPERATOR_ROLE
);
If you need holding limits or lockup periods, deploy the compliance module with the token address and default limits.
BasicComplianceModule compliance = new BasicComplianceModule(
address(stockToken),
0, // default max holding (0 = unlimited)
0 // default min holding
);
stockToken.addSubIssuer(subIssuerAddress);
stockToken.setSubIssuerCap(subIssuerAddress, 1_000_000 * 1e18); // cap at 1M tokens
If you are deploying an orderbook, AMM pool, or lending contract that will hold tokens in custody, whitelist those contracts so they bypass identity checks.
Verifying Identities
Before any tokens can be issued or transferred, both sender and receiver must have verified identities in the registry (unless they are authorized contracts).batchVerifyIdentities() with up to 500 addresses per call. The function returns a count of successes and an array of failed indices for retry.
Issuing Tokens
With identities verified and sub-issuers configured, issue tokens:reason parameter is bytes32 - use it for categorizing issuances in your audit trail. You can encode strings with bytes32("INITIAL_OFFERING") or use custom numeric codes.
Pre-checking Transfers
Before submitting a transfer on-chain, callcanTransfer to check whether it would succeed. This avoids wasted gas on transactions that will revert.
view function and costs no gas when called off-chain. Integrate it into your frontend to show users whether a transfer will succeed before they sign.
Configuring Compliance Rules
TheBasicComplianceModule enforces holding limits and lockup periods. Configuration calls must come from the token contract, so you need to expose these through your issuer workflow.
Holding limits
Set global defaults and per-user overrides:Lockup periods
Lock tokens for a specific address until a timestamp:Executing a Stock Split
Forward splits multiply all holder balances by a ratio. You must provide the complete list of current holders.splitRatio()) updates and simplifies by GCD.
