Skip to content

Commit ccaa37a

Browse files
committed
FeeDistributor: cache allocTotal
1 parent 9992ce4 commit ccaa37a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/NFTXFeeDistributorV3.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ contract NFTXFeeDistributorV3 is
115115

116116
uint256 wethBalance = WETH.balanceOf(address(this));
117117

118-
// TODO: cache allocTotal
119-
if (allocTotal == 0) {
118+
uint256 _allocTotal = allocTotal;
119+
if (_allocTotal == 0) {
120120
WETH.transfer(treasury, wethBalance);
121121
return;
122122
}
@@ -128,7 +128,7 @@ contract NFTXFeeDistributorV3 is
128128

129129
uint256 wethAmountToSend = leftover +
130130
(wethBalance * feeReceiver.allocPoint) /
131-
allocTotal;
131+
_allocTotal;
132132

133133
bool tokenSent = _sendForReceiver(
134134
feeReceiver,

0 commit comments

Comments
 (0)