Commit b7a78d0
authored
feat(incentives): add protocol fee (#1691)
**Motivation:**
We want to add a configurable protocol fee mechanism to the
RewardsCoordinator contract to enable revenue generation. This allows
reward submitters to opt into paying fees while maintaining backward
compatibility with existing integrations.
**Modifications:**
- Added protocolFee (fixed constant amount) and feeRecipient state
variables
- Implemented setOptInProtocolFee() for submitters to opt into fee
payments
- Implemented setFeeRecipient() (owner-only) to set the fee destination
address
**Result:**
Submitters can voluntarily enable protocol fees on their reward
distributions. When opted in, the fixed fee amount is deducted and sent
to the designated recipient. Existing integrations continue working
unchanged since fees are disabled by default.1 parent c946cdc commit b7a78d0
File tree
12 files changed
+759
-83
lines changed- script
- deploy
- devnet
- local
- releases
- utils
- snapshots
- src
- contracts
- core
- storage
- interfaces
- test/unit
12 files changed
+759
-83
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
| 315 | + | |
| 316 | + | |
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | 222 | | |
226 | 223 | | |
227 | 224 | | |
| |||
237 | 234 | | |
238 | 235 | | |
239 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
| 331 | + | |
331 | 332 | | |
332 | 333 | | |
333 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
929 | | - | |
| 929 | + | |
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
| 526 | + | |
526 | 527 | | |
527 | 528 | | |
528 | 529 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | 205 | | |
208 | 206 | | |
209 | 207 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
| |||
164 | 173 | | |
165 | 174 | | |
166 | 175 | | |
167 | | - | |
| 176 | + | |
168 | 177 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
417 | 428 | | |
418 | 429 | | |
419 | 430 | | |
| |||
431 | 442 | | |
432 | 443 | | |
433 | 444 | | |
434 | | - | |
| 445 | + | |
| 446 | + | |
435 | 447 | | |
436 | 448 | | |
437 | 449 | | |
| |||
606 | 618 | | |
607 | 619 | | |
608 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
609 | 628 | | |
610 | 629 | | |
611 | 630 | | |
| |||
643 | 662 | | |
644 | 663 | | |
645 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
646 | 674 | | |
647 | 675 | | |
648 | 676 | | |
| |||
0 commit comments