Skip to content

Commit

Permalink
fix(public-allocator): network without public allocator fallbacks on …
Browse files Browse the repository at this point in the history
…zeroAddress
  • Loading branch information
julien-devatom committed Sep 23, 2024
1 parent dc9cc1c commit 85df728
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/publicAllocator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ import { Address, dataSource, log } from "@graphprotocol/graph-ts";

export function getPublicAllocatorAddress(): Address {
const network = dataSource.network();
log.warning("Network id: {}", [network]);
if (network == "mainnet") {
return Address.fromString("0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D");
}
if (network == "base") {
return Address.fromString("0xA090dD1a701408Df1d4d0B85b716c87565f90467");
}

log.warning("No public allocator for network: {}", [network]);
return Address.fromString("0xfd32fA2ca22c76dD6E550706Ad913FC6CE91c75D");
// TODO: throw an error instead of returning a default value
log.warning("Unsupported Network id: {}", [network]);
return Address.zero();
}

0 comments on commit 85df728

Please sign in to comment.