Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#patch); stargate; add Base config #2313

Merged
merged 6 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions deployment/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -7349,8 +7349,8 @@
"network": "ethereum",
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"schema": "1.1.1",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7371,8 +7371,8 @@
"network": "avalanche",
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"schema": "1.1.1",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7393,8 +7393,8 @@
"network": "bsc",
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"schema": "1.1.1",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7415,8 +7415,8 @@
"network": "arbitrum",
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"schema": "1.1.1",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7437,8 +7437,8 @@
"network": "polygon",
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"schema": "1.1.1",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7459,8 +7459,8 @@
"network": "optimism",
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"schema": "1.1.1",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7481,8 +7481,8 @@
"network": "fantom",
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"schema": "1.1.1",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7498,6 +7498,28 @@
"query-id": "stargate-fantom"
}
}
},
"stargate-base": {
"network": "base",
"status": "prod",
"versions": {
"schema": "1.1.1",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
"template": "stargate.template.yaml"
},
"options": {
"prepare:yaml": true,
"prepare:constants": true
},
"services": {
"hosted-service": {
"slug": "stargate-base",
"query-id": "stargate-base"
}
}
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion schema-bridge.graphql
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Subgraph Schema: Bridge
# Version: 1.2.0
# Version: 1.2.1
dhruv-chauhan marked this conversation as resolved.
Show resolved Hide resolved
# See https://github.com/messari/subgraphs/blob/master/docs/SCHEMA.md for details
enum Network {
ARBITRUM_ONE
ARWEAVE_MAINNET
AURORA
AVALANCHE
BASE
BOBA
BSC # aka BNB Chain
CELO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { StargateArbitrumConfigurations } from "../../protocols/stargate/config/
import { StargateOptimismConfigurations } from "../../protocols/stargate/config/deployments/stargate-optimism/configurations";
import { StargateFantomConfigurations } from "../../protocols/stargate/config/deployments/stargate-fantom/configurations";
import { StargateMetisConfigurations } from "../../protocols/stargate/config/deployments/stargate-metis/configurations";
import { StargateBaseConfigurations } from "../../protocols/stargate/config/deployments/stargate-base/configurations";
import { Configurations } from "./interface";
import { Deploy } from "./deploy";
import { log } from "@graphprotocol/graph-ts";
Expand Down Expand Up @@ -36,6 +37,9 @@ export function getNetworkConfigurations(deploy: i32): Configurations {
case Deploy.STARGATE_METIS: {
return new StargateMetisConfigurations();
}
case Deploy.STARGATE_BASE: {
return new StargateBaseConfigurations();
}
default: {
log.critical(
"No configurations found for deployment protocol/network",
Expand Down
1 change: 1 addition & 0 deletions subgraphs/stargate/configurations/configurations/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ export namespace Deploy {
export const STARGATE_OPTIMISM = 5;
export const STARGATE_FANTOM = 6;
export const STARGATE_METIS = 7;
export const STARGATE_BASE = 8;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"deployment": "STARGATE_BASE",
"network": "base",
melotik marked this conversation as resolved.
Show resolved Hide resolved
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStakingTime",
"address": "0x06Eb48763f117c7Be887296CDcdfad2E4092739C",
"startBlock": 2127825,
"abi": "LPStakingTime",
"depositHandler": "handleStakeForTimeRewards",
"withdrawHandler": "handleUnstakeForTimeRewards"
}
],
"graftEnabled": false,
"subgraphId": "",
"graftStartBlock": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { Configurations } from "../../../../../configurations/configurations/interface";
import {
PROTOCOL_NAME,
PROTOCOL_SLUG,
} from "../../../../../src/common/constants";
import { Network } from "../../../../../src/sdk/util/constants";

export class StargateBaseConfigurations implements Configurations {
getNetwork(): string {
return Network.BASE;
}
getProtocolName(): string {
return PROTOCOL_NAME;
}
getProtocolSlug(): string {
return PROTOCOL_SLUG;
}
getFactoryAddress(): string {
return "0xaf5191b0de278c7286d6c7cc6ab6bb8a73ba2cd6";
}
}
3 changes: 2 additions & 1 deletion subgraphs/stargate/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Subgraph Schema: Bridge
# Version: 1.1.0
# Version: 1.1.1
# See https://github.com/messari/subgraphs/blob/master/docs/SCHEMA.md for details
enum Network {
ARBITRUM_ONE
ARWEAVE_MAINNET
AURORA
AVALANCHE
BASE
BOBA
BSC # aka BNB Chain
CELO
Expand Down
12 changes: 12 additions & 0 deletions subgraphs/stargate/src/common/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-magic-numbers, rulesdir/no-checksum-addresses */
import { Address, BigInt, TypedMap } from "@graphprotocol/graph-ts";

import { Network } from "../sdk/util/constants";
Expand Down Expand Up @@ -201,3 +202,14 @@ metisPoolIDsToToken.set(
Address.fromString("0x2b60473a7C41Deb80EDdaafD5560e963440eb632")
);
crossPoolTokens.set(Network.METIS, metisPoolIDsToToken);

export const basePoolIDsToToken = new TypedMap<BigInt, Address>();
basePoolIDsToToken.set(
BigInt.fromI32(1),
Address.fromString("0x4c80E24119CFB836cdF0a6b53dc23F04F7e652CA")
);
basePoolIDsToToken.set(
BigInt.fromI32(13),
Address.fromString("0x28fc411f9e1c480AD312b3d9C60c22b965015c6B")
);
crossPoolTokens.set(Network.BASE, basePoolIDsToToken);
5 changes: 5 additions & 0 deletions subgraphs/stargate/src/sdk/protocols/bridge/chainIds.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-magic-numbers */
import { BigInt, TypedMap } from "@graphprotocol/graph-ts";
import { Network } from "../../util/constants";

Expand Down Expand Up @@ -40,3 +41,7 @@ setChainID(11, Network.OPTIMISM);
setChainID(111, Network.OPTIMISM);
setChainID(12, Network.FANTOM);
setChainID(112, Network.FANTOM);
setChainID(51, Network.METIS);
setChainID(151, Network.METIS);
melotik marked this conversation as resolved.
Show resolved Hide resolved
setChainID(84, Network.BASE);
setChainID(184, Network.BASE);
2 changes: 2 additions & 0 deletions subgraphs/stargate/src/sdk/util/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-magic-numbers, rulesdir/no-checksum-addresses */
import { BigDecimal, BigInt } from "@graphprotocol/graph-ts";

////////////////////////
Expand Down Expand Up @@ -86,6 +87,7 @@ export namespace Network {
export const HARMONY = "HARMONY";
export const PALM = "PALM";
export const CURIO = "CURIO";
export const BASE = "BASE";

export const UNKNOWN_NETWORK = "UNKNOWN_NETWORK";
}
Expand Down
Loading