@@ -16,7 +16,7 @@ import {DiamondLoupeFacet} from "../../src/dollar/facets/DiamondLoupeFacet.sol";
16
16
import {ManagerFacet} from "../../src/dollar/facets/ManagerFacet.sol " ;
17
17
import {OwnershipFacet} from "../../src/dollar/facets/OwnershipFacet.sol " ;
18
18
import {UbiquityPoolFacet} from "../../src/dollar/facets/UbiquityPoolFacet.sol " ;
19
- import {ICurveStableSwapMetaNG } from "../../src/dollar/interfaces/ICurveStableSwapMetaNG .sol " ;
19
+ import {ICurveStableSwapNG } from "../../src/dollar/interfaces/ICurveStableSwapNG .sol " ;
20
20
import {ICurveTwocryptoOptimized} from "../../src/dollar/interfaces/ICurveTwocryptoOptimized.sol " ;
21
21
import {IDiamondCut} from "../../src/dollar/interfaces/IDiamondCut.sol " ;
22
22
import {IDiamondLoupe} from "../../src/dollar/interfaces/IDiamondLoupe.sol " ;
@@ -26,7 +26,7 @@ import {LibAccessControl} from "../../src/dollar/libraries/LibAccessControl.sol"
26
26
import {AppStorage, LibAppStorage, Modifiers} from "../../src/dollar/libraries/LibAppStorage.sol " ;
27
27
import {LibDiamond} from "../../src/dollar/libraries/LibDiamond.sol " ;
28
28
import {MockChainLinkFeed} from "../../src/dollar/mocks/MockChainLinkFeed.sol " ;
29
- import {MockCurveStableSwapMetaNG } from "../../src/dollar/mocks/MockCurveStableSwapMetaNG .sol " ;
29
+ import {MockCurveStableSwapNG } from "../../src/dollar/mocks/MockCurveStableSwapNG .sol " ;
30
30
import {MockCurveTwocryptoOptimized} from "../../src/dollar/mocks/MockCurveTwocryptoOptimized.sol " ;
31
31
import {MockERC20} from "../../src/dollar/mocks/MockERC20.sol " ;
32
32
import {DiamondTestHelper} from "../../test/helpers/DiamondTestHelper.sol " ;
@@ -129,8 +129,7 @@ contract Deploy001_Diamond_Dollar_Governance is Script, DiamondTestHelper {
129
129
// oracle related contracts
130
130
AggregatorV3Interface chainLinkPriceFeedEth; // chainlink ETH/USD price feed
131
131
AggregatorV3Interface chainLinkPriceFeedLusd; // chainlink LUSD/USD price feed
132
- IERC20 curveTriPoolLpToken; // Curve's 3CRV-LP token
133
- ICurveStableSwapMetaNG curveDollarMetaPool; // Curve's Dollar-3CRVLP metapool
132
+ ICurveStableSwapNG curveStableDollarPlainPool; // Curve's LUSD-Dollar plain pool
134
133
ICurveTwocryptoOptimized curveGovernanceEthPool; // Curve's Governance-WETH crypto pool
135
134
136
135
// collateral ERC20 token used in UbiquityPoolFacet
@@ -408,22 +407,22 @@ contract Deploy001_Diamond_Dollar_Governance is Script, DiamondTestHelper {
408
407
* - oracle related contracts
409
408
* - Governance token related contracts
410
409
*
411
- * @dev Ubiquity protocol supports 4 oracles:
412
- * 1. Curve's Dollar-3CRVLP metapool to fetch Dollar prices
413
- * 2. Chainlink's price feed (used in UbiquityPool) to fetch collateral token prices in USD
414
- * 3. Chainlink's price feed (used in UbiquityPool) to fetch ETH/USD price
415
- * 4. Curve's Governance-WETH crypto pool to fetch Governance/ETH price
410
+ * @dev Ubiquity protocol supports 5 oracles:
411
+ * 1. Curve's LUSD-Dollar plain pool to fetch Dollar prices
412
+ * 2. Chainlink's price feed (used in UbiquityPool) to fetch LUSD/USD price (for getting Dollar price in USD)
413
+ * 3. Chainlink's price feed (used in UbiquityPool) to fetch collateral token prices in USD (for getting collateral price in USD)
414
+ * 4. Chainlink's price feed (used in UbiquityPool) to fetch ETH/USD price
415
+ * 5. Curve's Governance-WETH crypto pool to fetch Governance/ETH price
416
416
*
417
417
* There are 2 migrations (deployment scripts):
418
418
* 1. Development (for usage in testnet and local anvil instance)
419
419
* 2. Mainnet (for production usage in mainnet)
420
420
*
421
421
* Development migration deploys (for ease of debugging) mocks of:
422
- * - Chainlink collateral price feed contract
423
422
* - Chainlink ETH/USD price feed contract
424
- * - 3CRVLP ERC20 token
423
+ * - Chainlink LUSD/USD price feed contract (for getting Dollar and collateral prices in USD)
425
424
* - WETH token
426
- * - Curve's Dollar-3CRVLP metapool contract
425
+ * - Curve's LUSD-Dollar plain pool contract
427
426
* - Curve's Governance-WETH crypto pool contract
428
427
*/
429
428
function afterRun () public virtual {
@@ -464,7 +463,7 @@ contract Deploy001_Diamond_Dollar_Governance is Script, DiamondTestHelper {
464
463
1 // answered in round
465
464
);
466
465
467
- // set price feed address and threshold in seconds
466
+ // set collateral price feed address and threshold in seconds
468
467
ubiquityPoolFacet.setCollateralChainLinkPriceFeed (
469
468
address (collateralToken), // collateral token address
470
469
address (chainLinkPriceFeedLusd), // price feed address
@@ -474,41 +473,45 @@ contract Deploy001_Diamond_Dollar_Governance is Script, DiamondTestHelper {
474
473
// fetch latest prices from chainlink for collateral with index 0
475
474
ubiquityPoolFacet.updateChainLinkCollateralPrice (0 );
476
475
476
+ // set Stable/USD price feed address and threshold in seconds
477
+ ubiquityPoolFacet.setStableUsdChainLinkPriceFeed (
478
+ address (chainLinkPriceFeedLusd), // price feed address
479
+ CHAINLINK_PRICE_FEED_THRESHOLD // price feed staleness threshold in seconds
480
+ );
481
+
477
482
// stop sending admin transactions
478
483
vm.stopBroadcast ();
479
484
480
485
//=========================================
481
- // Curve's Dollar-3CRVLP metapool deploy
486
+ // Curve's LUSD-Dollar plain pool deploy
482
487
//=========================================
483
488
484
489
// start sending owner transactions
485
490
vm.startBroadcast (ownerPrivateKey);
486
491
487
- // deploy mock 3CRV-LP token
488
- curveTriPoolLpToken = new MockERC20 (
489
- "Curve.fi DAI/USDC/USDT " ,
490
- "3Crv " ,
491
- 18
492
- );
493
-
494
- // deploy mock Curve's Dollar-3CRVLP metapool
495
- curveDollarMetaPool = new MockCurveStableSwapMetaNG (
496
- address (dollarToken),
497
- address (curveTriPoolLpToken)
492
+ // Deploy mock Curve's LUSD-Dollar plain pool.
493
+ // Since we're using LUSD both as collateral and Dollar token pair
494
+ // in Curve's plain pool we don't deploy another mock of the "stable" coin
495
+ // paired to Dollar and simply use collateral token (i.e. LUSD).
496
+ curveStableDollarPlainPool = new MockCurveStableSwapNG (
497
+ address (collateralToken),
498
+ address (dollarToken)
498
499
);
499
500
500
501
// stop sending owner transactions
501
502
vm.stopBroadcast ();
502
503
503
504
//========================================
504
- // Curve's Dollar-3CRVLP metapool setup
505
+ // Curve's LUSD-Dollar plain pool setup
505
506
//========================================
506
507
507
508
// start sending admin transactions
508
509
vm.startBroadcast (adminPrivateKey);
509
510
510
- // set curve's metapool in manager facet
511
- managerFacet.setStableSwapMetaPoolAddress (address (curveDollarMetaPool));
511
+ // set curve's plain pool in manager facet
512
+ managerFacet.setStableSwapPlainPoolAddress (
513
+ address (curveStableDollarPlainPool)
514
+ );
512
515
513
516
// stop sending admin transactions
514
517
vm.stopBroadcast ();
0 commit comments