@@ -17,6 +17,7 @@ import "./FeePoolState.sol";
17
17
import "./FeePoolEternalStorage.sol " ;
18
18
import "./DelegateApprovals.sol " ;
19
19
20
+
20
21
// https://docs.synthetix.io/contracts/FeePool
21
22
contract FeePool is Proxyable , SelfDestructible , LimitedSetup , MixinResolver {
22
23
using SafeMath for uint ;
@@ -79,6 +80,7 @@ contract FeePool is Proxyable, SelfDestructible, LimitedSetup, MixinResolver {
79
80
bytes32 private constant CONTRACT_SYNTHETIXSTATE = "SynthetixState " ;
80
81
bytes32 private constant CONTRACT_REWARDESCROW = "RewardEscrow " ;
81
82
bytes32 private constant CONTRACT_DELEGATEAPPROVALS = "DelegateApprovals " ;
83
+ bytes32 private constant CONTRACT_REWARDSDISTRIBUTION = "RewardsDistribution " ;
82
84
83
85
bytes32 [24 ] private addressesToCache = [
84
86
CONTRACT_SYSTEMSTATUS,
@@ -90,7 +92,8 @@ contract FeePool is Proxyable, SelfDestructible, LimitedSetup, MixinResolver {
90
92
CONTRACT_ISSUER,
91
93
CONTRACT_SYNTHETIXSTATE,
92
94
CONTRACT_REWARDESCROW,
93
- CONTRACT_DELEGATEAPPROVALS
95
+ CONTRACT_DELEGATEAPPROVALS,
96
+ CONTRACT_REWARDSDISTRIBUTION
94
97
];
95
98
96
99
/* ========== ETERNAL STORAGE CONSTANTS ========== */
@@ -155,6 +158,11 @@ contract FeePool is Proxyable, SelfDestructible, LimitedSetup, MixinResolver {
155
158
return DelegateApprovals (requireAndGetAddress (CONTRACT_DELEGATEAPPROVALS, "Missing DelegateApprovals address " ));
156
159
}
157
160
161
+ function rewardsDistribution () internal view returns (IRewardsDistribution) {
162
+ return
163
+ IRewardsDistribution (requireAndGetAddress (CONTRACT_REWARDSDISTRIBUTION, "Missing RewardsDistribution address " ));
164
+ }
165
+
158
166
function recentFeePeriods (uint index )
159
167
external
160
168
view
@@ -245,7 +253,7 @@ contract FeePool is Proxyable, SelfDestructible, LimitedSetup, MixinResolver {
245
253
* @notice The RewardsDistribution contract informs us how many SNX rewards are sent to RewardEscrow to be claimed.
246
254
*/
247
255
function setRewardsToDistribute (uint amount ) external {
248
- address rewardsAuthority = resolver. getAddress ( " RewardsDistribution " );
256
+ address rewardsAuthority = rewardsDistribution ( );
249
257
require (messageSender == rewardsAuthority || msg .sender == rewardsAuthority, "Caller is not rewardsAuthority " );
250
258
// Add the amount of SNX rewards to distribute on top of any rolling unclaimed amount
251
259
_recentFeePeriodsStorage (0 ).rewardsToDistribute = _recentFeePeriodsStorage (0 ).rewardsToDistribute.add (amount);
@@ -539,7 +547,6 @@ contract FeePool is Proxyable, SelfDestructible, LimitedSetup, MixinResolver {
539
547
// return _value;
540
548
// }
541
549
// return fee;
542
-
543
550
}
544
551
545
552
/**
0 commit comments