Smart Contracts
The contract layer is the source of truth for funds. It is intentionally small: a factory, three pool implementations, and a shared base.
Factory & minimal-proxy clones
Section titled “Factory & minimal-proxy clones”PoolFactory deploys one pool per Loot using the OpenZeppelin Clones minimal-proxy pattern. Three implementation templates — one per asset type — are deployed once; each new Loot is a lightweight proxy that delegates to the matching template and is then initialized with the campaign’s configuration.
Per-Loot deployment therefore costs a fraction of deploying a full contract, which is what makes launching many small campaigns economical. The factory also snapshots the current verifier address into each pool at creation time, so a pool’s authorizer is fixed for its lifetime even if the protocol later rotates the verifier.
Pool implementations
Section titled “Pool implementations”| Implementation | Holds | Deposit | Transfer |
|---|---|---|---|
| ETHPool | Native coin | msg.value | direct send |
| ERC20Pool | One ERC-20 | approve + transferFrom | safeTransfer |
| ERC721Pool | Specific NFTs | batch safeTransferFrom | per-token transfer |
All three extend a shared PoolBase (which inherits a reentrancy guard) holding the common configuration, the contribution ledger, the status logic, and the claim/reclaim flow.
Configuration & state
Section titled “Configuration & state”At creation the pool snapshots an immutable config: creator, verifier, token address, asset type, play style, start/end time, max claimers, and whether outside contribution is allowed. Alongside it the pool tracks state: remaining balance, totals contributed and claimed, contributor and claimer counts.
Status machine
Section titled “Status machine”Status is derived, not stored:
- Pending until the start time passes and the pool has at least one contribution.
- Active once both hold — claiming is open.
- Ended when the end time passes, all seats are claimed, or the balance hits zero.
Contributions are accepted only while Pending. This keeps a live campaign’s reward pool fixed, so participants always claim against a known balance.
Contribution ledger
Section titled “Contribution ledger”Each contributor’s amount — and, for ERC-721, the exact token IDs — is recorded on-chain. The first deposit from an address increments the contributor count. This ledger is what makes reclaim fair: no one can recover more than they put in.
Events & transparency
Section titled “Events & transparency”Every meaningful action emits an event — pool creation, contributions, claims, reclaims, the pool ending, and verifier/implementation/governance changes. The indexer consumes these to build read models, and anyone can reconstruct a Loot’s entire history from chain logs. Transparency is a property of the system, not a feature bolted on top.