Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
refactor: early return if no royalty engine set
Browse files Browse the repository at this point in the history
  • Loading branch information
kulkarohan committed Nov 15, 2023
1 parent 7368105 commit 1f8691d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contracts/common/FeePayoutSupport/FeePayoutSupportV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ contract FeePayoutSupportV1 is OutgoingTransferSupportV1 {
address _payoutCurrency,
uint256 _gasLimit
) internal returns (uint256, bool) {
// Early return if no royalty engine.
if (address(royaltyEngine) == address(0)) return (_amount, false);

// If no gas limit was provided or provided gas limit greater than gas left, just pass the remaining gas.
uint256 gas = (_gasLimit == 0 || _gasLimit > gasleft()) ? gasleft() : _gasLimit;

Expand Down

0 comments on commit 1f8691d

Please sign in to comment.