Skip to content

Commit

Permalink
Merge pull request #19 from HerodotusDev/upgrade-program-hash
Browse files Browse the repository at this point in the history
return local deployment
  • Loading branch information
rkdud007 authored Aug 19, 2024
2 parents 462ee89 + 2b4598c commit 2c40bc1
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

```json
{
"HDP_PROGRAM_HASH": "0x7f4e04ae49045719567040fd49a42283c63f50c9241abdadd23e96f7d9bda8c",
"HDP_PROGRAM_HASH": "0x7f4e04ae49045719567040fd49a42283c63f50c9241abdadd23e96f7d9bda8c0",
"DRY_RUN_PROGRAM_HASH": "0x48ac124e876e38ec61c5cd1543930e8211d17be84fd37e6c65da472f6801529"
}
```

### Solidity Contract

```
0xF1043155cd0A500Bb5b35a0D7b37e45ade483906
0x17e6E8e650e96B0cE39FB389B372E122C68F5a41
```
42 changes: 42 additions & 0 deletions script/HdpLocal.s.sol
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();
}
}

0 comments on commit 2c40bc1

Please sign in to comment.