Skip to content

Commit

Permalink
feat: apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinEgalite committed Sep 18, 2023
1 parent c2a78e7 commit 4cd441a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/MetaMorpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ contract MetaMorpho is ERC4626, Ownable2Step, IMetaMorpho {
// slither-disable-next-line reentrancy-no-eth
SafeERC20.safeTransferFrom(IERC20(asset()), caller, address(this), assets);

require(_depositOrder(assets) == 0, ErrorsLib.DEPOSIT_ORDER_FAILED);
_depositOrder(assets);

_mint(owner, shares);

Expand Down Expand Up @@ -492,7 +492,7 @@ contract MetaMorpho is ERC4626, Ownable2Step, IMetaMorpho {
return assets;
}

function _withdrawIdle(uint256 assets) internal view returns (uint256 newAssets, uint256 newIdle) {
function _withdrawIdle(uint256 assets) internal view returns (uint256 remaining, uint256 newIdle) {
if (assets > idle) return (assets - idle, 0);
return (0, idle - assets);
}
Expand Down
2 changes: 0 additions & 2 deletions src/libraries/ErrorsLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ library ErrorsLib {

string internal constant MARKET_NOT_ENABLED = "market not enabled";

string internal constant DEPOSIT_ORDER_FAILED = "deposit order failed";

string internal constant WITHDRAW_ORDER_FAILED = "withdraw order failed";

string internal constant MARKET_NOT_CREATED = "market not created";
Expand Down
4 changes: 0 additions & 4 deletions test/forge/helpers/BaseTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ contract BaseTest is Test {
uint256 internal constant MAX_TEST_LLTV = 0.99 ether;
uint256 internal constant NB_MARKETS = 10;
uint256 internal constant TIMELOCK = 0;
uint256 internal constant LLTV = 0.8 ether;
uint128 internal constant CAP = type(uint128).max;
uint256 internal constant MAX_COLLATERAL_PRICE = 1e40;
uint256 internal constant MAX_COLLATERAL_ASSETS = type(uint128).max;
uint256 internal constant NB_OF_MARKETS = 10;

address internal OWNER;
address internal SUPPLIER;
Expand Down

0 comments on commit 4cd441a

Please sign in to comment.