Skip to content

Commit c4d0502

Browse files
committed
Update to coordinator proposal logic, prioritizing only the storage of current proposals to save gas.
1 parent f7826dd commit c4d0502

File tree

10 files changed

+478
-580
lines changed

10 files changed

+478
-580
lines changed

script/Deploy.s.sol

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,41 @@
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

Comments
 (0)