From 34b8d280903297d349961b1ba69ba99c9d8219c4 Mon Sep 17 00:00:00 2001 From: nezouse Date: Wed, 24 Apr 2024 12:32:09 +0200 Subject: [PATCH] Remove duplicated require --- contracts/VesselManagerOperations.sol | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/contracts/VesselManagerOperations.sol b/contracts/VesselManagerOperations.sol index ad25484..913ea15 100644 --- a/contracts/VesselManagerOperations.sol +++ b/contracts/VesselManagerOperations.sol @@ -59,7 +59,7 @@ contract VesselManagerOperations is IVesselManagerOperations, UUPSUpgradeable, R * starting from the one with the lowest collateral ratio in the system, and moving upwards. */ function liquidateVessels(address _asset, uint256 _n) external override nonReentrant { - if(!IAdminContract(adminContract).getRedeemerIsWhitelisted(msg.sender)) { + if (!IAdminContract(adminContract).getRedeemerIsWhitelisted(msg.sender)) { revert VesselManagerOperations__LiquidatorNotWhitelisted(); } @@ -114,10 +114,9 @@ contract VesselManagerOperations is IVesselManagerOperations, UUPSUpgradeable, R * Attempt to liquidate a custom list of vessels provided by the caller. */ function batchLiquidateVessels(address _asset, address[] memory _vesselArray) public override nonReentrant { - if(!IAdminContract(adminContract).getRedeemerIsWhitelisted(msg.sender)) { + if (!IAdminContract(adminContract).getRedeemerIsWhitelisted(msg.sender)) { revert VesselManagerOperations__LiquidatorNotWhitelisted(); } - require(IAdminContract(adminContract).getRedeemerIsWhitelisted(msg.sender), "VesselManagerOperations: Liquidator not whitelisted"); if (_vesselArray.length == 0 || _vesselArray.length > BATCH_SIZE_LIMIT) { revert VesselManagerOperations__InvalidArraySize(); } @@ -878,7 +877,10 @@ contract VesselManagerOperations is IVesselManagerOperations, UUPSUpgradeable, R uint256 _price ) internal view { address redeemer = msg.sender; - require(IAdminContract(adminContract).getRedeemerIsWhitelisted(redeemer), "VesselManagerOperations: Redeemer not whitelisted"); + require( + IAdminContract(adminContract).getRedeemerIsWhitelisted(redeemer), + "VesselManagerOperations: Redeemer not whitelisted" + ); uint256 redemptionBlockTimestamp = IAdminContract(adminContract).getRedemptionBlockTimestamp(_asset); if (redemptionBlockTimestamp > block.timestamp) {