fix: enforce net minimum stake, reentrancy guard, fee accounting, and referral hardening - #126
Open
Victorakinwunmi wants to merge 1 commit into
Open
Conversation
… referral hardening - leaderboard: deprecate add_pts in favor of reward; add net-minimum-stake enforcement and stale-min self-healing (issues SPulse-Org#60, SPulse-Org#63) - prediction_market: add reentrancy guard on place_bet (issue SPulse-Org#89); restructure to checks-effects-interaction pattern; track only platform_fee in AccumulatedFees — referral fee stays with referral contract as surplus (issue SPulse-Org#78) - pulse_token: add idempotent set_minter/remove_minter with audit list and MAX_MINTERS cap (issue SPulse-Org#80); extend TTL on mint/burn/transfer - referral_registry: cap referral earnings at 50k XLM (issue SPulse-Org#77); retain surplus fees locally instead of round-tripping to caller (issue SPulse-Org#78); validate display_name length (issue SPulse-Org#76); add admin-callable migrate_user for legacy key migration (issue SPulse-Org#75); fix ReferrerNotRegistered error code collision (SPulse-Org#7→SPulse-Org#8); add TTL extensions on profile writes (issue SPulse-Org#81) Closes SPulse-Org#60, SPulse-Org#63, SPulse-Org#75, SPulse-Org#76, SPulse-Org#77, SPulse-Org#78, SPulse-Org#80, SPulse-Org#81, SPulse-Org#89
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Multi-contract hardening fix addressing issues #60, #63, #75-78, #80, #81, and #89.
Changes
leaderboard
eward ([HIGH]
rewardandadd_ptsare both callable by the market contract with divergent semantics — double-counting and token-supply divergence #63)MIN_BETis checked on gross, but the staked amount is net — fee-dependent minimum stake inconsistency #60)prediction_market
pulse_token
emove_minter with audit list and MAX_MINTERS cap ([LOW]
set_minter/remove_minterhave no idempotency or authorization check on the minter — redundant and confusing minter state #80)referral_registry
creditrefunds the referral fee to the caller (market contract) when there's no referrer — fragile trust assumption #76)register_referralhas nodisplay_namelength limit — storage DoS via oversized strings #75)transfer/burndon't extend TTL on balance keys — token balances can expire and be lost #81)Issues closed
Closes #60, #63, #75, #76, #77, #78, #80, #81, #89