diff --git a/codecov.yml b/codecov.yml index 413c66b6..6e293bce 100644 --- a/codecov.yml +++ b/codecov.yml @@ -2,3 +2,8 @@ ignore: - "contracts/mocks/" - "test/foundry/" - "contracts/peripheral" +coverage: + status: + project: + default: + threshold: 1% diff --git a/contracts/market/UToken.sol b/contracts/market/UToken.sol index a582f304..9dc50ddc 100644 --- a/contracts/market/UToken.sol +++ b/contracts/market/UToken.sol @@ -548,7 +548,7 @@ contract UToken is IUToken, Controller, ERC20PermitUpgradeable, ReentrancyGuardU } function exchangeRateStored() public view returns (uint256) { - return decimalReducing(_exchangeRateStored(), underlyingDecimal); + return _exchangeRateStored(); } /** diff --git a/test/foundry/uToken/TestMintRedeem.t.sol b/test/foundry/uToken/TestMintRedeem.t.sol index af1024f1..4bbcafb3 100644 --- a/test/foundry/uToken/TestMintRedeem.t.sol +++ b/test/foundry/uToken/TestMintRedeem.t.sol @@ -62,6 +62,7 @@ contract TestMintRedeem is TestUTokenBase { erc20Mock.approve(address(uToken), mintAmount); uToken.mint(mintAmount); uint256 exchangeRateStored = uToken.exchangeRateStored(); + if (tokenDecimals < 18) exchangeRateStored = exchangeRateStored / 10 ** (18 - tokenDecimals); uint256 uBalance = uToken.balanceOf(ALICE); uint256 ercBalance = erc20Mock.balanceOf(ALICE); uint256 mintFee = (mintAmount * MINT_FEE_RATE) / 1e18; @@ -83,6 +84,7 @@ contract TestMintRedeem is TestUTokenBase { erc20Mock.approve(address(uToken), mintAmount); uToken.mint(mintAmount); uint256 exchangeRateStored = uToken.exchangeRateStored(); + if (tokenDecimals < 18) exchangeRateStored = exchangeRateStored / 10 ** (18 - tokenDecimals); uint256 mintFee = (mintAmount * MINT_FEE_RATE) / 1e18; uint256 totalRedeemable = uToken.totalRedeemable(); @@ -105,6 +107,7 @@ contract TestMintRedeem is TestUTokenBase { erc20Mock.approve(address(uToken), mintAmount); uToken.mint(mintAmount); uint256 exchangeRateStored = uToken.exchangeRateStored(); + if (tokenDecimals < 18) exchangeRateStored = exchangeRateStored / 10 ** (18 - tokenDecimals); uint256 mintFee = (mintAmount * MINT_FEE_RATE) / 1e18; uint256 uBalance = uToken.balanceOf(ALICE); @@ -129,6 +132,7 @@ contract TestMintRedeem is TestUTokenBase { uint256 utokenBal = uToken.balanceOf(ALICE); uint256 exchangeRateStored = uToken.exchangeRateStored(); + if (tokenDecimals < 18) exchangeRateStored = exchangeRateStored / 10 ** (18 - tokenDecimals); assertEq((utokenBal * exchangeRateStored) / 1e18, uToken.balanceOfUnderlying(ALICE)); uToken.borrow(ALICE, borrowAmount);