Skip to content

Commit

Permalink
Merge pull request #13 from ChorusOne/optimize_require
Browse files Browse the repository at this point in the history
Merge both requires into one
  • Loading branch information
enriquefynn authored Jan 17, 2024
2 parents db14be7 + cc15289 commit bc3f566
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/FeeRewardsManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ library CalculateAndSendRewards {
address owner,
address withdrawalCredential
) public {
require(address(this).balance != 0, "Nothing to distribute");

uint256 ownerAmount = (address(this).balance * feeNominator) /
FEE_DENOMINATOR;
uint256 returnedAmount = address(this).balance - ownerAmount;
require(
ownerAmount != 0 || returnedAmount != 0,
"Nothing to distribute"
);
emit CollectedReward(
withdrawalCredential,
returnedAmount,
Expand Down

0 comments on commit bc3f566

Please sign in to comment.