-
Notifications
You must be signed in to change notification settings - Fork 51
Open
Labels
ETA - less than 12 hrsenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededsmart-contract
Description
Description:
Implement configurable rate limiting (e.g., max bets per user per time window, max events per admin) to reduce spam and abuse.
Requirements and Context:
- Must be secure, tested, and documented
- Should allow admin to set rate limits (e.g., per user per event or global)
- Should enforce limits in
place_betand optionally increate_event - Should use time windows (e.g., last N ledger closes or seconds)
- Should emit clear error when limit exceeded
- Must not block legitimate high-volume use with reasonable limits
Suggested Execution:
-
Fork the repo and create a branch
git checkout -b feature/rate-limiting
-
Implement changes
- Write contract:
src/lib.rs(rate limit checks) - Add rate_limiter module:
src/rate_limiter.rs - Update storage and validation; add documentation and NatSpec-style comments
- Write contract:
-
Test and commit
- Run tests; cover at limit, over limit, window expiry
- Include test output and security notes
Example Commit Message:
feat: implement rate limiting and anti-spam for bets and events
Guidelines:
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 72 hours
Metadata
Metadata
Assignees
Labels
ETA - less than 12 hrsenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededsmart-contract