Skip to content

Commit

Permalink
Remove unnecessary fallback() functions
Browse files Browse the repository at this point in the history
In `FeeCollector.sol`, `PositionFactory.sol` and `AdminService.sol`, both a fallback() and receive() function are specified. No code is executed in these contracts upon receiving ether, therefore, fallback() can be omitted as it is redundant.
  • Loading branch information
Tranquil-Flow committed Mar 8, 2024
1 parent 61b7fac commit f79c7b5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/FeeCollector.sol
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,6 @@ contract FeeCollector is Ownable {
SafeTransferLib.safeTransfer(ERC20(_token), msg.sender, withdrawAmt);
}

/**
* @notice Executes when native is sent to this contract through a non-existent function.
*/
fallback() external payable { } // solhint-disable-line no-empty-blocks

/**
* @notice Executes when native is sent to this contract with a plain transaction.
*/
Expand Down
5 changes: 0 additions & 5 deletions src/PositionFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ contract PositionFactory is Ownable {
SafeTransferLib.safeTransfer(ERC20(_token), msg.sender, balance);
}

/**
* @notice Executes when native is sent to this contract through a non-existent function.
*/
fallback() external payable { } // solhint-disable-line no-empty-blocks

/**
* @notice Executes when native is sent to this contract with a plain transaction.
*/
Expand Down
5 changes: 0 additions & 5 deletions src/services/AdminService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ contract AdminService {
SafeTransferLib.safeTransfer(ERC20(_token), msg.sender, balance);
}

/**
* @notice Executes when native is sent to this contract through a non-existent function.
*/
fallback() external payable { } // solhint-disable-line no-empty-blocks

/**
* @notice Executes when native is sent to this contract with a plain transaction.
*/
Expand Down

0 comments on commit f79c7b5

Please sign in to comment.