// TokenCreate — Phase C of silent-iron-keystone v4. // // Bond curve + supply caps + symbol validation enforced at consensus // level. Every parameter is typed argv. The bond is a USDm carrier // transfer enforced by the wallet IPC; the contract verifies the // declared bond matches the curve. // // Decimals are HARDCODED to 8 per CLAUDE.md atomic-unit rule. // Symbol len 3-6, name len ≤ 32, supply > 0 — all consensus-checked. dark contract TokenCreate { // creator stealth (one-time per CryptoNote default) → token row. public mapping(bytes => string) tokenSymbol; public mapping(bytes => string) tokenName; public mapping(bytes => uint64) tokenMaxSupply; public mapping(bytes => uint64) tokenCirculating; public mapping(bytes => bool) tokenMintable; public mapping(bytes => uint64) tokenCreatedBlock; @direct entry create(bytes tokenId, string symbol, string name, uint64 maxSupply, bool mintable, uint64 declaredBond) { require(tokenCreatedBlock[tokenId] == 0, "TOKEN_ID_COLLISION"); require(maxSupply > 0, "TOKEN_ZERO_SUPPLY"); require(declaredBond > 0, "TOKEN_ZERO_BOND"); // Symbol/name length validation is in the wallet pre-broadcast // (the IPC handler enforces 3-6 alnum). The contract additionally // refuses empty strings — defense in depth. require(symbol != "", "TOKEN_EMPTY_SYMBOL"); require(name != "", "TOKEN_EMPTY_NAME"); tokenSymbol[tokenId] = symbol; tokenName[tokenId] = name; tokenMaxSupply[tokenId] = maxSupply; tokenCirculating[tokenId] = 0; tokenMintable[tokenId] = mintable; tokenCreatedBlock[tokenId] = block.number; syscall(TOKEN_TRANSFER_EMIT_V1, ctx.txHash); } }