01Executive Summary
The Token Factory with Programmable Compliance is JIL Sovereign's system for deploying digital asset tokens with embedded, immutable compliance rules. Rather than relying on mutable application-layer enforcement that can be changed after investors have committed capital, JIL's Token Factory compiles compliance rules directly into smart contract transfer logic at deployment time, making them cryptographically immutable once the contract is live.
Token issuers define compliance requirements using a declarative domain-specific language (DSL) that supports accredited investor requirements, geographic restrictions, holder concentration limits, lock periods, and transfer fees. The compiler transforms these human-readable rules into optimized contract bytecode, and each token receives a unique contract deployment - not a proxy pattern that could be upgraded to weaken restrictions.
02Problem Statement
The tokenized securities market is projected to reach $16 trillion by 2030, yet current token issuance platforms enforce compliance rules in ways that create significant trust and regulatory problems.
Mutable Application-Layer Rules
Platforms like TokenSoft and Securitize enforce transfer restrictions through application-layer middleware that sits between the user and the blockchain. These rules can be modified after deployment by the platform operator, creating a trust dependency. An issuer who promised "accredited investors only" could theoretically relax that restriction post-issuance, exposing themselves and their investors to regulatory liability.
Proxy Pattern Vulnerabilities
Many token contracts use upgradeable proxy patterns (EIP-1967, UUPS) that allow the contract logic to be changed after deployment. While this provides flexibility for bug fixes, it fundamentally undermines the immutability guarantee that investors rely on. A proxy upgrade could alter transfer restrictions, fee structures, or even token balances.
Single-Chain Limitation
Most compliance-aware token platforms deploy to a single blockchain. Issuers who want to reach investors across Ethereum, Solana, and other chains must work with multiple platforms, each with different compliance rule formats and enforcement guarantees.
03Technical Architecture
The Token Factory operates as a three-stage pipeline: DSL definition, compilation, and chain-specific deployment.
Compliance DSL
The DSL provides a human-readable, declarative syntax for specifying compliance rules. Rules are organized into five categories, each mapped to specific transfer hook logic in the compiled contract.
| Rule Category | DSL Keyword | Contract Hook | Example |
|---|---|---|---|
| Investor Qualification | require_accredited | _beforeTokenTransfer | Only accredited investors may receive tokens |
| Geographic Restriction | block_jurisdictions | _beforeTokenTransfer | Block transfers to US, CN, KP addresses |
| Concentration Limit | max_holder_pct | _beforeTokenTransfer | No single holder may exceed 10% of supply |
| Lock Period | lock_until | _beforeTokenTransfer | Tokens locked until 180 days post-issuance |
| Transfer Fee | transfer_fee_bps | _transfer | 25 basis point fee on every transfer |
DSL Example
token "ACME-SEC" {
name = "ACME Security Token"
symbol = "ACME"
supply = 10_000_000
decimals = 18
compliance {
require_accredited = true
block_jurisdictions = ["US", "CN", "KP", "IR"]
max_holder_pct = 10
lock_until = "2026-09-01T00:00:00Z"
transfer_fee_bps = 25
}
deploy_chains = ["jil-l1", "ethereum", "solana"]
}
Compilation Pipeline
DSL source parsed into Abstract Syntax Tree (AST)
- Syntax validation + rule conflict detection
- Cross-rule consistency checks
AST transformed to chain-specific Intermediate Representation (IR)
- Solidity IR for EVM chains (Ethereum, JIL L1)
- Anchor IR for Solana
- Each IR includes compliance hooks
IR compiled to deployable bytecode
- Solidity compiler (solc) for EVM
- Anchor build for Solana
- Bytecode hash stored as deployment fingerprint
Unique contract deployed per token per chain
- No proxy pattern - direct deployment
- Constructor args include immutable rule parameters
- Deployment receipt includes bytecode hash for verification
04Implementation
The Token Factory is implemented as a service within the JIL launchpad-api, with the DSL compiler and deployment orchestrator as core components.
Compiler Architecture
The compiler is written in TypeScript and produces chain-specific contract source code from the DSL AST. For EVM chains, it generates a Solidity contract inheriting from OpenZeppelin's ERC20 base with custom _beforeTokenTransfer and _transfer overrides. For Solana, it generates an Anchor program with equivalent transfer hooks implemented as program-derived account constraints.
Immutability Guarantee
Compliance rules are encoded as immutable state variables in the Solidity contract (or const in the Anchor program). These values are set in the constructor and cannot be modified after deployment. The contract has no upgrade, setRule, or any other state-mutating function that could alter compliance behavior. The deployed bytecode can be verified against the DSL source by re-compiling and comparing bytecode hashes.
Multi-Chain Deployment
| Chain | Contract Standard | Compliance Hook | Gas Cost (Deploy) |
|---|---|---|---|
| JIL L1 | JIL-20 (ERC20-compatible) | _beforeTokenTransfer | ~1.2M gas |
| Ethereum | ERC20 + ERC20Burnable | _beforeTokenTransfer | ~1.8M gas |
| Solana | SPL Token + Anchor | PDA constraint checks | ~0.01 SOL |
| Polygon | ERC20 (same as Ethereum) | _beforeTokenTransfer | ~1.8M gas (cheaper in MATIC) |
05Integration with JIL Ecosystem
The Token Factory integrates deeply with JIL Sovereign's compliance and trading infrastructure to provide a complete lifecycle for compliant token issuance.
Compliance API
The compliance-api maintains the accredited investor registry and geographic restriction lists referenced by deployed token contracts. Transfer hooks call back to the compliance oracle to verify investor status at transfer time.
Launchpad
The launchpad-api provides the user-facing interface for token creation. Issuers configure compliance rules through a guided wizard that generates the DSL configuration, previews the compiled contract, and initiates multi-chain deployment.
DEX v5
Tokens deployed through the factory are automatically registered with the execution-router and retail-lane-engine. Compliance rules are reflected in trading restrictions - the DEX will not match trades that would violate the token's embedded rules.
Bridge Relayer
Cross-chain transfers of factory-deployed tokens are validated by the bridge-relayer against the compliance rules embedded in both the source and destination chain contracts, ensuring consistent enforcement across chains.
06Prior Art Differentiation
JIL's Token Factory with Programmable Compliance introduces a fundamentally different approach to compliant token issuance.
| Feature | TokenSoft | Securitize | Polymath | JIL Token Factory |
|---|---|---|---|---|
| Rule Definition | Admin dashboard | API configuration | ST-20 modules | Declarative DSL |
| Rule Enforcement | Application layer | Application layer | Modular contract | Compiled into bytecode |
| Mutability | Mutable by admin | Mutable via API | Upgradeable modules | Immutable post-deploy |
| Contract Pattern | Proxy (upgradeable) | Proxy (upgradeable) | Proxy + modules | Unique per token (no proxy) |
| Multi-Chain | Ethereum only | Ethereum + Avalanche | Ethereum + Polymesh | JIL L1 + Ethereum + Solana + Polygon |
07Implementation Roadmap
DSL and EVM Compiler
Define DSL grammar and parser. Implement Solidity code generation for all five rule categories. Deploy compiler service within launchpad-api. Support JIL L1 and Ethereum deployment targets.
Solana and Multi-Chain
Implement Anchor program generation from DSL AST. Add Polygon and Arbitrum as deployment targets. Build multi-chain deployment orchestrator with atomic rollback on partial failures.
Compliance Oracle Integration
Connect deployed contracts to JIL compliance-api for real-time accredited investor verification. Implement geographic restriction updates via oracle feed (addresses, not contract logic). Add on-chain audit trail.
Launchpad Wizard and DEX Listing
Build guided token creation wizard in launchpad UI. Auto-register factory tokens on DEX v5. Enable secondary market trading with embedded compliance rule enforcement. Add token lifecycle dashboard.