code wiki / (root) / nx_fin_finance_gate.nx

nx_fin_finance_gate.nx

buildroot/runtime/nx_fin_finance_gate.nx

5937 B98 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic fin
docsdependenciesstructsconstsfunctions

about

nx_fin_finance_gate.nx -- R7 GATE: proves the financing-cost optimizer ranks REAL options by TRUE total cost and SHIELDS against scams/predatory traps. Scenario: $20,000 high-interest debt, $600/month budget. opt0 current credit cards 24% APR fee $0 licensed (the status quo to beat) opt1 credit union loan 11% APR fee $100 licensed opt2 CDFI / nonprofit loan 9% APR fee $50 licensed (the cheapest legit option) opt3 balance-transfer card 15% APR fee $600 licensed opt4 "international" offer 4% APR fee $0 UPFRONT-required + UNLICENSED (advance-fee SCAM bait) opt5 payday / loan-shark 200% APR fee $0 licensed (predatory, above the 36% usury line) The scam's advertised 4% computes the LOWEST raw cost -- it MUST NOT win. Exits 0 iff ALL pass. license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_money.nx nx_debt_payoff.nx nx_fin_finance.nx nx_fin_finance_gate.nx

imports: nx_syscalls.nxnx_money.nxnx_debt_payoff.nxnx_fin_finance.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap mny_rate_from_pct mny_div_round mny_div_floor seti chk g_puts sys_write g_putn sys_write ↻ sys_mmap ↻ fe_total_cost sys_mmap ↻ dbt_payoff_months mny_rate_monthly mny_div_round ↻ mny_apply_rate mny_div_round ↻ mny_add mny_add ↻ fe_risk fe_is_safe fe_rank_best sys_mmap ↻ fe_risk ↻ fe_is_safe ↻ fe_total_cost ↻ g_puts ↻ g_putn ↻ fe_runway_months fe_runway_days

structs

none

consts

none

functions

15func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: chkmain calls 1: sys_write
16func g_putn(v: i64) -> i64
called by 2: chkmain calls 2: sys_writesys_mmap
25func chk(name: *u8, got: i64, want: i64, st: *i64) -> i64
called by 1: main calls 2: g_putsg_putn
30func seti(a: *i64, i: i64, v: i64) -> i64 { a[i] = v; return 0 }
called by 1: main
32func main() -> i64