File size: 919 Bytes
93c7565
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "forge-std/Script.sol";
import {CircuitBreaker} from "../contracts/CircuitBreaker.sol";

/// @notice Phase 2 deployment script for Polygon Amoy.
/// @dev    Reads PRIVATE_KEY and ORACLE_ADDRESS from the environment.
///         For the MVP we deploy non-upgradeable. A proxy pattern can be
///         layered on post-PMF without changing the storage layout.
contract DeployCircuitBreaker is Script {
    function run() external {
        uint256 deployerPk    = vm.envUint("PRIVATE_KEY");
        address oracleAddress = vm.envAddress("ORACLE_ADDRESS");

        vm.startBroadcast(deployerPk);

        CircuitBreaker cb = new CircuitBreaker();
        cb.initialize(oracleAddress);

        vm.stopBroadcast();

        console.log("CircuitBreaker deployed at:", address(cb));
        console.log("Oracle:                    ", oracleAddress);
    }
}