Skip to content

feat(contracts): implement anti-mev protection, bounty board, dynamic drm licensing, and reputation decay - #1700

Merged
ayomideadeniran merged 2 commits into
StellarDevHub:mainfrom
adeniran19-maker:feat/batch-1656-1657-1661-1662
Oct 19, 2026
Merged

ayomideadeniran merged 2 commits into
StellarDevHub:mainfrom
adeniran19-maker:feat/batch-1656-1657-1661-1662

Conversation

@adeniran19-maker

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR resolves issues #1656, #1657, #1661, and #1662 across the smart contract suite.

1. [SC-035] Anti-MEV Sandwich Protection (Closes #1656)

  • Created contracts/amm/src/anti_mev.rs adding user-defined deadline verification (DeadlineExceeded), strict minimum output slippage checks, and same-block bidirectional trade restriction (SameBlockBidirectionalTrade).
  • Integrated tracking in storage with DataKey::TradeRecord(Address).
  • Added AMM unit tests and updated property/fuzz tests in tests/fuzz_amm.rs.

2. [SC-036] Decentralized Bounty Board (Closes #1657)

  • Created contracts/freelance-platform/src/bounty.rs supporting bounty creation, escrow locking, single contributor milestone claims, and multi-contributor collaborative claims with split basis points summing to 10,000.
  • Implemented verify_and_payout with proportional payouts and claim_refund granting 100% funder refunds after expiration.
  • Added comprehensive unit tests covering single and split payouts, plus expired refunds.

3. [SC-040] Dynamic Licensing & DRM Contract (Closes #1661)

  • Created contracts/content_management_system/src/drm.rs for on-chain curriculum copyright registration.
  • Created contracts/content_management_system/src/licensing.rs for setting license terms, minting time-limited cryptographic license vouchers, directly forwarding royalty payments to course authors, and providing is_license_valid check and revocation support.
  • Added full unit test coverage.

4. [SC-041] Decentralized Reputation Scoring with Decaying Trust (Closes #1662)

  • Created contracts/sybil_resistance/src/decay.rs implementing exponential time decay formula without floating point arithmetic (R_t = R_0 * 2^(-t / T)) over 6-month epochs (180 days).
  • Created contracts/sybil_resistance/src/reputation.rs capping scores at 10,000, supporting reputation increments with transparent reasoning codes (CourseCompletion, PeerReview, HackathonWin, TimeDecay, AdminAdjustment), and emitting audit events.
  • Added tests validating score capping, exact halving, and fractional decay.

Verification

All 64 tests across all 4 touched packages passed cleanly:

  • amm: 22 unit tests + 2 fuzz tests passing
  • content-management-system: 23 unit tests passing
  • freelance-platform: 10 unit tests passing
  • sybil-resistance: 7 unit tests passing

Closes #1656
Closes #1657
Closes #1661
Closes #1662

… drm licensing, and reputation decay

- [SC-035] Anti-MEV Sandwich Protection (Closes StellarDevHub#1656)
  - Implements user-defined deadlines, strict slippage enforcement, and same-block bidirectional trade restrictions in AMM.
- [SC-036] Decentralized Bounty Board (Closes StellarDevHub#1657)
  - Adds bounty lifecycle escrow, milestone proof claims, collaborative multi-contributor split payouts (bps), and 100% funder refunds on expiry.
- [SC-040] Dynamic Licensing & DRM Contract (Closes StellarDevHub#1661)
  - Adds curriculum copyright hash registration, commercial license voucher minting, direct creator royalty forwarding, and license validation.
- [SC-041] Decentralized Reputation Scoring with Decaying Trust (Closes StellarDevHub#1662)
  - Implements integer exponential decay R_t = R_0 * 2^(-t/T) over 6-month epochs, reputation scoring caps, and transparent audit events with reasoning codes.

Closes StellarDevHub#1656, Closes StellarDevHub#1657, Closes StellarDevHub#1661, Closes StellarDevHub#1662
@vercel

vercel Bot commented Oct 16, 2026

Copy link
Copy Markdown

@adeniran19-maker is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Oct 16, 2026

Copy link
Copy Markdown

@adeniran19-maker 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! 🚀

Learn more about application limits

@ayomideadeniran
ayomideadeniran merged commit e7c1655 into StellarDevHub:main Oct 19, 2026
10 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment