Anyone can lock tokens for any beneficiary. Protocol fees deposited by any address flow proportionally to all locked-token holders — no owner, no bridges, no L2.
FeeVest combines public vesting creation with Synthetix-style revenue sharing — entirely on Bitcoin L1. No owner required for the core flow.
Deploy the WASM contract. Owner calls initialize(revenueToken) once to set the single OP_20 token used for both vesting and revenue distribution.
No owner needed. Any address calls depositAndVest(amount, beneficiary, cliff, duration). Tokens pulled via transferFrom and locked immediately.
Any address (fee router, DAO, individual) deposits revenue tokens. The global rewardPerToken accumulator updates in O(1) — zero iteration over beneficiaries.
Once the cliff block is reached, tokens begin vesting linearly. getPendingRelease = vested − already released. Computed per-block from immutable block height.
Beneficiary calls release() for vested tokens and claimRevenue() for their proportional revenue share. CEI enforced. Reentrancy-protected.
Every design decision in FeeVest prioritizes safety, permissionlessness, and mathematical correctness on Bitcoin L1.
Any address can fund a vesting schedule for any beneficiary. No owner restriction on depositAndVest(). Griefing mitigated by single-schedule-per-beneficiary guard.
Revenue distributed via rewardPerToken global accumulator. Each deposit is O(1). Claims computed instantly from stored debt snapshots — no loops ever.
Lock flag is a StoredBoolean in blockchain persistent storage — not in-memory. Survives per-call class re-instantiation unique to OPNet's execution model.
Cliff + linear release computed purely from block numbers — no timestamps, no oracle. Deterministic and manipulation-resistant on Bitcoin L1.
State written before every external Blockchain.call(). Checks (including computeReleasable) → Effects (updateReward + state) → Interactions. Audited line-by-line.
All arithmetic uses SafeMath.add/sub/mul/div. Zero floating point. No raw u256 operators. Rounding truncates toward zero, favoring the protocol.
Example: Alice 70% locked, Bob 30% locked. Two revenue deposits of 1 000 and 700 tokens.
| Participant | Locked | Share | Deposit 1 (1 000) | Deposit 2 (700) | Total earned |
|---|---|---|---|---|---|
| 🟠 Alice | 7 000 | 70% | 700 | 400 (4000 locked) | 1 100 ✓ |
| 🔵 Bob | 3 000 | 30% | 300 | 600 (3000 locked) | 600 ✓ |
| Σ Total | 10 000 | 100% | 1 000 | 700 | 1 700 ✓ |
Global accumulator updated in O(1). No loops over beneficiaries.
Bob earns 300. Total = 1 000. No dust left.
Next deposit of 700 tokens:
Result: 1100 + 600 = 1700 — perfectly balanced.
Connect your OP Wallet to vest tokens, release vested amounts, claim revenue, or deposit protocol fees.
View your vesting schedule, pending revenue, and interact with FeeVest directly from your browser.
All 29 critical vulnerability patterns and 20 OPNet-specific attack surfaces checked. Audited by OPNet Bob MCP.