@@ -7,36 +7,41 @@ import {SmartnodesToken} from "../src/SmartnodesToken.sol";
77import {SmartnodesCoordinator} from "../src/SmartnodesCoordinator.sol " ;
88import {SmartnodesDAO} from "../src/SmartnodesDAO.sol " ;
99
10+ uint256 constant DAO_VOTING_PERIOD = 7 days ;
11+
1012contract Deploy is Script {
1113 address [] genesis;
1214 address [] initialActiveNodes;
1315
1416 function run () external {
15- initialActiveNodes.push (msg .sender );
1617 genesis.push (msg .sender );
1718 genesis.push (0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 );
1819
1920 vm.startBroadcast ();
2021
2122 SmartnodesToken token = new SmartnodesToken (genesis);
23+ SmartnodesDAO dao = new SmartnodesDAO (
24+ address (token),
25+ DAO_VOTING_PERIOD
26+ );
2227 SmartnodesCore core = new SmartnodesCore (address (token));
2328
24- bytes32 publicKeyHash = vm. envBytes32 ( " PUBLIC_KEY_HASH " );
25- core. createValidator (publicKeyHash );
29+ token. setSmartnodesCore ( address (core) );
30+ token. setDAO ( address (dao) );
2631
2732 SmartnodesCoordinator coordinator = new SmartnodesCoordinator (
2833 3600 ,
2934 66 ,
3035 address (core),
3136 initialActiveNodes
3237 );
33- SmartnodesDAO dao = new SmartnodesDAO (address (token), address (core));
3438
35- token.setSmartnodesCore (address (core));
3639 core.setCoordinator (address (coordinator));
3740
38- token.transferOwnership (msg .sender );
39- dao.transferOwnership (msg .sender );
41+ bytes32 publicKeyHash = vm.envBytes32 ("PUBLIC_KEY_HASH " );
42+
43+ core.createValidator (publicKeyHash);
44+ coordinator.addValidator ();
4045
4146 console.log ("Token: " , address (token));
4247 console.log ("Core: " , address (core));
0 commit comments