-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeploy.s.sol
More file actions
41 lines (35 loc) Β· 1.5 KB
/
Copy pathDeploy.s.sol
File metadata and controls
41 lines (35 loc) Β· 1.5 KB
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
34
35
36
37
38
39
40
41
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;
import {Script} from "forge-std/Script.sol";
import {console2} from "forge-std/console2.sol";
import {BackstopPool} from "../src/BackstopPool.sol";
import {Backstop} from "../src/Backstop.sol";
/**
* @title Deploy
* @notice Deploys BackstopPool + Backstop to Coston2 and wires them together.
*
* Run (simulate β no on-chain writes):
* source .env && forge script script/Deploy.s.sol:Deploy \
* --rpc-url "$COSTON2_RPC_URL" --sender "$DEPLOYER_ADDRESS"
*
* Run (broadcast + verify on Coston2 Blockscout, no API key):
* source .env && forge script script/Deploy.s.sol:Deploy \
* --rpc-url "$COSTON2_RPC_URL" --private-key "0x$PRIVATE_KEY" --broadcast \
* --verify --verifier blockscout \
* --verifier-url https://coston2-explorer.flare.network/api/
*/
contract Deploy is Script {
function run() external {
vm.startBroadcast();
BackstopPool pool = new BackstopPool();
Backstop backstop = new Backstop(pool);
pool.setBackstop(address(backstop));
vm.stopBroadcast();
// Sanity: wiring is in place before we trust the addresses.
require(pool.backstop() == address(backstop), "Deploy: pool not wired to backstop");
require(address(backstop.pool()) == address(pool), "Deploy: backstop not wired to pool");
console2.log("BackstopPool:", address(pool));
console2.log("Backstop: ", address(backstop));
console2.log("owner: ", backstop.owner());
}
}