Skip to content

Commit b8ccd6a

Browse files
committed
short-circuit if no protocolFeeRecipient: cheaper on gas in this case, and ensures no transfer to address(0) is possible
1 parent 6a621bc commit b8ccd6a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/FundsLib.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ library FundsLib {
7575

7676
uint256 feeAmount = amount * p.fee / 1e18;
7777

78-
{
78+
if (p.protocolFeeRecipient != address(0)) {
7979
uint256 protocolFeeAmount = feeAmount * p.protocolFee / 1e18;
8080

8181
if (protocolFeeAmount != 0) {

0 commit comments

Comments
 (0)