LadderMine / LadderMine/yieldladder
[NF-14] [CONTRACT] Points/Referral Claim and Escrow Contract
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 26
- Avg merge
- 4h 36m
- Merged PRs (30d)
- 8
Description
Overview
NF-12 and NF-13 establish on-chain referral and points accounting; this issue adds the contract that lets those accrued values actually be claimed/redeemed for something concrete, rather than sitting as a number with no exit path.
Problem
Even with NF-12/NF-13 merged, an accrued points or referral balance is just a read-only number — there is no mechanism to convert it into anything (USDC, bonus shares, discounted fees, etc.), and no escrow holding value to back a future claim.
Proposed Solution
- New contract
contracts/rewards_escrow/: holds USDC (or bonus-share-mint authority) funded by Governance-controlled deposits. set_redemption_rate(points_per_usdc: i128)— Governance-gated.claim(user: Address) -> i128— reads the user's current points balance from thepointscontract (NF-13) and referral-bonus-owed from the referral accounting (NF-12), computes the redeemable USDC amount at the current rate, zeroes out the claimed balance in the source contract(s), and transfers USDC to the user.- Must be safe against double-claiming (zero the balance atomically as part of the same transaction as the transfer).
Acceptance Criteria
-
claimcorrectly computes redeemable amount from current points + referral balances and the governance-set rate - A user cannot claim the same points twice
- Escrow running low on funds fails claims gracefully with a clear error rather than a panic that could corrupt accounting
- Redemption rate is Governance-gated
- Unit tests cover: successful claim, double-claim rejection, insufficient-escrow-balance handling
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing NF-12 referral accounting and NF-13 points contract interfaces, then inspect the proposed contracts/rewards_escrow/ entry point. Trace how balances, governance authorization, and value transfers are represented before defining the cross-contract claim flow. Done means the acceptance tests pass for redemption, double-claim prevention, insufficient escrow funds, and governance-gated rates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100