Skip to content

refactor: split binary market Simf into modules - #23

Merged
tvolk131 merged 1 commit into
masterfrom
codex/split-binary-market-simf
Aug 1, 2026
Merged

refactor: split binary market Simf into modules#23
tvolk131 merged 1 commit into
masterfrom
codex/split-binary-market-simf

Conversation

@tvolk131

@tvolk131 tvolk131 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep binary_market.simf focused on the witness ABI and covenant entrypoint
  • move shared arithmetic, transaction inspection, slot authentication, and follower guards into binary_market/common.simf
  • isolate confidential RT commitment/flip logic in binary_market/rt.simf
  • isolate oracle authorization and the nine market transitions in binary_market/transitions.simf
  • retain binary_market.simf as the sole Simplex.toml build entry; smplx resolves and flattens its local imports into the embedded generated source

Why

The pre-launch binary market covenant had grown to 805 lines in one source file. This gives the contract an acyclic, reviewable module structure while keeping private helpers private wherever they do not cross a file boundary.

This is intentionally a mechanical refactor. No witness ABI, contract parameters, transition behavior, or consensus output is changed.

Consensus invariants

  • canonical/sample CMR remains 702f5d04f15bcdec3fa1070540bf2f68c0ecdcf40bc8aa8024e1e77ef19cd5ee
  • nonuniform-argument CMR remains 090548f91e2f07d2e691216336b578bf15fcdbde96f2e4255e4e70c60e4c1931
  • witness ABI fixture is unchanged
  • all eight slot scriptPubKeys and control blocks are unchanged
  • every moved function body matches master; only imports and required cross-module pub modifiers were added

Verification

All commands ran inside nix develop .#default:

  • simplex build
  • cargo test --locked -p deadcat-contracts --test golden_vectors
  • embedded flattened-source full-compilation equivalence benchmark
  • just ci (211 workspace tests, doc tests, wasm check, and live Elements lifecycle/indexing/process-boundary regtests)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@tvolk131
tvolk131 marked this pull request as ready for review August 1, 2026 04:28
@tvolk131
tvolk131 merged commit 525823c into master Aug 1, 2026
2 checks passed
@tvolk131
tvolk131 deleted the codex/split-binary-market-simf branch August 1, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant