-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from HerodotusDev/upgrade-program-hash
return local deployment
- Loading branch information
Showing
2 changed files
with
44 additions
and
2 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
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,42 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import {Script} from "forge-std/Script.sol"; | ||
import {console2} from "forge-std/console2.sol"; | ||
import {ERC1967Proxy} from "openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import {IAggregatorsFactory} from "../src/interfaces/IAggregatorsFactory.sol"; | ||
import {IFactsRegistry} from "../src/interfaces/IFactsRegistry.sol"; | ||
import {MockedSharpFactsRegistry} from "../src/MockedSharpFactsRegistry.sol"; | ||
import {HdpExecutionStore} from "../src/HdpExecutionStore.sol"; | ||
|
||
contract HdpLocalDeployer is Script { | ||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIV_KEY"); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
// Deploy the FactRegistry to the local network | ||
MockedSharpFactsRegistry factsRegistry = new MockedSharpFactsRegistry(); | ||
address factsRegistryAddress = address(factsRegistry); | ||
|
||
IFactsRegistry iFactsRegistry = IFactsRegistry(address(factsRegistry)); | ||
IAggregatorsFactory aggregatorsFactory = IAggregatorsFactory( | ||
vm.envAddress("SHARP_AGGREGATORS_FACTORY") | ||
); | ||
HdpExecutionStore hdp = new HdpExecutionStore(); | ||
ERC1967Proxy proxy = new ERC1967Proxy( | ||
address(hdp), | ||
abi.encodeCall( | ||
HdpExecutionStore.initialize, | ||
( | ||
iFactsRegistry, | ||
aggregatorsFactory, | ||
vm.envBytes32("HDP_PROGRAM_HASH") | ||
) | ||
) | ||
); | ||
|
||
console2.log("HdpExecutionStore proxy deployed at: ", address(proxy)); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |