Repository navigation
refactor: extract compute_split into shared crate - #235
KunmiWrites-bit wants to merge 1 commit into
Conversation
|
@KunmiWrites-bit is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@KunmiWrites-bit Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@MergeFi Hi! This PR is open and ready for review — happy to address any feedback. Thanks! |
23e2be4 to
a64246d
Compare
…urity-and-testing-improvements
a64246d to
e5792b3
Compare
|
Warning Possible malicious code: please review before merging. An automated security scan flagged files in this pull request that appear to contain malicious code. Code like this can run automatically when a project is opened in an editor or its dependencies are installed, so it could compromise the machine of anyone who checks out this branch. Automated scans can be wrong, so this may be a false positive. Maintainers: please review the flagged files carefully before merging, on GitHub in your browser rather than by checking out the branch. The malicious part is often hidden far off to the right of an ordinary-looking line, so scroll sideways through each file. @KunmiWrites-bit: this pull request adds or changes these files, possibly without your knowledge. Malware like this spreads by adding itself to repositories on machines it has infected, so your machine might be compromised. Please undo these changes in this pull request, and don't open or run other projects on that machine until you've checked it. Flagged files at commit Only merge once you're confident these files are safe. ℹ️ Posted automatically by Drips Wave. Questions? Contact support@drips.network. |
b9e9433 to
6acee0d
Compare
6acee0d to
ec40e4f
Compare
|
Closing: branch was force-pushed with Wave malware droppers ( |
Overview
This PR extracts the duplicated
compute_splitpayout/fee-math logic fromcontracts/escrow/src/lib.rsandcontracts/milestones/src/lib.rsinto a new shared non-contract Rust crate,common/mergefi-split, and adds a differential/golden test proving the refactor is behavior-preserving. Both contracts now consume the shared crate, the duplicatedcompute_split/Payoutsdefinitions are removed, and the README Roadmap item is resolved — without changing either contract's publicErrorAPI or storage schema.Related Issue
Closes the issue: Extract
compute_splitinto a shared crate with proof of behavioral equivalenceChanges
📦 Shared Split/Fee-Math Crate
[ADD]
common/mergefi-split/— new#![no_std]workspace crate with no#[contract]attributecompute_split/ payout-split / fee math extracted fromcontracts/escrow/src/lib.rs:211-254andcontracts/milestones/src/lib.rs:234-275.SplitErrorenum plusFromconversions into each contract's ownErrorenum, soescrowandmilestoneskeep their distinct#[contracterror]APIs.DataKey, avoiding a forced common storage abstraction.[MODIFY]
contracts/escrow/src/lib.rs,contracts/milestones/src/lib.rscompute_splitandPayoutsdefinitions; both contracts now callmergefi_split::compute_split.SplitErroris mapped to the existingError::InvalidSplit/Error::NotInitializedvariants, preserving the original error paths.[MODIFY] Root
Cargo.toml,contracts/escrow/Cargo.toml,contracts/milestones/Cargo.tomlcommon/mergefi-splitto[workspace] membersand as a dependency of both contract crates.[ADD] Differential/golden test in
common/mergefi-splitcompute_splitimplementations across a large randomized input set (fee-bps permutations, payee counts, duplicate addresses, dust/overflow edge cases).[MODIFY]
README.mdVerification Results
#![no_std], no#[contract]attributecommon/mergefi-splitis#![no_std]with no#[contract]— not a deployable contractescrowandmilestonesconsume the shared crate; duplicated code removedcompute_split/Payoutsdeleted from both contracts; both callmergefi_split::compute_splitcargo test --workspaceandmake build(wasm) green for all three contractsCloses #16