Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated MorphoBlueHyperdrive to ignore all extra data #1125

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion contracts/src/instances/morpho-blue/MorphoBlueBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ 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 @@ -101,7 +107,7 @@ abstract contract MorphoBlueBase is HyperdriveBase {
_baseAmount,
0,
address(this),
_extraData
data
);

// NOTE: Since this yield source isn't payable, the value must be zero.
Expand Down
4 changes: 3 additions & 1 deletion contracts/src/interfaces/IHyperdrive.sol
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ interface IHyperdrive is
/// settled in base if true and in the yield source shares if false.
bool asBase;
/// @dev Additional data that can be used to implement custom logic in
/// implementation contracts.
/// implementation contracts. By convention, the last 32 bytes of
/// extra data are ignored by instances and "passed through" to the
/// event. This can be used to pass metadata through transactions.
bytes extraData;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/src/libraries/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.20;
address constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

/// @dev The version of the contracts.
string constant VERSION = "v1.0.16";
string constant VERSION = "v1.0.17";

/// @dev The number of targets that must be deployed for a full deployment.
uint256 constant NUM_TARGETS = 5;
Expand Down
Loading