Skip to content

Commit

Permalink
feat: add plain pool setter
Browse files Browse the repository at this point in the history
  • Loading branch information
rndquu committed Apr 22, 2024
1 parent ebae5bb commit 2fdab8c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/contracts/src/dollar/facets/ManagerFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/dollar/libraries/LibAppStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct AppStorage {
address stakingShareAddress;
address stakingContractAddress;
address stableSwapMetaPoolAddress;
address stableSwapPlainPoolAddress;
address curve3PoolTokenAddress; // 3CRV
address treasuryAddress;
address governanceTokenAddress;
Expand Down
8 changes: 8 additions & 0 deletions packages/contracts/test/diamond/facets/ManagerFacet.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2fdab8c

Please sign in to comment.