Documentation
Smart Contracts
Token-x uses the ERC-3643 / T-REX standard — the only audited, permissioned security token standard with on-chain identity registry. Contracts are built with Foundry and deployed per-offering per-chain.
Why ERC-3643?
Plain ERC-20 has no transfer restrictions. ERC-3643 overrides _update() to check the IdentityRegistry on every transfer — if the sender or receiver is not whitelisted, the transfer reverts at the EVM level. No application middleware can bypass it.
TokenXToken.solERC-3643 / T-REXThe core security token. Extends the T-REX token with whitelist-gated transfers: _update() checks the IdentityRegistry before every transfer. Supports freeze, force-transfer, and batch-mint.
mint(address, uint256)Tokenization Agent only — issues tokens to a whitelisted addressburn(address, uint256)Tokenization Agent only — destroys tokens on redemptionsetFrozen(address, bool)Transfer Agent only — freeze/unfreeze investor tokensforcedTransfer(address, address, uint256)Transfer Agent only — regulatory overridebatchMint(address[], uint256[])Distribute to multiple investors in one txTimeLockModule.solAbstractModule (ERC-3643)Pluggable compliance module enforcing Reg D 12-month / Reg S 40-day lockup. Plugged into the token's compliance manager at offering deploy time. moduleCheck() blocks transfers until lockExpiry[from] is past.
setLockExpiry(address, uint256)Agent sets per-investor lock expiry timestamp after mintmoduleCheck(address, address, uint256, address)Returns false if sender is within lockup periodVestingVault.solCustomLinear / cliff vesting for team and advisor allocations. Tokens are held in the vault and released proportionally over the vest period after the cliff.
createSchedule(bytes32, address, address, uint256, uint256, uint256, uint256)Create vesting schedule: beneficiary, token, total, start, cliff, durationrelease(bytes32)Beneficiary calls to claim vested amountreleasable(bytes32)View — how many tokens can be claimed nowCorporateActionRegistry.solCustom (M-of-N governance)Immutable on-chain ledger for stock splits, reverse splits, and rights offerings. Requires M-of-N agent signatures before execution. ActionExecuted events are consumed by the chain listener.
propose(string, bytes)Agent proposes an action — returns bytes32 idapprove(bytes32)Second agent approves; auto-executes when threshold metexecute(bytes32)Callable once threshold is met if not auto-executedCapTable.solCustom (on-chain mirror)On-chain holder registry updated by _afterTokenTransfer hook in TokenXToken. Provides a verifiable, immutable cap table that can be read by any party without trusting the backend.
update(address, uint256)Called by token on every transfer — updates holder balanceholders()Returns all holder addressesbalanceOf(address)Holder balance in the cap tableDeployment Protocol
- 1Develop on local Foundry anvil — forge test passes 100%
- 2Deploy to testnet (Fuji / Sepolia / Mumbai) — integration tested against real nodes
- 3Third-party security audit — contracts must not be deployed to mainnet without an audit report
- 4Staged mainnet deploy: proxy-less initial deploy, admin keys in cold storage
- 5Compliance rules (whitelist logic, freeze conditions) are not upgradeable without a governance vote through CorporateActionRegistry