Skip to content

Commit

Permalink
feat: add ICurveStableSwapNG
Browse files Browse the repository at this point in the history
  • Loading branch information
rndquu committed Apr 22, 2024
1 parent ca2ec33 commit ebae5bb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ICurveStableSwapMetaNG} from "./ICurveStableSwapMetaNG.sol";

/**
* @notice Curve's interface for plain pool which contains only USD pegged assets
*/
interface ICurveStableSwapNG is ICurveStableSwapMetaNG {}
4 changes: 2 additions & 2 deletions packages/contracts/src/dollar/libraries/LibUbiquityPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol";
import {ICurveStableSwapMetaNG} from "../interfaces/ICurveStableSwapMetaNG.sol";
import {ICurveStableSwapNG} from "../interfaces/ICurveStableSwapNG.sol";
import {ICurveTwocryptoOptimized} from "../interfaces/ICurveTwocryptoOptimized.sol";
import {IDollarAmoMinter} from "../interfaces/IDollarAmoMinter.sol";
import {IERC20Ubiquity} from "../interfaces/IERC20Ubiquity.sol";
Expand Down Expand Up @@ -373,7 +373,7 @@ library LibUbiquityPool {
// load storage shared across all libraries
AppStorage storage store = LibAppStorage.appStorage();
// get Dollar price from Curve Metapool (18 decimals)
uint256 dollarPriceUsdD18 = ICurveStableSwapMetaNG(
uint256 dollarPriceUsdD18 = ICurveStableSwapNG(
store.stableSwapMetaPoolAddress
).price_oracle(0);
// convert to 6 decimals
Expand Down
15 changes: 15 additions & 0 deletions packages/contracts/src/dollar/mocks/MockCurveStableSwapNG.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

import {ICurveStableSwapNG} from "../interfaces/ICurveStableSwapNG.sol";
import {MockCurveStableSwapMetaNG} from "./MockCurveStableSwapMetaNG.sol";

contract MockCurveStableSwapNG is
ICurveStableSwapNG,
MockCurveStableSwapMetaNG
{
constructor(
address _token0,
address _token1
) MockCurveStableSwapMetaNG(_token0, _token1) {}
}

0 comments on commit ebae5bb

Please sign in to comment.