You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The quicklendx-contracts crate does not compile on main (currently cac37b5f) — neither for the native host nor the wasm32-unknown-unknown target. cargo check reports 19 errors; cargo build --target wasm32-unknown-unknown --release reports 18. This blocks CI for every PR against main.
The breakage traces to the merge of #1451 (f9462647, feat(investor-kyc): deterministic recompute_investor_tier…), which appears to have been merged in a non-compiling state.
Root cause
#1451 renamed the 3-arg wrapper determine_investor_tier(env, investor, risk_score) to compute_investor_tier, and changed its body (and other call sites) to call a 4-arg deterministiccompute_investor_tier(total_invested, successful_investments, defaulted_investments, risk_score). That 4-arg function was never defined, and you cannot have both a 3-arg and a 4-arg compute_investor_tier (Rust has no overloading). Additionally, recompute_investor_tier was duplicated verbatim in two files.
Errors (deduplicated)
Duplicate recompute_investor_tier — src/lib.rs:1962 & 1972 (identical), and src/verification.rs:1481 & 1536 (identical). This also cascades into ~8 macro errors at the #[contractimpl] on src/lib.rs:392 (E0034/E0428×4/E0592×3).
Missing 4-arg compute_investor_tier — compute_investor_tier at src/verification.rs:1240 has a 3-arg signature (env, investor, risk_score) but its body (:1248) and recompute_investor_tier (:1510, :1565) and update_investor_analytics (:1364) call it with 4 args → E0061 ×4.
Unresolved determine_investor_tier — imported at src/lib.rs:275 and called at src/verification.rs:1119, but no longer exists (renamed) → E0432 + E0425.
PlatformFeeConfig is private — src/lib.rs:270 imports it from profits, but it is not pub → E0603.
Dispute initializer missing resolution_outcome — src/lib.rs:3285 constructs Dispute { … } without the resolution_outcome: Option<DisputeResolution> field (defined at src/types.rs:128) → E0063.
Proposed fix
Keep determine_investor_tier(env, investor, risk_score) as the 3-arg wrapper (revert the rename), restoring the lib.rs import and the verification.rs:1119 call site.
Add the missing 4-arg deterministiccompute_investor_tier(total_invested, successful_investments, defaulted_investments, risk_score) -> Result<InvestorTier> implementing the threshold table documented in the feat(investor-kyc): deterministic recompute_investor_tier, public ent… #1451 doc-comment (VIP/Platinum/Gold/Silver/Basic by risk score, total invested, successful investments, and max default rate). The wrapper delegates to it.
Remove the duplicate recompute_investor_tier definitions in lib.rs and verification.rs.
Make PlatformFeeConfigpub in profits.rs.
Add resolution_outcome to the Dispute initializer at lib.rs:3285.
Steps 1, 3, 4, 5 are mechanical. Step 2 reconstructs logic lost in the merge (including the default-rate thresholds), so it needs sign-off from the #1451 author on the intended tier semantics.
Summary
The
quicklendx-contractscrate does not compile onmain(currentlycac37b5f) — neither for the native host nor thewasm32-unknown-unknowntarget.cargo checkreports 19 errors;cargo build --target wasm32-unknown-unknown --releasereports 18. This blocks CI for every PR againstmain.The breakage traces to the merge of #1451 (
f9462647, feat(investor-kyc): deterministic recompute_investor_tier…), which appears to have been merged in a non-compiling state.Root cause
#1451 renamed the 3-arg wrapper
determine_investor_tier(env, investor, risk_score)tocompute_investor_tier, and changed its body (and other call sites) to call a 4-arg deterministiccompute_investor_tier(total_invested, successful_investments, defaulted_investments, risk_score). That 4-arg function was never defined, and you cannot have both a 3-arg and a 4-argcompute_investor_tier(Rust has no overloading). Additionally,recompute_investor_tierwas duplicated verbatim in two files.Errors (deduplicated)
recompute_investor_tier—src/lib.rs:1962&1972(identical), andsrc/verification.rs:1481&1536(identical). This also cascades into ~8 macro errors at the#[contractimpl]onsrc/lib.rs:392(E0034/E0428×4/E0592×3).compute_investor_tier—compute_investor_tieratsrc/verification.rs:1240has a 3-arg signature(env, investor, risk_score)but its body (:1248) andrecompute_investor_tier(:1510,:1565) andupdate_investor_analytics(:1364) call it with 4 args → E0061 ×4.determine_investor_tier— imported atsrc/lib.rs:275and called atsrc/verification.rs:1119, but no longer exists (renamed) → E0432 + E0425.PlatformFeeConfigis private —src/lib.rs:270imports it fromprofits, but it is notpub→ E0603.Disputeinitializer missingresolution_outcome—src/lib.rs:3285constructsDispute { … }without theresolution_outcome: Option<DisputeResolution>field (defined atsrc/types.rs:128) → E0063.Proposed fix
determine_investor_tier(env, investor, risk_score)as the 3-arg wrapper (revert the rename), restoring thelib.rsimport and theverification.rs:1119call site.compute_investor_tier(total_invested, successful_investments, defaulted_investments, risk_score) -> Result<InvestorTier>implementing the threshold table documented in the feat(investor-kyc): deterministic recompute_investor_tier, public ent… #1451 doc-comment (VIP/Platinum/Gold/Silver/Basic by risk score, total invested, successful investments, and max default rate). The wrapper delegates to it.recompute_investor_tierdefinitions inlib.rsandverification.rs.PlatformFeeConfigpubinprofits.rs.resolution_outcometo theDisputeinitializer atlib.rs:3285.Steps 1, 3, 4, 5 are mechanical. Step 2 reconstructs logic lost in the merge (including the default-rate thresholds), so it needs sign-off from the #1451 author on the intended tier semantics.
Repro