code wiki / (root) / nx_captable_lib.nx

nx_captable_lib.nx

buildroot/runtime/nx_captable_lib.nx

5326 B108 linesdepth 7pulls 12 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_captable_lib.nx -- ENTITY MANAGEMENT: capitalisation table arithmetic and corporate-authority limits. The Carta/Athennian-class category we had at zero. A cap table is not a spreadsheet, it is a set of hard corporate-law constraints, and two of them are violated constantly. u2605OVER-ISSUANCE IS VOID, NOT AN OVERDRAFT. A corporation may not issue more shares than its charter AUTHORISES. Shares purportedly issued beyond that number are void -- not "issued pending an amendment", not a rounding problem to fix at the next raise. A cap table that simply shows a larger issued figure is asserting something the corporation had no power to do, so this refuses rather than reports. u2605OWNERSHIP DEPENDS ENTIRELY ON THE BASIS, AND THE BASIS IS USUALLY UNSTATED. The same holder is a different percentage on an OUTSTANDING basis than on a FULLY DILUTED basis (which counts the option pool, warrants and convertibles). Founders hear the outstanding number, investors model the diluted one, and the gap is where disputes live. Both are computed here, separately and explicitly named -- there is deliberately no single "ownership" function to call by accident. Percentages are in PER MILLE (0..1000) to stay in integer arithmetic; a permille figure is exact where a truncated percent would silently lose sub-1% holders. u2605FAIL-CLOSED: a zero or negative denominator yields ENT_UNKNOWN, never zero percent. "0% owned" and "we cannot compute this" are different answers. STRUCTURE: pure decision core, zero I/O. license_tier: ORIGINAL LIB.

dependencies 1 imports · 2 importers

nx_matter_lib.nx nx_captable_lib.nx nx_captable_gate.nx nx_legal_svc.nx

imports: nx_matter_lib.nx

imported by: nx_captable_gate.nxnx_legal_svc.nx

structs

none

consts

25const ENT_UNKNOWN: i64 = 0 - 1
26const ENT_VOID: i64 = 0 - 2

functions

28func ent_is1(v: i64) -> i64
34func ent_issue_ok_pure(authorized: i64, issued: i64) -> i64
43func ent_authorized_remaining_pure(authorized: i64, issued: i64) -> i64
called by 1: main calls 1: ent_issue_ok_pure
49func ent_outstanding_pure(issued: i64, treasury: i64) -> i64
58func ent_fully_diluted_pure(outstanding: i64, options_granted: i64, options_available: i64, warrants: i64, convertibles: i64) -> i64
69func ent_permille_pure(held: i64, denominator: i64) -> i64
75func ent_ownership_outstanding_pure(held: i64, outstanding: i64) -> i64
79func ent_ownership_diluted_pure(held: i64, fully_diluted: i64) -> i64
85func ent_dilution_consistent_pure(outstanding_permille: i64, diluted_permille: i64) -> i64
called by 1: main
93func ent_pool_permille_pure(options_granted: i64, options_available: i64, fully_diluted: i64) -> i64
called by 1: main calls 1: ent_permille_pure
101func ent_table_valid_pure(authorized: i64, issued: i64, treasury: i64, fully_diluted: i64) -> i64