Commit 22f5352
refactor(Dispenser): put the Dispenser behind a DispenserProxy (stable-address upgradeability)
Makes the Dispenser proxy-based, following the TokenomicsProxy / LiquidityManagerProxy
pattern, so future Dispenser logic fixes become one-tx implementation swaps behind a stable
address instead of a whole-stack redeploy (the L1 deposit processors bind to the dispenser
address immutably, and the L2 target dispensers bind to their L1 processor — a stable proxy
address means those bindings never have to change again).
- New contracts/proxies/DispenserProxy.sol: EIP-1822-style proxy, implementation slot
keccak256("PROXY_DISPENSER"), constructor (implementation, initData) delegatecall-init,
Gnosis-Safe-style payable fallback (the Dispenser has payable claim functions).
- Dispenser implementation constructor now sets only bytecode immutables
(olas, tokenomics, retainer/retainerHash, defaultMinStakingWeight,
defaultMaxStakingIncentive); mutable state moves to initialize() (treasury, voteWeighting,
maxNumClaimingEpochs, maxNumStakingTargets), guarded by AlreadyInitialized.
- tokenomics is promoted to an implementation immutable: it points at the stable
TokenomicsProxy address and is read on every claim (hot path — immutables cost no SLOAD).
changeManagers accordingly drops its tokenomics parameter (rewiring tokenomics now means
deploying a new implementation and calling changeImplementation); treasury and
voteWeighting stay mutable.
- New changeImplementation(address) (owner-gated), same shape and name as
LiquidityManagerCore / BuyBackBurner.
- Storage layout below the immutables is frozen append-only for upgrade safety (documented
in-code; no gap — flat contract, matching the Tokenomics convention).
Tests:
- New test/DispenserProxy.t.sol (9 tests): proxy constructor guards, initialization via the
proxy delegatecall, re-init protection (proxy + direct impl), owner-gated
changeImplementation preserving proxy state while swapping immutables/logic, slot content.
- test/Dispenser.t.sol and the hardhat suites (DispenserDevIncentives,
DispenserStakingIncentives) now deploy the Dispenser behind DispenserProxy, with the
deploy order inverted (Tokenomics proxy first, then Dispenser impl+proxy, then repoint
Tokenomics/Treasury) since tokenomics is a constructor immutable; constructor/initialize
negative tests split accordingly.
All suites green: forge (Dispenser 3, DispenserProxy 9, Depository, Treasury), hardhat full
run, eslint/solhint clean on changed files.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 029b557 commit 22f5352
6 files changed
Lines changed: 405 additions & 99 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| |||
263 | 266 | | |
264 | 267 | | |
265 | 268 | | |
266 | | - | |
| 269 | + | |
267 | 270 | | |
268 | 271 | | |
269 | 272 | | |
| |||
280 | 283 | | |
281 | 284 | | |
282 | 285 | | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
283 | 289 | | |
284 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
285 | 295 | | |
286 | 296 | | |
287 | 297 | | |
288 | 298 | | |
| 299 | + | |
| 300 | + | |
289 | 301 | | |
290 | 302 | | |
291 | 303 | | |
292 | 304 | | |
293 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
294 | 309 | | |
295 | 310 | | |
296 | 311 | | |
| |||
302 | 317 | | |
303 | 318 | | |
304 | 319 | | |
305 | | - | |
306 | | - | |
307 | 320 | | |
308 | 321 | | |
309 | 322 | | |
| |||
320 | 333 | | |
321 | 334 | | |
322 | 335 | | |
323 | | - | |
| 336 | + | |
| 337 | + | |
324 | 338 | | |
325 | | - | |
326 | | - | |
327 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
328 | 343 | | |
329 | 344 | | |
330 | 345 | | |
331 | | - | |
332 | | - | |
333 | 346 | | |
334 | | - | |
335 | | - | |
336 | 347 | | |
337 | 348 | | |
338 | 349 | | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | 350 | | |
345 | | - | |
346 | | - | |
| 351 | + | |
347 | 352 | | |
348 | 353 | | |
349 | 354 | | |
350 | 355 | | |
351 | | - | |
352 | | - | |
| 356 | + | |
353 | 357 | | |
354 | 358 | | |
355 | 359 | | |
| |||
363 | 367 | | |
364 | 368 | | |
365 | 369 | | |
366 | | - | |
367 | | - | |
368 | 370 | | |
369 | 371 | | |
370 | 372 | | |
371 | | - | |
372 | | - | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
377 | 435 | | |
378 | 436 | | |
379 | 437 | | |
| |||
685 | 743 | | |
686 | 744 | | |
687 | 745 | | |
688 | | - | |
| 746 | + | |
| 747 | + | |
689 | 748 | | |
690 | 749 | | |
691 | | - | |
| 750 | + | |
692 | 751 | | |
693 | 752 | | |
694 | 753 | | |
695 | 754 | | |
696 | 755 | | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | 756 | | |
704 | 757 | | |
705 | 758 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
77 | 86 | | |
78 | 87 | | |
79 | 88 | | |
| |||
0 commit comments