This repository was archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a3f086
commit b6b9222
Showing
4 changed files
with
393 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.16; | ||
|
||
import "forge-std/Script.sol"; | ||
import {DummyVectorX} from "../src/DummyVectorX.sol"; | ||
import {ERC1967Proxy} from "@openzeppelin/proxy/ERC1967/ERC1967Proxy.sol"; | ||
|
||
contract DeployScript is Script { | ||
function setUp() public {} | ||
|
||
function run() public { | ||
vm.startBroadcast(); | ||
|
||
bytes32 headerRangeFunctionId = vm.envBytes32( | ||
"HEADER_RANGE_FUNCTION_ID" | ||
); | ||
bytes32 rotateFunctionId = vm.envBytes32("ROTATE_FUNCTION_ID"); | ||
uint32 height = uint32(vm.envUint("GENESIS_HEIGHT")); | ||
bytes32 header = vm.envBytes32("GENESIS_HEADER"); | ||
uint64 authoritySetId = uint64(vm.envUint("GENESIS_AUTHORITY_SET_ID")); | ||
bytes32 authoritySetHash = vm.envBytes32("GENESIS_AUTHORITY_SET_HASH"); | ||
|
||
address gateway = vm.envAddress("GATEWAY_ADDRESS"); | ||
|
||
bytes32 create2Salt = bytes32(vm.envBytes("CREATE2_SALT")); | ||
|
||
// Deploy contract | ||
DummyVectorX lightClientImpl = new DummyVectorX{ | ||
salt: bytes32(create2Salt) | ||
}(); | ||
DummyVectorX lightClient; | ||
lightClient = DummyVectorX( | ||
address( | ||
new ERC1967Proxy{salt: bytes32(create2Salt)}( | ||
address(lightClientImpl), | ||
"" | ||
) | ||
) | ||
); | ||
console.logAddress(address(lightClient)); | ||
console.logAddress(address(lightClientImpl)); | ||
|
||
// Initialize the Vector X light client. | ||
lightClient.initialize( | ||
DummyVectorX.InitParameters({ | ||
guardian: msg.sender, | ||
gateway: gateway, | ||
height: height, | ||
header: header, | ||
authoritySetId: authoritySetId, | ||
authoritySetHash: authoritySetHash, | ||
headerRangeFunctionId: headerRangeFunctionId, | ||
rotateFunctionId: rotateFunctionId | ||
}) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.