diff --git a/src/test/HealthCheck.t.sol b/src/test/HealthCheck.t.sol index 56daae6..d1f59f4 100644 --- a/src/test/HealthCheck.t.sol +++ b/src/test/HealthCheck.t.sol @@ -1,11 +1,13 @@ // SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.18; -import {Setup, IStrategy} from "./utils/Setup.sol"; +import {Setup, IStrategy, SafeERC20, ERC20} from "./utils/Setup.sol"; import {MockHealthCheck, IMockHealthCheck} from "./mocks/MockHealthCheck.sol"; contract HealthCheckTest is Setup { + using SafeERC20 for ERC20; + IMockHealthCheck public healthCheck; function setUp() public override { @@ -294,11 +296,11 @@ contract HealthCheckTest is Setup { ); // Loose .01% - uint256 loss = _amount / 10000; + uint256 loss = _amount / MAX_BPS; // simulate loss vm.prank(address(healthCheck)); - asset.transfer(management, loss); + asset.safeTransfer(management, loss); assertEq( healthCheck.doHealthCheck(), @@ -391,11 +393,11 @@ contract HealthCheckTest is Setup { ); // Loose .01% - uint256 loss = _amount / 10_000; + uint256 loss = _amount / MAX_BPS; // simulate loss vm.prank(address(healthCheck)); - asset.transfer(management, loss); + asset.safeTransfer(management, loss); assertEq( healthCheck.doHealthCheck(), diff --git a/src/test/utils/Setup.sol b/src/test/utils/Setup.sol index daafd6c..1d870b4 100644 --- a/src/test/utils/Setup.sol +++ b/src/test/utils/Setup.sol @@ -45,7 +45,7 @@ contract Setup is ExtendedTest { // Fuzz amount uint256 public maxFuzzAmount = 1e12; - uint256 public minFuzzAmount = 100; + uint256 public minFuzzAmount = MAX_BPS; // Default profit max unlock time is set for 10 days uint256 public profitMaxUnlockTime = 10 days;