On-chain vesting with cliff + linear release, plus proportional revenue sharing. Protocol fees flow directly to vested holders — no bridges, no L2, no wrapping.
VestingVault combines battle-tested vesting mechanics with Synthetix-style reward distribution — entirely on Bitcoin L1.
Deploy the WASM contract with no constructor args. Then call initialize(vestingToken, revenueToken) once as owner to configure token addresses. One-time, owner-only, replay-protected.
Owner adds a vesting schedule per beneficiary: amount, cliff (blocks), and linear duration. Tokens are pulled via transferFrom and locked in the vault.
Any address deposits revenue tokens (protocol fees, trading fees, etc.). The global rewardPerToken accumulator updates in O(1) — no iteration over beneficiaries.
Once the cliff block passes, tokens start vesting linearly. releasableAmount = vested − already released. Checked per-block with no rounding attacks.
Beneficiary calls release() for vested tokens and claimRevenue() for their proportional share of all deposited revenue. State clears correctly.
Every design decision in VestingVault prioritizes safety, gas-efficiency, and mathematical correctness.
Cliff + linear release computed purely from block numbers — no timestamps, no oracle dependency. Deterministic and manipulation-resistant on Bitcoin L1.
Revenue distributed via rewardPerToken global accumulator. Each deposit is O(1). Claims computed instantly from stored debt snapshots — no loops.
The lock flag is a StoredBoolean in blockchain storage — not in-memory. Survives per-call class re-instantiation unique to OPNet's execution model.
All 19 arithmetic operations use SafeMath.add/sub/mul/div. Zero floating point. Rounding truncates toward zero, favoring the protocol.
State is always written before external Blockchain.call(). Checks → Effects → Interactions enforced in all 4 state-changing methods. Audited line-by-line.
Uses Blockchain.tx.sender (direct caller), never tx.origin. Prevents delegation attacks. Owner restricted to addVesting() only.
Example: Alice 70% locked, Bob 30% locked. Two deposits of 1 000 and 700 revenue 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, no dust.
Connect your OP Wallet to release vested tokens, claim revenue, or deposit protocol fees.
View your vesting schedule, pending revenue, and interact with the vault directly from your browser.
All 29 critical vulnerability patterns and 20 OPNet-specific attack surfaces checked.