code wiki / _hdl_build / nx_swap_reward_gate.nx

nx_swap_reward_gate.nx

buildroot/runtime/_hdl_build/nx_swap_reward_gate.nx

10863 B154 linesdepth 6pulls 18 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_swap_reward_gate.nx -- GATE (capstone): the gamified swap pays REAL rewards. Composes nx_swap (the fun activity) + nx_price (real store prices) + nx_rewards (real payout) at the edge (rule 22, no lib coupling). When a gardener completes the Mediterranean-Herbs set by SWAPPING (not buying), the achievement pays out the REAL money those herbs cost at the store + a REAL capability -- exactly "real rewards, real positives, real capabilities", not a dumb badge. A non-completer earns nothing (no participation trophy). license_tier: ORIGINAL

dependencies 7 imports · 0 importers

nx_swap.nx nx_rewards.nx nx_price.nx nx_publisher.nx nx_seg_store.nx nx_syscalls.nx nx_gate_verdict.nx nx_swap_reward_gate.nx

imports: nx_swap.nxnx_rewards.nxnx_price.nxnx_publisher.nxnx_seg_store.nxnx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main g_p sys_write sw_seed_config sw_put fd_streq_store sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable nxa_dump_sizes ss_get sys_mmap ↻ ss_scan sys_mmap ↻ ss_manifest_dyn ss_scan_seglist ss_begin ss_begin_cap sys_mmap ↻ ss_add ss_add2 ss_w32 ss_len fd_seg_next sys_mmap ↻ ss_manifest ss_manifest_file sys_mmap ↻ ss_cat ss_readall ss_commit

structs

none

consts

14const CR_SWAP: *u8 = "knowledge/store/swrw-swap-"
15const CR_REWARD: *u8 = "knowledge/store/swrw-reward-"
16const CR_PRICE: *u8 = "knowledge/store/swrw-price-"
17const CR_STAGE_FILE: *u8 = "knowledge/staging/swrw/earned.html"
18const CR_LIVE_FILE: *u8 = "knowledge/publish/swrw-live/earned.html"

functions

20func g_p(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 1: main calls 1: sys_write
21func g_i(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
29func g_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
called by 1: main calls 2: sys_openat_rdsys_close
33func complete_and_reward(swap_pfx: *u8, reward_pfx: *u8, gid: *u8, setid: *u8, value_aid: *u8, cap_aid: *u8, day: i64) -> i64
41func main() -> i64