Smart Contract Lifecycle - Creation to Execution
Complete process flow for JIL Sovereign zero-code smart contracts: from template selection through ATCE compliance, L1 deployment, VM execution.
Zero-code smart contracts. JSON config in, JIL-native contract out.
JIL uses template-based contract creation. No Solidity compiler. No raw bytecode. Users select a template, fill configuration parameters, and the Creator Studio (:8803) generates a JIL-native contract object. This eliminates compiler bugs, re-entrancy exploits, and the need for expensive security audits. ATCE compliance is enforced automatically at every step.
Primary Service
creator-studio (:8803) - 7 contract types available. JSON config to JIL-native compilation with no compiler needed.
Key Difference
0 lines of code vs Ethereum's 200+ lines of Solidity. Template-driven creation eliminates entire categories of smart contract vulnerabilities.
Seven contract templates. Select, configure, deploy.
User selects a contract template and fills configuration parameters through Creator Studio (:8803). Endpoints: POST /api/v1/create/{type} and POST /api/v1/preview/{type}.
🔥 Memecoin
maxWalletPercent uint
antiBot boolean
⚫ Token
burnable boolean
pausable boolean
complianceLevel enum
🖼 NFT
royaltyBps uint (bps)
baseURI string
💱 DEX Pool
protocolFeeBps uint (bps)
initialPrice decimal
⏳ Vesting
vestingMonths uint
revocable boolean
schedule linear | cliff
🔒 Multisig
threshold uint
dailyLimit uint (JIL)
📈 LBP (Liquidity Bootstrapping)
endWeight uint
startTime timestamp
endTime timestamp
jurisdictions string[]
Before deployment, the Automated Transaction Compliance Engine runs 8 validation checks.
Service: compliance-api (:8100). Trust levels: Blocked, HighRisk, MediumRisk, LowRisk, Trusted. Blocked or HighRisk results in deployment denied.
1. Creator Address Validation
Address must start with jil1
2. Contract Type Validation
Must be one of 7 registered templates
3. Compliance Level Check
none | basic | kyc_required | accredited_only
4. Token Name Conflict
Reserved: jil, bitcoin, ethereum, usdt, usdc
5. Supply Sanity Check
Warns if supply > 1 quintillion (10^18)
6. LBP Timing Validation
startTime must be < endTime
7. Multisig Threshold
threshold must be ≤ signers.length
8. KYB Status Check
Issuer KYB verification status for issuer
Pass (LowRisk / Trusted)
All 8 checks passed. Trust level: LowRisk or Trusted. Proceed to gas estimation and deployment.
Fail (Blocked / HighRisk)
Returns error with failing check. HTTP 403 + reason code. Logged to compliance-decision topic.
Deterministic gas calculation and pre-computed contract address before L1 submission.
Gas Price: 1,000,000 ujil per gas unit (0.000001 JIL). Address Formula: generateContractAddress(creator, codeHash, nonce). Code Hash: SHA256(type + id + config).
Gas Calculation: base_gas = 100,000 units (every contract) + state_gas = 100 x bytes(state_json) + method_gas = 5,000 x method_count + feature_gas (pqSignatures +50,000, zkProofs +100,000, complianceHooks +25,000). total_gas = base + state + method + feature. cost_ujil = total_gas x 1,000,000.
Example: Token Contract (mintable, burnable, complianceHooks)
Creator Studio submits the deployment transaction to the JIL L1 ledger.
Services: ledger-router (:8000) to ledger-service (:8081). Endpoint: POST /v1/tx/submit. Block time: 1.5 seconds. Finality: ~3 seconds.
Deployment Transaction
The deploy TX contains: type (contract_deploy), creator address, contract_type, contract_id, code_hash, initial state (balances, allowances, settings), methods array, features flags, deterministic address, and Ed25519 signature.
Deployment Pipeline
Creator Studio (:8803) signs with creator Ed25519 key, submits to Ledger Router (:8000) which validates TX envelope, forwards to Ledger Service (:8081) for mempool entry, then JIL ABCI includes in next block with ~1.5s block time and ~3s finality.
JIL ABCI processes each block: misbehavior handling, transaction execution, rewards, and fee distribution.
Block reward: 4 JIL to block proposer. Fee split: 60% burn / 30% validators / 10% humanitarian.
FinalizeBlock Sequence
Step 1: Process misbehavior (slashing for double-sign). Step 2: Execute all TXs (sequential, per-TX gas metering). Step 3: Mint block reward (4 JIL to proposer). Step 4: Distribute gas fees (60% burn, 30% validators, 10% humanitarian).
Per-Transaction Execution
1. Deserialize (validate TX schema). 2. Verify signature (Ed25519 or Dilithium PQ). 3. Set ExecutionContext (caller, value, calldata, gas). 4. Run VM logic (JIL-native contract bytecode). 5. ATCE policy checks. 6. Update state (balances, storage, supply). 7. Emit events (Transfer, Approval, ContractDeployed).
Once deployed, contract methods execute through a 5-stage pipeline with JIL Extension Opcodes.
Pre-Execution: freeze_check
If the account is frozen, reject with 0 gas cost. No gas wasted on frozen accounts.
Pre-Execution: zone_gate
Validate zone transfer rules. Protected to unprotected transfers are blocked at the VM level.
Pre-Execution: cap_check
Anti-dump limits enforced. 10% daily cap per tier prevents large liquidation events.
Execution: VM Process
Execute method logic and update state and balances according to the contract definition.
Post-Execution: compliance_log
Audit trail published to Kafka. Every execution creates an immutable compliance record.
Seven unique opcodes built into the JIL VM for compliance and zone enforcement.
ZONE_GET
Get account's zone ID (protected, unprotected, quarantine, internal, external)
ZONE_GATE
Validate cross-zone transfer rules and permissions
FREEZE_CHECK
Check if account is frozen (0-gas reject if true)
CAP_CHECK
Validate transfer against anti-dump tier caps
CERT_VERIFY
Verify account certification (KYC/accredited status)
KYB_STATUS
Get issuer's Know-Your-Business verification status
COMPLIANCE_LOG
Log compliance event to immutable audit trail (Kafka)
Three lock tiers with multiplier-based rewards for patient holders.
Tier 1
30-day lock period
1.5x multiplier
10% daily limit
Tier 2
60-day lock period
2x multiplier
10% daily limit
Tier 3
90-day lock period
3x multiplier
10% daily limit
JIL vs Ethereum - side-by-side smart contract capabilities.
| Aspect | Ethereum | JIL Sovereign |
|---|---|---|
| Code Required | Solidity (200+ lines typical) | JSON config (0 lines of code) |
| Compilation | Solidity → Bytecode → EVM | Config → JIL-native (no compiler) |
| Compliance | Manual security audit ($50K+) | ATCE automated (8 checks, free) |
| Frozen Transfer | Reverts after gas consumed (wasted) | Pre-execution reject (0 gas cost) |
| Zones | Not supported natively | 5 built-in zones with transfer matrix |
| Anti-Dump | Custom vesting (code required) | ATCE: 10%/day, 3 tiers built-in |
| Block Time | ~12 seconds | 1.5 seconds |
| Finality | ~6 minutes (64 slots) | ~3 seconds |
| Insurance | Not available natively | $250K+ included (Premium tier) |
| Post-Quantum | Not available | Dilithium/Kyber built-in |
Complete vertical flow from user action to on-chain confirmation in ~3 seconds.
User: Select Template and Configure
Choose from 7 templates, fill parameters, sign with Ed25519. POST /api/v1/create/{type}.
Creator Studio API (:8803)
Validate config schema, generate contract object, compute code hash.
ATCE 8-Check Validation (:8100)
Address validation, type check, compliance level, name conflict, supply sanity, timing, threshold, KYB.
Gas Estimation + Address Generation
Calculate base + state + method + feature gas. Deterministic address via SHA256.
Ledger Router (:8000) to Ledger Service (:8081)
Validate TX envelope, route to ledger-service, enter mempool. POST /v1/tx/submit.
JIL ABCI - FinalizeBlock - VM Execute
Deserialize, verify sig, set context, run bytecode, ATCE checks, update state, emit events.
Kafka Events to settlement-consumer (:8051)
contract-deploy topic, ContractDeployed event, downstream processing.
Deployment Confirmed (~3 seconds total)
Contract live at deterministic address, methods callable, visible in explorer.
All services involved in the smart contract lifecycle.
Primary Pipeline
creator-studio :8803 → compliance-api :8100 → ledger-router :8000 → ledger-service :8081 → JIL ABCI / VM
Supporting Services
proof-verifier :8250, settlement-consumer :8051, Kafka (RedPanda), PostgreSQL
User-Facing
web-wallet :3003, explorer :3004, wallet-api :8002, explorer-api :8003
Contract registry storage and Kafka event topics used across the lifecycle.
Contract Registry (in-memory + persistent, stored in ledger state tree, replicated across all validators): address (TEXT PRIMARY KEY), creator (TEXT), contract_type (TEXT), contract_id (UUID), code_hash (TEXT), state (JSONB), methods (TEXT[]), features (JSONB), deploy_block (BIGINT), deploy_tx_hash (TEXT), created_at (TIMESTAMP).
Kafka Event Topics
Event Flow: Every contract deployment emits to contract-deploy. Every method call emits to contract-execution. Token transfers additionally emit to transfer. All compliance decisions (pass/fail) are logged to compliance-decision. The settlement-consumer (:8051) subscribes to all topics for downstream processing and indexing.
Five account zones with a transfer matrix governing cross-zone permissions.
Zones: protected, unprotected, quarantine, internal, external. Policy results: Allow, Deny(reason), RequireApproval.
| From \ To | Protected | Unprotected | Quarantine | Internal | External |
|---|---|---|---|---|---|
| Protected | Allow | Deny | Deny | Approval | Deny |
| Unprotected | Approval | Allow | Deny | Allow | Allow |
| Quarantine | Deny | Deny | Deny | Deny | Deny |
| Internal | Allow | Allow | Approval | Allow | Approval |
| External | Deny | Allow | Deny | Approval | Allow |
The ZONE_GATE opcode is called as a pre-execution check before any transfer method. If the transfer is denied, it rejects with 0 gas cost (unlike Ethereum where the full gas is consumed on revert). The RequireApproval result queues the transfer for manual review by an authorized compliance officer. Quarantined accounts cannot send to any zone, providing a hard freeze mechanism.
Deploy compliant smart contracts in seconds - no code required.
JIL Sovereign's template-based contract system eliminates compiler bugs, re-entrancy exploits, and expensive security audits. ATCE compliance is enforced automatically at every step.