Skip to content

Commit 4168687

Browse files
shutter-service: added scripts to deploy and submit tx
1 parent e843e74 commit 4168687

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

script/DeployRegistry.service.s.sol

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import "forge-std/Script.sol";
5+
import "../src/shutter-service/ShutterRegistry.sol";
6+
7+
contract Deploy is Script {
8+
function run() external {
9+
uint256 deployKey = vm.envUint("DEPLOY_KEY");
10+
address deployerAddress = vm.addr(deployKey);
11+
console.log("Deployer:", deployerAddress);
12+
vm.startBroadcast(deployKey);
13+
deploySequencer();
14+
vm.stopBroadcast();
15+
}
16+
17+
function deploySequencer() public returns (ShutterRegistry) {
18+
ShutterRegistry s = new ShutterRegistry();
19+
console.log("ShutterRegistry:", address(s));
20+
return s;
21+
}
22+
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import "forge-std/Script.sol";
5+
import { ShutterRegistry } from "src/shutter-service/ShutterRegistry.sol";
6+
7+
contract SubmitTransaction is Script {
8+
function run() external {
9+
uint256 privateKey = vm.envUint("TX_SENDER_KEY");
10+
ShutterRegistry registry = ShutterRegistry(vm.envAddress("REGISTRY_ADDRESS"));
11+
uint64 eon = uint64(vm.envUint("EON"));
12+
bytes32 identityPrefix = vm.envBytes32("IDENTITY_PREFIX");
13+
uint64 ts = uint64(vm.envUint("TIMESTAMP"));
14+
15+
vm.startBroadcast(privateKey);
16+
registry.register(
17+
eon,
18+
identityPrefix,
19+
ts
20+
);
21+
vm.stopBroadcast();
22+
}
23+
}

0 commit comments

Comments
 (0)