Skip to content

Commit

Permalink
chore: rename contract
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Nov 16, 2023
1 parent 6682ad0 commit da8062f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/SpeedJumpIrm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import {MathLib as MorphoMathLib} from "../lib/morpho-blue/src/libraries/MathLib
/// @dev 4 steps allows to have a relative error below 30% for 15 days at err=1 or err=-1.
int256 constant N_STEPS = 4;

/// @title AdaptativeCurveIrm
/// @title AdaptiveCurveIrm
/// @author Morpho Labs
/// @custom:contact security@morpho.org
contract AdaptativeCurveIrm is IIrm {
contract AdaptiveCurveIrm is IIrm {
using MathLib for int256;
using UtilsLib for int256;
using MorphoMathLib for uint128;
Expand Down
2 changes: 1 addition & 1 deletion test/MathLibTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {MathLib} from "../src/libraries/MathLib.sol";
import {ErrorsLib} from "../src/libraries/ErrorsLib.sol";
import {wadExp} from "../lib/solmate/src/utils/SignedWadMath.sol";

import {AdaptativeCurveIrm} from "../src/SpeedJumpIrm.sol";
import {AdaptiveCurveIrm} from "../src/SpeedJumpIrm.sol";
import "../lib/forge-std/src/Test.sol";

contract MathLibTest is Test {
Expand Down
16 changes: 9 additions & 7 deletions test/SpeedJumpIrmTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "../src/SpeedJumpIrm.sol";

import "../lib/forge-std/src/Test.sol";

contract AdaptativeCurveIrmTest is Test {
contract AdaptiveCurveIrmTest is Test {
using MathLib for int256;
using MathLib for int256;
using MathLib for uint256;
Expand All @@ -21,16 +21,16 @@ contract AdaptativeCurveIrmTest is Test {
int256 internal constant TARGET_UTILIZATION = 0.9 ether;
int256 internal constant INITIAL_RATE_AT_TARGET = int256(0.01 ether) / 365 days;

AdaptativeCurveIrm internal irm;
AdaptiveCurveIrm internal irm;
MarketParams internal marketParams = MarketParams(address(0), address(0), address(0), address(0), 0);

function setUp() public {
irm =
new AdaptativeCurveIrm(address(this), CURVE_STEEPNESS, ADJUSTMENT_SPEED, TARGET_UTILIZATION, INITIAL_RATE_AT_TARGET);
new AdaptiveCurveIrm(address(this), CURVE_STEEPNESS, ADJUSTMENT_SPEED, TARGET_UTILIZATION, INITIAL_RATE_AT_TARGET);
vm.warp(90 days);

bytes4[] memory selectors = new bytes4[](1);
selectors[0] = AdaptativeCurveIrmTest.handleBorrowRate.selector;
selectors[0] = AdaptiveCurveIrmTest.handleBorrowRate.selector;
targetSelector(FuzzSelector({addr: address(this), selectors: selectors}));
targetContract(address(this));
}
Expand All @@ -39,7 +39,7 @@ contract AdaptativeCurveIrmTest is Test {

function testDeployment() public {
vm.expectRevert(bytes(ErrorsLib.ZERO_ADDRESS));
new AdaptativeCurveIrm(address(0), 0, 0, 0, 0);
new AdaptiveCurveIrm(address(0), 0, 0, 0, 0);
}

function testFirstBorrowRateUtilizationZero() public {
Expand Down Expand Up @@ -227,12 +227,12 @@ contract AdaptativeCurveIrmTest is Test {
totalSupplyAssets = bound(totalSupplyAssets, 0, type(uint128).max);
totalBorrowAssets = bound(totalBorrowAssets, 0, totalSupplyAssets);

vm.warp(block.timestamp + elapsed);

Market memory market;
market.lastUpdate = uint128(block.timestamp);
market.totalBorrowAssets = uint128(totalSupplyAssets);
market.totalSupplyAssets = uint128(totalBorrowAssets);

vm.warp(block.timestamp + elapsed);
irm.borrowRate(marketParams, market);
}

Expand All @@ -256,6 +256,8 @@ contract AdaptativeCurveIrmTest is Test {
assertLe(irm.borrowRate(marketParams, market), uint256(irm.MAX_RATE_AT_TARGET().wMulDown(CURVE_STEEPNESS)));
}

/* HELPERS */

function _expectedRateAtTarget(Id id, Market memory market) internal view returns (int256) {
int256 rateAtTarget = int256(irm.rateAtTarget(id));
int256 speed = ADJUSTMENT_SPEED.wMulDown(_err(market));
Expand Down

0 comments on commit da8062f

Please sign in to comment.