Smart Contracts
Verified contracts, audits, and security details
Smart Contracts
Spray and Play's smart contracts are the foundation of the platform. All contracts are open source, verified, and audited.
Verified on Chain: All contracts listed below have verified source code published on their respective block explorers. You can inspect every line of code.
Contract Overview
Our smart contract architecture consists of three core systems:
1. Reserve System - Manages pooled capital and stability buffer
2. Spray System - Handles deposits and position creation
3. Payout System - Processes withdrawals and yield distribution
Verified Contract Addresses
Ethereum Mainnet
| Contract | Address | Version | Status |
|---|---|---|---|
| SprayRouter | 0x... | v2.1.0 | ✅ Active |
| ReservePool | 0x... | v2.0.2 | ✅ Active |
| PayoutController | 0x... | v2.1.0 | ✅ Active |
| Timelock | 0x... | v1.0.0 | ✅ Active |
| ProxyAdmin | 0x... | v1.0.0 | ✅ Active |
Base
| Contract | Address | Version | Status |
|---|---|---|---|
| SprayRouter | 0x... | v2.1.0 | ✅ Active |
| ReservePool | 0x... | v2.0.2 | ✅ Active |
| PayoutController | 0x... | v2.1.0 | ✅ Active |
Solana
| Program | Address | Version | Status |
|---|---|---|---|
| SprayProgram | ... | v1.0.0 | ✅ Active |
| ReserveVault | ... | v1.0.0 | ✅ Active |
Verify Before Interacting: Always verify contract addresses on official block explorers before approving transactions. Fake contracts are a common attack vector.
How to Verify Contracts
On EVM Chains (Ethereum, Base, etc.)
1. Visit Etherscan (or chain-specific explorer)
2. Search the address from the table above
3. Check the "Contract" tab
4. Verify:
- Contract source code is published
- Compiler version matches
- ABI is available
- Contract name matches expected
On Solana
1. Visit Solscan or SolanaFM
2. Search the program address
3. Check:
- Program is verified
- Source code matches GitHub
- Authority addresses are correct
Example Verification
Example: Verifying SprayRouter on Base
1. Go to basescan.org
2. Enter: 0x... [actual address]
3. Click "Contract" tab
4. Look for:
✅ Contract Source Code Verified (Exact Match)
✅ Compiler Version: v0.8.19+commit.7dd6d404
✅ Optimization Enabled: Yes, 200 runsContract Architecture
Reserve Pool
The Reserve Pool manages all deposited capital:
Key Functions:
- deposit() // Receive user deposits
- allocate() // Deploy capital to trenches
- rebalance() // Adjust allocations
- emergencyExit() // Circuit breakerSafety Features:
- 10% stability buffer requirement
- Health checks before allocations
- Emergency pause capability
- Multi-sig required for parameter changes
Spray Router
Handles the spray (deposit) flow:
Key Functions:
- spray() // Create new position
- sprayWithBoost() // Spray with boost points
- previewSpray() // Calculate expected outcome
- getTrenchInfo() // Read trench statusSafety Features:
- Slippage protection
- Minimum/maximum deposit limits
- Trench availability checks
- Position tracking
Payout Controller
Manages withdrawals and yield distribution:
Key Functions:
- withdraw() // Process mature positions
- claimYield() // Distribute earnings
- earlyExit() // Force exit with penalty
- getPosition() // Read position detailsSafety Features:
- Lock period enforcement
- Anti-flash loan protections
- Gradual withdrawal limits
- Rate limiting
Audit History
Completed Audits
#### Trail of Bits - Q1 2026
| Detail | Information |
|---|---|
| Scope | ReservePool, SprayRouter, PayoutController |
| Duration | 4 weeks |
| Findings | 12 total (3 Critical, 4 High, 5 Medium) |
| Status | All critical and high findings resolved |
Key Findings Resolved:
- C1: Missing balance deduction in spray flow ✅ Fixed
- C2: Race condition in deposit processing ✅ Fixed
- C3: Status deadlock in payout system ✅ Fixed
Report: View Full Report
#### OpenZeppelin - Q1 2026
| Detail | Information |
|---|---|
| Scope | Governance, Timelock, ProxyAdmin |
| Duration | 3 weeks |
| Findings | 8 total (0 Critical, 2 High, 6 Medium) |
| Status | All findings resolved |
Key Findings Resolved:
- H1: Timelock duration inconsistency ✅ Fixed
- H2: Missing event emissions ✅ Fixed
Report: View Full Report
Ongoing Audits
#### CertiK - In Progress
| Detail | Information |
|---|---|
| Scope | Full platform audit |
| Started | February 2026 |
| Expected Completion | March 2026 |
| Status | 🔄 In Progress |
Audit Timeline
2026 Q1: Trail of Bits (Complete)
2026 Q1: OpenZeppelin (Complete)
2026 Q1: CertiK (In Progress)
2026 Q2: Planned re-audit of new features
2026 Q3: Continuous monitoring programSecurity Features
Timelock Protection
24-48 Hour Delay: All critical parameter changes have a mandatory waiting period, giving users time to react.
Protected Operations:
- Fee rate changes
- Insurance buffer adjustments
- Trench parameter updates
- Contract upgrades
Timelock Flow:
1. Multi-sig proposes change
2. 24-48 hour waiting period begins
3. Users notified via Discord/Twitter
4. Waiting period expires
5. Multi-sig executes changeUpgradeable Proxies
Contracts use the OpenZeppelin proxy pattern:
- Implementation: Contains logic (can be upgraded)
- Proxy: Holds state (never changes)
- Admin: Controls upgrades (timelocked + multi-sig)
Upgrade Process:
1. New implementation deployed
2. Upgrade proposed to timelock
3. 48-hour waiting period
4. Multi-sig executes upgrade
5. Old implementation preserved
Emergency Controls
Circuit Breakers:
| Function | Trigger | Effect |
|---|---|---|
| Pause Deposits | Reserve health < 10% | New sprays blocked |
| Pause Withdrawals | Suspicious activity | Withdrawals delayed |
| Emergency Exit | Critical vulnerability | Graceful fund recovery |
Multi-sig Requirements:
| Action | Signatures Required | Participants |
|---|---|---|
| Emergency Pause | 2-of-3 | Security team |
| Parameter Change | 3-of-5 | Core team + advisors |
| Contract Upgrade | 4-of-7 | Core team + auditors |
Code Quality Standards
Development Practices
- ✅ 100% unit test coverage for financial functions
- ✅ Formal verification for critical math
- ✅ Fuzzing tests for edge cases
- ✅ Slither static analysis
- ✅ Mythril symbolic execution
Testing Infrastructure
| Test Type | Coverage | Tools |
|---|---|---|
| Unit Tests | >95% | Hardhat, Foundry |
| Integration Tests | Full flows | Hardhat Network |
| Fuzzing | Critical functions | Echidna |
| Static Analysis | All contracts | Slither, Mythril |
Bug Bounty Program
Rewards
We partner with Immunefi for bug bounty management.
| Severity | Reward Range |
|---|---|
| Critical | Up to $100,000 |
| High | Up to $50,000 |
| Medium | Up to $10,000 |
| Low | Up to $2,000 |
Scope
In Scope:
- All deployed smart contracts
- Contract upgrade mechanisms
- Admin functions and timelock
Out of Scope:
- Frontend code
- Third-party dependencies
- Already disclosed audit findings
How to Report
1. Visit Immunefi - Spray and Play
2. Submit detailed report
3. Allow 48 hours for response
4. Responsible disclosure required
Contract Verification Tools
Recommended Tools
| Tool | Purpose | Link |
|---|---|---|
| Etherscan | Contract verification | etherscan.io |
| Tenderly | Transaction simulation | tenderly.co |
| DefiSafety | Protocol safety scores | defisafety.com |
| Exponential | DeFi risk assessment | exponential.fi |
Simulation Before Signing
Use Tenderly to simulate transactions before signing:
1. Connect your wallet
2. Initiate the transaction (don't sign)
3. Copy the transaction data
4. Paste into Tenderly Simulator
5. Review exact state changes
6. Sign only if simulation looks correct
GitHub Repository
All contract source code is open source:
- Repository:
github.com/playtrenches/contracts - License: MIT
- Last Commit: View latest
- Releases: View all versions
Verify on Chain: While we maintain open source code, always verify the deployed contract matches the GitHub source before interacting.
Documentation
Technical Docs
Developer Resources
Security Contacts
- Bug Reports: security@playtrenches.xyz
- Immunefi: Immunefi Program
- Emergency: PGP Key
---
Contracts last updated: February 2026
Next audit scheduled: Q2 2026