• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

delvtech / hyperdrive / 9991233897

18 Jul 2024 11:31AM UTC coverage: 91.602% (-0.5%) from 92.08%
9991233897

push

github

web-flow
Added a Morpho Blue integration (#1094)

* Implemented a basic version of the `addLiquidity` circuit breaker

* Fixed `test_lp_withdrawal_long_and_short_maturity`

* Fixed the remaining tests

* add priceDiscoveryCheck to LPMath and also check it in initialize

* use initial price

* add tests and fix placement of check

* remove lib from LPMath

* remove comment

* remove console import

* remove console import

* fix price discovery tests

* fixed tests

* commit test to investigate

* add test_solvency_at_0_apr

* add test_solvency_cross_checkpoint_long_short

* address review feedback

* Update test/integrations/hyperdrive/PriceDiscovery.t.sol

* Added some testing examples

* Minor updates

* Updated `verifyPriceDiscovery` to `calculateSolvencyAfterMaxLong`

* Cleaned up the tests

* Increased the efficiency of the solvency check

* Fixed the code size issue

* Addressed Saw Mon's comment

* Improved one of the price discovery tests

* Updated the price discovery tests

* Fixed the remaining tests

* Addressed review feedback from @mcclurejt

* Fixed the deployment scripts

* Generated the code for the Aave integration

* forge install: aave-v3-core

v1.19.1

* Fixed codegen and compiler errors

* Implemented `_convertToBase` and `_convertToShares` for AaveHyperdrive

* Implemented the deposit functions for the AaveHyperdrive instance

* Implemented the withdrawal logic for ATokens

* Addressed most of the remaining FIXMEs

* Reduced the code-size of the Aave integration

* Copied over the instance test

* Added a fourth target to fix the codesize issues

* Started work on the AaveHyperdrive tests

* Fixed some of the tests

* Fixed more tests

* Fixed the remaining Aave instance tests

* Fixed the other instance tests

* Addressed remaining FIXMEs and fixed the code generator

* Fixed the publish scripts

* Lowered the minimum share reserves

* Addressed review feedback from @jrhea

* Added conversion functions to the public interfaces for insta... (continued)

58 of 76 new or added lines in 11 files covered. (76.32%)

3 existing lines in 3 files now uncovered.

2138 of 2334 relevant lines covered (91.6%)

369381.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

16.67
/contracts/src/instances/morpho-blue/MorphoBlueTarget0.sol
1
// SPDX-License-Identifier: Apache-2.0
2
pragma solidity 0.8.20;
3

4
import { IMorpho } from "morpho-blue/src/interfaces/IMorpho.sol";
5
import { HyperdriveTarget0 } from "../../external/HyperdriveTarget0.sol";
6
import { IHyperdrive } from "../../interfaces/IHyperdrive.sol";
7
import { IMorphoBlueHyperdrive } from "../../interfaces/IMorphoBlueHyperdrive.sol";
8
import { MORPHO_BLUE_HYPERDRIVE_KIND } from "../../libraries/Constants.sol";
9
import { MorphoBlueBase } from "./MorphoBlueBase.sol";
10

11
/// @author DELV
12
/// @title MorphoBlueTarget0
13
/// @notice MorphoBlueHyperdrive's target0 logic contract. This contract contains
14
///         all of the getters for Hyperdrive as well as some stateful
15
///         functions.
16
/// @custom:disclaimer The language used in this code is for coding convenience
17
///                    only, and is not intended to, and does not, have any
18
///                    particular legal or regulatory significance.
19
contract MorphoBlueTarget0 is HyperdriveTarget0, MorphoBlueBase {
20
    /// @notice Initializes the target0 contract.
21
    /// @param _config The configuration of the Hyperdrive pool.
22
    /// @param _params The Morpho Blue params.
23
    constructor(
24
        IHyperdrive.PoolConfig memory _config,
25
        IMorphoBlueHyperdrive.MorphoBlueParams memory _params
26
    ) HyperdriveTarget0(_config) MorphoBlueBase(_params) {}
27

28
    /// @notice Returns the instance's kind.
29
    /// @return The instance's kind.
30
    function kind() external pure override returns (string memory) {
31
        _revert(abi.encode(MORPHO_BLUE_HYPERDRIVE_KIND));
1✔
32
    }
33

34
    /// @notice Returns the Morpho Blue contract.
35
    /// @return The Morpho Blue contract.
36
    function vault() external view returns (IMorpho) {
NEW
37
        _revert(abi.encode(_vault));
×
38
    }
39

40
    /// @notice Returns the collateral token for this Morpho Blue market.
41
    /// @return The collateral token for this Morpho Blue market.
42
    function collateralToken() external view returns (address) {
NEW
43
        _revert(abi.encode(_collateralToken));
×
44
    }
45

46
    /// @notice Returns the oracle for this Morpho Blue market.
47
    /// @return The oracle for this Morpho Blue market.
48
    function oracle() external view returns (address) {
NEW
49
        _revert(abi.encode(_oracle));
×
50
    }
51

52
    /// @notice Returns the IRM for this Morpho Blue market.
53
    /// @return The IRM for this Morpho Blue market.
54
    function irm() external view returns (address) {
NEW
55
        _revert(abi.encode(_irm));
×
56
    }
57

58
    /// @notice Returns the LLTV for this Morpho Blue market.
59
    /// @return The LLTV for this Morpho Blue market.
60
    function lltv() external view returns (uint256) {
NEW
61
        _revert(abi.encode(_lltv));
×
62
    }
63
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc