Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 84d6743

Browse files
authored
Merge pull request #1281 from hypercerts-org/fix/graph_config_base_chains
fix(graph): addresses and startBlocks
2 parents 184ebe6 + 5bafc14 commit 84d6743

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

Diff for: defender/src/setup.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import config from "./config";
22
import { ApiError, ConfigError } from "./errors";
3-
import { NETWORKS } from "./networks";
3+
import { NETWORKS, getNetworkConfigFromName } from "./networks";
44
import { reset } from "./reset";
55
import { rollOut } from "./rollout";
66
import { updateAutotask, updateSentinel } from "./update";
@@ -29,6 +29,18 @@ const setup = async () => {
2929
const oldAutoTasks = await autotaskClient.list();
3030
const oldSentinels = await sentinelClient.list();
3131

32+
const networksDeployed = oldAutoTasks.items
33+
.map((task) => getNetworkConfigFromName(task.name).chainId)
34+
.filter((value, index, array) => array.indexOf(value) === index);
35+
36+
const missingNetworks = networks.filter(
37+
(network) => !networksDeployed.includes(network.chainId),
38+
);
39+
40+
if (missingNetworks.length > 0) {
41+
await rollOut(missingNetworks);
42+
}
43+
3244
let updates = false;
3345

3446
if (oldAutoTasks.items.length > 0) {

Diff for: graph/networks.json

+12
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,17 @@
1616
"address": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941",
1717
"startBlock": 4421942
1818
}
19+
},
20+
"base": {
21+
"HypercertMinter": {
22+
"address": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704",
23+
"startBlock": 11261815
24+
}
25+
},
26+
"base-sepolia": {
27+
"HypercertMinter": {
28+
"address": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704",
29+
"startBlock": 6771210
30+
}
1931
}
2032
}

0 commit comments

Comments
 (0)