Features/issue 14 permissioned creation tiered market levels#28
Merged
hman38705 merged 3 commits intosolutions-plug:mainfrom Feb 21, 2026
Conversation
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.
Pull Request: Permissioned Creation & Tiered Market Levels
Issue
Closes #14
Description
Implements a comprehensive system to prevent spam and reward reputable creators with lower fees through:
Changes
New Features
calculate_tiered_fee()applies tier-based discountsAPI Changes
create_marketsignature updatedNew Public Functions
set_creator_reputation(creator, reputation)get_creator_reputation(creator)set_creation_deposit(amount)get_creation_deposit()release_creation_deposit(market_id, native_token)Verification Checklist
All requirements from Issue #14 have been implemented and tested:
✅ Market creation fails without sufficient deposit
test_market_creation_fails_without_deposit✅ Deposit released after market resolution
test_deposit_released_after_resolution✅ Pro reputation skips deposit
test_pro_reputation_skips_deposit✅ Institutional reputation skips deposit
test_institutional_reputation_skips_deposit✅ Commission rates decrease with tier
test_tiered_commission_rates✅ Reputation management works
test_reputation_managementTest Results
Files Changed
contracts/predict-iq/src/types.rs- Added MarketTier, CreatorReputation enumscontracts/predict-iq/src/errors.rs- Added InsufficientDeposit errorcontracts/predict-iq/src/modules/markets.rs- Updated create_market, added reputation functionscontracts/predict-iq/src/modules/fees.rs- Added calculate_tiered_feecontracts/predict-iq/src/lib.rs- Updated public APIcontracts/predict-iq/src/test.rs- Added comprehensive testscontracts/predict-iq/benches/gas_benchmark.rs- Updated benchmarksSecurity Considerations
Gas Optimization
Migration Guide
For Contract Integrators
Update all
create_marketcalls to include new parameters:For Admins
New admin functions available:
Documentation
See
IMPLEMENTATION_ISSUE_14.mdfor detailed implementation notes and usage examples.Next Steps
Checklist
Related Issues
Branch:
features/issue-14-Permissioned-Creation-Tiered-Market-LevelsTarget:
develop(ormainif develop doesn't exist)Type: Feature
Breaking Changes: Yes -
create_marketsignature updated