Skip to content

Commit

Permalink
refactor: move function in the right section
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Aug 9, 2024
1 parent cc22113 commit 315e29a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/MetaMorpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,18 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
emit EventsLib.Skim(_msgSender(), token, amount);
}

/// @inheritdoc IMetaMorphoBase
function coverLostAssets(uint256 assets) external {
_accrueInterest();

lostAssets -= assets;
emit EventsLib.UpdateLostAssets(lostAssets);

SafeERC20.safeTransferFrom(IERC20(asset()), msg.sender, address(this), assets);

_supplyMorpho(assets);
}

/* ERC4626 (PUBLIC) */

/// @inheritdoc IERC20Metadata
Expand Down Expand Up @@ -577,18 +589,6 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
return newTotalAssets;
}

/// @inheritdoc IMetaMorphoBase
function coverLostAssets(uint256 assets) external {
_accrueInterest();

lostAssets -= assets;
emit EventsLib.UpdateLostAssets(lostAssets);

SafeERC20.safeTransferFrom(IERC20(asset()), msg.sender, address(this), assets);

_supplyMorpho(assets);
}

/* ERC4626 (INTERNAL) */

/// @inheritdoc ERC4626
Expand Down

0 comments on commit 315e29a

Please sign in to comment.