This document describes the security considerations, risk model, and vulnerability reporting procedures for the RangeBet protocol.
- Security Model
- Potential Risks
- Mitigation Strategies
- Code Audits
- Security Vulnerability Reporting
- Bug Bounty Program
- Emergency Plan
The RangeBet protocol follows these core security principles:
- Principle of Least Privilege: Each contract and function has only the minimum permissions necessary to perform its task.
- Principle of Isolation: Each market operates independently, preventing vulnerabilities in one market from affecting others.
- Validation First: All external inputs are validated before contract logic is executed.
- Transparency: All logic and state changes are transparent and verifiable on-chain.
The RangeBet protocol makes the following trust assumptions:
- Owner Trust: The contract owner has market creation and closure authority and is assumed not to use these privileges maliciously.
- Code Integrity: The smart contract code and mathematical model are assumed to be free of defects.
- External Dependencies: The PRBMath library and OpenZeppelin libraries are assumed to be secure.
The major risk factors identified in the RangeBet protocol are:
- Mathematical Model Errors: Potential inaccurate pricing due to errors in the betting cost calculation formula
- Price Manipulation: Possibility of market price manipulation through large bets
- Liquidity Imbalance: Imbalances caused by excessive betting on specific bins
- Reentrancy Attacks: Possibility of reentrancy through external calls
- Integer Overflow/Underflow: Potential overflow/underflow when processing large numbers
- Gas Optimization Issues: High gas costs due to complex mathematical operations
- Centralization Risk: Excessive concentration of authority with the contract owner
- Parameter Setting Errors: Risks due to improper market parameter settings
RangeBet implements the following security strategies to mitigate risks:
- Mathematical Model Verification: Independent verification and simulation of the betting cost calculation formula
- Slippage Protection: Limiting price impact through the
maxCollateralparameter - Minimum/Maximum Betting Limits: Preventing excessive market manipulation
- Reentrancy Protection: Protecting key functions using the
nonReentrantmodifier - Using SafeMath: Using OpenZeppelin's SafeMath or Solidity 0.8+ built-in overflow protection
- Minimizing Dependencies: Minimizing interactions with external contracts
- Separation of Roles: Using multi-signature wallets for administrative functions
- Transparent Parameter Setting: Emitting events for all important parameter changes
- Gradual Upgrades: Phased upgrades and validation of changes
The RangeBet protocol undergoes the following audit steps:
- Internal Review: Code review among developers
- Formal Verification: Mathematical model verification using formal verification tools
- Automated Tools: Using automated security tools such as Slither, Mythril, etc.
- External Audit: Review by independent security audit companies
- [Example Audit Report Link] - Q1 2023 Audit (Planned)
If you discover a security vulnerability in the RangeBet protocol, please report it responsibly following these procedures:
- Private Reporting: Do not post vulnerabilities on public forums or GitHub issues.
- Email Reporting: Send vulnerability details to security@example.com.
- Encrypted Communication: If necessary, you can encrypt communications using a PGP key.
When reporting security vulnerabilities, please include the following information:
- Type and description of the vulnerability
- Steps to reproduce the vulnerability
- Potential impact
- Mitigation or fix suggestions, if possible
RangeBet operates a bug bounty program to encourage identification of security vulnerabilities.
- Smart contract code
- Mathematical model
- Protocol logic
- Critical: Serious threat to fund loss or system integrity (10,000 USD)
- High: Significant fund risk or critical function impairment (5,000 USD)
- Medium: Limited fund risk or function impairment (2,000 USD)
- Low: Minor issues or best practice suggestions (500 USD)
- Payment in ETH or stablecoins after bug confirmation and severity assessment
- Payment completed before bug disclosure
For urgent security issues:
- Email: emergency@example.com
- Telegram: @rangebet_security
- Phone: +1-XXX-XXX-XXXX (available 24/7)
- Alert Phase: Security team receives alert and assesses severity
- Mitigation Phase: Contract pause or emergency fix if necessary
- Resolution Phase: Vulnerability fix and verification
- Communication Phase: Providing situation updates to the community
- Post-Analysis Phase: Analyzing incident causes and security improvements
In case of serious vulnerabilities, the following functions can be used to pause part or all of the system:
// Emergency pause function in RangeBetManager
function emergencyPause() external onlyOwner {
// Implementation
}
// Unpause function
function unpause() external onlyOwner {
// Implementation
}The RangeBet team prioritizes the security of user funds. We strive to provide a secure prediction market platform through continuous security improvements and transparent communication.
If you have security questions or concerns, please contact security@example.com.