Skip to content

Commit

Permalink
Merge pull request #1281 from hypercerts-org/fix/graph_config_base_ch…
Browse files Browse the repository at this point in the history
…ains

fix(graph): addresses and startBlocks
  • Loading branch information
bitbeckers authored Mar 13, 2024
2 parents 184ebe6 + 5bafc14 commit 84d6743
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
14 changes: 13 additions & 1 deletion defender/src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import config from "./config";
import { ApiError, ConfigError } from "./errors";
import { NETWORKS } from "./networks";
import { NETWORKS, getNetworkConfigFromName } from "./networks";
import { reset } from "./reset";
import { rollOut } from "./rollout";
import { updateAutotask, updateSentinel } from "./update";
Expand Down Expand Up @@ -29,6 +29,18 @@ const setup = async () => {
const oldAutoTasks = await autotaskClient.list();
const oldSentinels = await sentinelClient.list();

const networksDeployed = oldAutoTasks.items
.map((task) => getNetworkConfigFromName(task.name).chainId)
.filter((value, index, array) => array.indexOf(value) === index);

const missingNetworks = networks.filter(
(network) => !networksDeployed.includes(network.chainId),
);

if (missingNetworks.length > 0) {
await rollOut(missingNetworks);
}

let updates = false;

if (oldAutoTasks.items.length > 0) {
Expand Down
12 changes: 12 additions & 0 deletions graph/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,17 @@
"address": "0xa16DFb32Eb140a6f3F2AC68f41dAd8c7e83C4941",
"startBlock": 4421942
}
},
"base": {
"HypercertMinter": {
"address": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704",
"startBlock": 11261815
}
},
"base-sepolia": {
"HypercertMinter": {
"address": "0xC2d179166bc9dbB00A03686a5b17eCe2224c2704",
"startBlock": 6771210
}
}
}

0 comments on commit 84d6743

Please sign in to comment.