-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for wrapped hyperdrive tokens (#37)
* add support for wrapped hyperdrive tokens This enables support for hyperdrive instances with rebasing tokens since yearn is unable to support rebasing tokens * fixes and redeem part of test * test fix * fix issues with LPMath library revert on getPoolInfo * cleanup * responding to feedback from @jalextowle * responding to feedback from @jalextowle * convert "hyperdrive token" language to `execution token` language * Update contracts/EverlongStrategy.sol Co-authored-by: Alex Towle <[email protected]> * correctly convert base token values from hyperdrive (#38) Some values received from hyperdrive are denominated in base tokens. These must be converted to vault shares token denominated values when `asBase==true || isWrapped==true` in the strategy --------- Co-authored-by: Alex Towle <[email protected]>
- Loading branch information
1 parent
daabc00
commit 32e9c70
Showing
11 changed files
with
501 additions
and
66 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import { IERC20 } from "openzeppelin/interfaces/IERC20.sol"; | ||
|
||
/// @author DELV | ||
/// @title IERC20Wrappable | ||
/// @notice Interface for an ERC20 token that can be wrapped/unwrapped. | ||
/// @dev Since Yearn explicitly does not support rebasing tokens as | ||
/// vault/strategy assets, wrapping is mandatory. | ||
/// @custom:disclaimer The language used in this code is for coding convenience | ||
/// only, and is not intended to, and does not, have any | ||
/// particular legal or regulatory significance. | ||
interface IERC20Wrappable is IERC20 { | ||
/// @notice Wrap the input amount of assets. | ||
/// @param _unwrappedAmount Amount of assets to wrap. | ||
/// @return _wrappedAmount Amount of wrapped assets that are returned. | ||
function wrap( | ||
uint256 _unwrappedAmount | ||
) external returns (uint256 _wrappedAmount); | ||
|
||
/// @notice Unwrap the input amount of assets. | ||
/// @param _wrappedAmount Amount of assets to unwrap. | ||
/// @return _unwrappedAmount Amount of unwrapped assets that are returned. | ||
function unwrap( | ||
uint256 _wrappedAmount | ||
) external returns (uint256 _unwrappedAmount); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.