Resources
Security
Multi-layered protection from contracts to backend.
- BondingCurve and token contracts bind each other’s addresses at deployment; state-transition functions are guarded by strict modifiers to prevent forged graduation calls
- ReentrancyGuard protects against reentrancy — every fund-moving function is marked nonReentrant
- An inSwap lock covers both internal curve settlement and PancakeSwap swaps, preventing nested circular calls
- The three-state TokenStatus variable automatically controls tax-settlement paths and feature permissions — no manual intervention
- TWAP windows are at least 30 minutes, preventing flash-loan price manipulation
- The token factory uses the OpenZeppelin Clones library, avoiding initialization vulnerabilities
- LP tokens are burned at graduation — liquidity is locked forever, preventing rug pulls
- MagpieLock checks TokenStatus before locking; curve-stage tokens are rejected
- The points system is stored off-chain with signature verification against cheating
- Emergency pause: all operations can be frozen instantly if a vulnerability is discovered, protecting user funds
Contract Architecture
| Contract | Responsibility |
|---|---|
| BondingCurve.sol | Curve market making, progress tracking, graduation trigger and liquidity migration |
| TokenFactory.sol | Clone-deploys new tokens, binds the curve contract, records token addresses |
| NoTaxToken.sol / TaxToken.sol | No-tax / tax token templates; the state machine switches settlement paths automatically |
| DividendDistributor.sol | Standalone dividend contract, activates distribution after graduation |
| MagpieLock.sol | All personal- and collective-pool locking logic |
| PriceOracle.sol | TWAP price reads for price-based commitment judgment |
| Admin.sol | Revenue withdrawal, parameter tuning, emergency pause |