|
1 | | -// // SPDX-License-Identifier: MIT |
2 | | -// pragma solidity ^0.8.20; |
3 | | - |
4 | | -// import {Script} from "forge-std/Script.sol"; |
5 | | -// import {SmartnodesCore} from "../src/SmartnodesCore.sol"; |
6 | | - |
7 | | -// contract DeploySmartnodes is Script { |
8 | | -// function run() external returns (SmartnodesCore) { |
9 | | -// address[] memory validators; |
10 | | -// validators[0] = 0x1234567890123456789012345678901234567890; |
11 | | -// validators[1] = 0x0987654321098765432109876543210987654321; |
12 | | - |
13 | | -// vm.startBroadcast(); |
14 | | -// SmartnodesCore smartnodesCore = new SmartnodesCore(validators); |
15 | | -// vm.startBroadcast(); |
16 | | -// return smartnodesCore; |
17 | | -// } |
18 | | -// } |
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.22; |
| 3 | + |
| 4 | +import {Script, console} from "forge-std/Script.sol"; |
| 5 | +import {SmartnodesCore} from "../src/SmartnodesCore.sol"; |
| 6 | +import {SmartnodesToken} from "../src/SmartnodesToken.sol"; |
| 7 | +import {SmartnodesCoordinator} from "../src/SmartnodesCoordinator.sol"; |
| 8 | +import {SmartnodesDAO} from "../src/SmartnodesDAO.sol"; |
| 9 | + |
| 10 | +contract Deploy is Script { |
| 11 | + address[] genesis; |
| 12 | + |
| 13 | + function run() external { |
| 14 | + genesis.push(msg.sender); |
| 15 | + |
| 16 | + vm.startBroadcast(); |
| 17 | + |
| 18 | + SmartnodesToken token = new SmartnodesToken(genesis); |
| 19 | + SmartnodesCore core = new SmartnodesCore(address(token)); |
| 20 | + SmartnodesCoordinator coordinator = new SmartnodesCoordinator( |
| 21 | + 3600, |
| 22 | + 66, |
| 23 | + address(core), |
| 24 | + genesis |
| 25 | + ); |
| 26 | + SmartnodesDAO dao = new SmartnodesDAO(address(token), address(core)); |
| 27 | + |
| 28 | + token.setSmartnodesCore(address(core)); |
| 29 | + core.setCoordinator(address(coordinator)); |
| 30 | + |
| 31 | + token.transferOwnership(msg.sender); |
| 32 | + dao.transferOwnership(msg.sender); |
| 33 | + |
| 34 | + console.log("Token:", address(token)); |
| 35 | + console.log("Core:", address(core)); |
| 36 | + console.log("Coordinator:", address(coordinator)); |
| 37 | + console.log("DAO:", address(dao)); |
| 38 | + |
| 39 | + vm.stopBroadcast(); |
| 40 | + } |
| 41 | +} |
0 commit comments