Skip to content

Commit

Permalink
Remove extra data handling from Morpho
Browse files Browse the repository at this point in the history
  • Loading branch information
jalextowle committed Aug 7, 2024
1 parent c18c47d commit afe4940
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions contracts/src/instances/morpho-blue/MorphoBlueBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ abstract contract MorphoBlueBase is HyperdriveBase {

/// @dev Accepts a deposit from the user in base.
/// @param _baseAmount The base amount to deposit.
/// @param _extraData Additional data to pass to the Morpho vault. This
/// should be zero if it is unused.
/// @return sharesMinted The shares that were minted in the deposit.
/// @return value The amount of ETH to refund. Since this yield source isn't
/// payable, this is always zero.
function _depositWithBase(
uint256 _baseAmount,
bytes calldata _extraData
bytes calldata // unused _extraData
) internal override returns (uint256 sharesMinted, uint256 value) {
// Take custody of the deposit in base.
ERC20(address(_baseToken)).safeTransferFrom(
Expand All @@ -90,12 +88,6 @@ abstract contract MorphoBlueBase is HyperdriveBase {
address(_vault),
_baseAmount + 1
);
// NOTE: The last 32 bytes of the extra data is passed through to the
// event without being passed to morpho.
bytes memory data;
if (_extraData.length > 32) {
data = _extraData[:_extraData.length - 32];
}
(, sharesMinted) = _vault.supply(
MarketParams({
loanToken: address(_baseToken),
Expand All @@ -107,7 +99,7 @@ abstract contract MorphoBlueBase is HyperdriveBase {
_baseAmount,
0,
address(this),
data
new bytes(0)
);

// NOTE: Since this yield source isn't payable, the value must be zero.
Expand Down

0 comments on commit afe4940

Please sign in to comment.