diff --git a/packages/contracts/src/dollar/facets/ManagerFacet.sol b/packages/contracts/src/dollar/facets/ManagerFacet.sol index 2e7611cc8..62f1e23b4 100644 --- a/packages/contracts/src/dollar/facets/ManagerFacet.sol +++ b/packages/contracts/src/dollar/facets/ManagerFacet.sol @@ -144,6 +144,17 @@ contract ManagerFacet is Modifiers { store.stableSwapMetaPoolAddress = _stableSwapMetaPoolAddress; } + /** + * @notice Sets Curve's Dollar-Stablecoin plain pool address + * @dev `_stableSwapPlainPoolAddress` is used to fetch Dollar price in USD + * @param _stableSwapPlainPoolAddress Curve's Dollar-Stablecoin plain pool address + */ + function setStableSwapPlainPoolAddress( + address _stableSwapPlainPoolAddress + ) external onlyAdmin { + store.stableSwapPlainPoolAddress = _stableSwapPlainPoolAddress; + } + /** * @notice Sets staking contract address * @dev Staking contract participants deposit Curve LP tokens @@ -385,6 +396,14 @@ contract ManagerFacet is Modifiers { return store.stableSwapMetaPoolAddress; } + /** + * @notice Returns Curve's plain pool address for Dollar-Stablecoin pair + * @return Curve's plain pool address for Dollar-Stablecoin pair + */ + function stableSwapPlainPoolAddress() external view returns (address) { + return store.stableSwapPlainPoolAddress; + } + /** * @notice Returns staking address * @return Staking address diff --git a/packages/contracts/src/dollar/libraries/LibAppStorage.sol b/packages/contracts/src/dollar/libraries/LibAppStorage.sol index 6bd153c67..e7b94dd4d 100644 --- a/packages/contracts/src/dollar/libraries/LibAppStorage.sol +++ b/packages/contracts/src/dollar/libraries/LibAppStorage.sol @@ -17,6 +17,7 @@ struct AppStorage { address stakingShareAddress; address stakingContractAddress; address stableSwapMetaPoolAddress; + address stableSwapPlainPoolAddress; address curve3PoolTokenAddress; // 3CRV address treasuryAddress; address governanceTokenAddress; diff --git a/packages/contracts/test/diamond/facets/ManagerFacet.t.sol b/packages/contracts/test/diamond/facets/ManagerFacet.t.sol index 61c245bca..2e7909c97 100644 --- a/packages/contracts/test/diamond/facets/ManagerFacet.t.sol +++ b/packages/contracts/test/diamond/facets/ManagerFacet.t.sol @@ -85,6 +85,14 @@ contract ManagerFacetTest is DiamondTestSetup { assertEq(managerFacet.stableSwapMetaPoolAddress(), contract1); } + function testSetStableSwapPlainPoolAddress_ShouldSucceed() + public + prankAs(admin) + { + managerFacet.setStableSwapPlainPoolAddress(contract1); + assertEq(managerFacet.stableSwapPlainPoolAddress(), contract1); + } + function testSetStakingContractAddress_ShouldSucceed() public prankAs(admin)