Concepts
Pool lifecycle
Every pool has three phases: open, expired, and released. Withdraw rules change at each boundary.
Phase 1 — Open (now ≤ expiresAt)
- Funders may call
fund()(ETH) orfundERC20(token, amount). Contributions below the USD minimum revert. - Any owner may call
withdraw(amount)orcheaperWithdraw()(full balance) for ETH, andwithdrawTokenAmount(token, amount)orwithdrawToken(token)(full balance) for ERC-20s. - Events:
Funded,FundedERC20,Withdrawn,WithdrawnToken.
Phase 2 — Expired (now > expiresAt, not yet released)
- New funding reverts with
CommunityPool__PoolExpired. - Owner withdraws revert with
CommunityPool__WithdrawDisabledAfterExpiry. - Anyone may call
releaseExpiredFundsToDeployer(), which sweeps all ETH and whitelisted ERC-20 balances to the original deployer.
Phase 3 — Released
After release, the contract has zero balance in the tracked assets. Per-funder totals are not stored on-chain — capture Funded and FundedERC20 events off-chain if you need historical attribution.
Partial vs. full withdraws
The current contract supports both partial (withdraw(amount), withdrawTokenAmount(token, amount)) and full (cheaperWithdraw(), withdrawToken(token)) withdraws while the pool is open.
Who can call what
| Function | Phase | Caller |
|---|---|---|
fund / fundERC20 | Open | Anyone |
withdraw / cheaperWithdraw | Open | Any owner |
withdrawToken / withdrawTokenAmount | Open | Any owner |
releaseExpiredFundsToDeployer | Expired | Anyone |
Related
- Smart-contract reference for function signatures and custom errors.