Commit c60fbe5
Behavioral fixes on top of the proxy-based Dispenser, each with a regression test that
fails on the pre-fix code (verified by running the new suite against the parent commit):
- #12 (High): the public state-mutating calculateStakingIncentives set the one-way
mapZeroWeightEpochRefunded flag while deferring the actual refund to the caller, so a
standalone external call could permanently mark a zero-weight epoch refunded without any
refund executed. The flag and Tokenomics.refundFromStaking are now atomic in the same
call; totalReturnAmount accordingly no longer includes zero-weight epoch amounts (callers
refunding it would double-count).
- #9 (Low): the withheld-covered portion of claimed staking incentives is paid from OLAS
already minted under a previous allocation, but the current allocation was still counted
as inflation spent. Both the single-claim and batch netting paths now return the
withheld-used amount to staking inflation (refundFromStaking directly on the single path;
via totalAmounts[2] on the batch path).
- #25 (Informative): addNominee now clears mapRemovedNomineeEpochs from a previous nominee
lifecycle, so a removed-then-re-added nominee no longer permanently reverts on every claim
(Overflow from the stale removal epoch). The Dispenser no longer relies on the upstream
Vote Weighting enforcing "remove is final".
- #8 (Informative): changeManagers now only swaps the voteWeighting address while staking
incentives are paused (StakingIncentivesPaused or AllPaused; new Unpaused error), forcing
outstanding claims to be settled before the nominee set is orphaned. Treasury changes stay
ungated.
New test/DispenserFixes.t.sol (5 tests, all green; all 5 fail on the parent commit):
atomic zero-weight refund + no double refund on claim, withheld-reuse inflation credit
(single + batch), remove-then-re-add claimability, pause-gated voteWeighting swap.
Existing suites unaffected: forge Dispenser 3/3 + proxy 9/9, hardhat 31 passing, full
yarn test green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 22f5352 commit c60fbe5
2 files changed
Lines changed: 361 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
237 | 240 | | |
238 | 241 | | |
239 | 242 | | |
| |||
709 | 712 | | |
710 | 713 | | |
711 | 714 | | |
| 715 | + | |
712 | 716 | | |
| 717 | + | |
713 | 718 | | |
714 | 719 | | |
715 | 720 | | |
| 721 | + | |
716 | 722 | | |
717 | 723 | | |
718 | 724 | | |
719 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
720 | 730 | | |
721 | 731 | | |
722 | 732 | | |
| |||
761 | 771 | | |
762 | 772 | | |
763 | 773 | | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
764 | 782 | | |
765 | 783 | | |
766 | 784 | | |
| |||
833 | 851 | | |
834 | 852 | | |
835 | 853 | | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
836 | 860 | | |
837 | 861 | | |
838 | 862 | | |
| |||
937 | 961 | | |
938 | 962 | | |
939 | 963 | | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
940 | 967 | | |
941 | 968 | | |
942 | 969 | | |
| |||
1016 | 1043 | | |
1017 | 1044 | | |
1018 | 1045 | | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
1019 | 1049 | | |
1020 | | - | |
| 1050 | + | |
1021 | 1051 | | |
1022 | 1052 | | |
1023 | 1053 | | |
| |||
1140 | 1170 | | |
1141 | 1171 | | |
1142 | 1172 | | |
| 1173 | + | |
1143 | 1174 | | |
1144 | 1175 | | |
| 1176 | + | |
1145 | 1177 | | |
1146 | 1178 | | |
1147 | 1179 | | |
1148 | 1180 | | |
| 1181 | + | |
1149 | 1182 | | |
1150 | 1183 | | |
1151 | 1184 | | |
1152 | 1185 | | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
1153 | 1191 | | |
1154 | 1192 | | |
1155 | 1193 | | |
| |||
0 commit comments