33pragma solidity ^ 0.8.0 ;
44
55// import {Test} from "forge-std/Test.sol";
6+ import {Ownable} from "openzeppelin-contracts/access/Ownable.sol " ;
67import {EVaultTestBase} from "evk-test/unit/evault/EVaultTestBase.t.sol " ;
78import {SBuidlLiquidator, ISBToken} from "../../src/Liquidator/SBLiquidator.sol " ;
89import {IERC20 } from "openzeppelin-contracts/interfaces/IERC20.sol " ;
@@ -22,6 +23,7 @@ contract SBLiquidatorTests is EVaultTestBase {
2223 address borrower = makeAddr ("borrower " );
2324 address liquidator = makeAddr ("liquidator " );
2425 address receiver = makeAddr ("receiver " );
26+ address nonOwner = makeAddr ("nonOwner " );
2527
2628 IERC20 sbUnderlyingToken;
2729
@@ -45,7 +47,7 @@ contract SBLiquidatorTests is EVaultTestBase {
4547 address [] memory customLiquidationVaults = new address [](1 );
4648 customLiquidationVaults[0 ] = address (esBToken);
4749
48- sbLiquidator = new SBuidlLiquidator (address (evc), address ( this ) , customLiquidationVaults);
50+ sbLiquidator = new SBuidlLiquidator (address (evc), liquidator , customLiquidationVaults);
4951
5052 // Set LTV for esBToken as collateral
5153 eTST.setLTV (address (esBToken), 0.97e4 , 0.97e4 , 0 );
@@ -112,6 +114,11 @@ contract SBLiquidatorTests is EVaultTestBase {
112114 uint256 borrowerDebtBefore = eTST.debtOf (borrower);
113115 uint256 liquidatorDebtBefore = eTST.debtOf (liquidator);
114116
117+ vm.startPrank (nonOwner);
118+ vm.expectRevert (abi.encodeWithSelector (Ownable.OwnableUnauthorizedAccount.selector , nonOwner));
119+ sbLiquidator.liquidate (receiver, address (eTST), borrower, address (esBToken), type (uint256 ).max, 0 );
120+ vm.stopPrank ();
121+
115122 vm.startPrank (liquidator);
116123 sbLiquidator.liquidate (receiver, address (eTST), borrower, address (esBToken), type (uint256 ).max, 0 );
117124 vm.stopPrank ();
0 commit comments