-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeployDSC.s.sol
33 lines (23 loc) · 1.12 KB
/
DeployDSC.s.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Script} from "forge-std/Script.sol";
import {DecentralizedStableCoin} from "../src/DecentralizedStableCoin.sol";
import {DSCEngine} from "../src/DSCEngine.sol";
import {HelperConfig} from "../script/HelperConfig.s.sol";
contract DeployDSC is Script {
// function setUp() public {}
address[] public tokenAddresses;
address[] public priceFeedAddresses;
function run() external returns (DecentralizedStableCoin, DSCEngine, HelperConfig) {
HelperConfig config = new HelperConfig();
(address wethUsdPriceFeed, address wbtcUsdPriceFeed, address weth, address wbtc, uint256 depployerKey) = config.activeNetworkConfig();
tokenAddresses = [weth, wbtc];
priceFeedAddresses = [wethUsdPriceFeed, wbtcUsdPriceFeed];
vm.startBroadcast(depployerKey);
DecentralizedStableCoin dsc = new DecentralizedStableCoin();
DSCEngine engine = new DSCEngine(tokenAddresses, priceFeedAddresses, address(dsc));
dsc.transferOwnership(address(engine));
vm.stopBroadcast();
return (dsc, engine, config);
}
}