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 all 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
36 changes: 29 additions & 7 deletions deployment/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -7350,7 +7350,7 @@
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7372,7 +7372,7 @@
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7394,7 +7394,7 @@
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7416,7 +7416,7 @@
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7438,7 +7438,7 @@
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7460,7 +7460,7 @@
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -7482,7 +7482,7 @@
"status": "prod",
"versions": {
"schema": "1.1.0",
"subgraph": "1.0.2",
"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.0",
"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
1 change: 1 addition & 0 deletions schema-bridge.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enum Network {
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
Expand Up @@ -4,7 +4,7 @@
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStaking",
"name": "LPStaking_0",
"address": "0xeA8DfEE1898a7e0a59f7527F076106d7e44c2176",
"startBlock": 8040516,
"abi": "LPStaking",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStaking",
"name": "LPStaking_0",
"address": "0x8731d54E9D02c286767d56ac03e8037C07e01e98",
"startBlock": 12215240,
"abi": "LPStaking",
Expand Down
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": "LPStaking_0",
"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";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStaking",
"name": "LPStaking_0",
"address": "0x3052A0F6ab15b4AE1df39962d5DdEFacA86DaB47",
"startBlock": 16132220,
"abi": "LPStaking",
"depositHandler": "handleStakeForBlockRewards",
"withdrawHandler": "handleUnstakeForBlockRewards"
},
{
"name": "LPStakingTime",
"name": "LPStaking_1",
"address": "0x2c6dcEd426D265045737Ff55C2D746C11b2F457a",
"startBlock": 24735491,
"abi": "LPStakingTime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStaking",
"name": "LPStaking_0",
"address": "0xB0D502E938ed5f4df2E681fE6E419ff29631d62b",
"startBlock": 14402874,
"abi": "LPStaking",
"depositHandler": "handleStakeForBlockRewards",
"withdrawHandler": "handleUnstakeForBlockRewards"
},
{
"name": "LPStakingTime",
"name": "LPStaking_1",
"address": "0x1c3000b8f475A958b87c73a5cc5780Ab763122FC",
"startBlock": 16394021,
"abi": "LPStakingTime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStaking",
"name": "LPStaking_0",
"address": "0x224D8Fd7aB6AD4c6eb4611Ce56EF35Dec2277F03",
"startBlock": 33646780,
"abi": "LPStaking",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStakingTime",
"name": "LPStaking_0",
"address": "0x45A01E4e04F14f7A4a6702c74187c5F6222033cd",
"startBlock": 4320637,
"abi": "LPStakingTime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStaking",
"name": "LPStaking_0",
"address": "0x4a364f8c717cAAD9A442737Eb7b8A55cc6cf18D8",
"startBlock": 4535236,
"abi": "LPStaking",
"depositHandler": "handleStakeForBlockRewards",
"withdrawHandler": "handleUnstakeForBlockRewards"
},
{
"name": "LPStakingTime",
"name": "LPStaking_1",
"address": "0x4DeA9e918c6289a52cd469cAC652727B7b412Cd2",
"startBlock": 17500609,
"abi": "LPStakingTime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"file": "./src/mappings/handlers.ts",
"lpStaking": [
{
"name": "LPStaking",
"name": "LPStaking_0",
"address": "0x8731d54E9D02c286767d56ac03e8037C07e01e98",
"startBlock": 26032417,
"abi": "LPStaking",
Expand Down
1 change: 1 addition & 0 deletions subgraphs/stargate/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enum Network {
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);
26 changes: 16 additions & 10 deletions subgraphs/stargate/src/common/tokens.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/* eslint-disable prefer-const */
import { ERC20 } from "../../generated/LPStaking/ERC20";
import { ERC20SymbolBytes } from "../../generated/LPStaking/ERC20SymbolBytes";
import { ERC20NameBytes } from "../../generated/LPStaking/ERC20NameBytes";
import { ERC20 } from "../../generated/LPStaking_0/ERC20";
import { ERC20SymbolBytes } from "../../generated/LPStaking_0/ERC20SymbolBytes";
import { ERC20NameBytes } from "../../generated/LPStaking_0/ERC20NameBytes";
import { Address } from "@graphprotocol/graph-ts";
import {
DEFAULT_DECIMALS,
INT_ZERO,
INT_NINE,
INT_SIXTEEN,
} from "../sdk/util/constants";

export const INVALID_TOKEN_DECIMALS = 0;
export const UNKNOWN_TOKEN_VALUE = "unknown";
Expand Down Expand Up @@ -110,14 +116,14 @@ class StaticTokenDefinition {

// Get all tokens with a static defintion
static getStaticDefinitions(): Array<StaticTokenDefinition> {
let staticDefinitions = new Array<StaticTokenDefinition>(6);
let staticDefinitions = new Array<StaticTokenDefinition>(INT_ZERO);

// Add DGD
let tokenDGD = new StaticTokenDefinition(
Address.fromString("0xe0b7927c4af23765cb51314a0e0521a9645f0e2a"),
"DGD",
"DGD",
9 as i32
INT_NINE
);
staticDefinitions.push(tokenDGD);

Expand All @@ -126,7 +132,7 @@ class StaticTokenDefinition {
Address.fromString("0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9"),
"AAVE",
"Aave Token",
18 as i32
DEFAULT_DECIMALS as i32
);
staticDefinitions.push(tokenAAVE);

Expand All @@ -135,7 +141,7 @@ class StaticTokenDefinition {
Address.fromString("0xeb9951021698b42e4399f9cbb6267aa35f82d59d"),
"LIF",
"Lif",
18 as i32
DEFAULT_DECIMALS as i32
);
staticDefinitions.push(tokenLIF);

Expand All @@ -144,7 +150,7 @@ class StaticTokenDefinition {
Address.fromString("0xbdeb4b83251fb146687fa19d1c660f99411eefe3"),
"SVD",
"savedroid",
18 as i32
DEFAULT_DECIMALS as i32
);
staticDefinitions.push(tokenSVD);

Expand All @@ -153,7 +159,7 @@ class StaticTokenDefinition {
Address.fromString("0xbb9bc244d798123fde783fcc1c72d3bb8c189413"),
"TheDAO",
"TheDAO",
16 as i32
INT_SIXTEEN
);
staticDefinitions.push(tokenTheDAO);

Expand All @@ -162,7 +168,7 @@ class StaticTokenDefinition {
Address.fromString("0x38c6a68304cdefb9bec48bbfaaba5c5b47818bb2"),
"HPB",
"HPBCoin",
18 as i32
DEFAULT_DECIMALS as i32
);
staticDefinitions.push(tokenHPB);

Expand Down
8 changes: 4 additions & 4 deletions subgraphs/stargate/src/mappings/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ import {
Swap,
SwapRemote,
Pool,
} from "../../generated/LPStaking/Pool";
} from "../../generated/LPStaking_0/Pool";
import { PoolTemplate } from "../../generated/templates";
import { Token } from "../../generated/schema";
import {
Deposit as DepositForBlockRewards,
LPStaking,
Withdraw as WithdrawForBlockRewards,
} from "../../generated/LPStaking/LPStaking";
} from "../../generated/LPStaking_0/LPStaking";
import {
Deposit as DepositForTimeRewards,
LPStakingTime,
Withdraw as WithdrawForTimeRewards,
} from "../../generated/LPStaking/LPStakingTime";
import { _ERC20 } from "../../generated/LPStaking/_ERC20";
} from "../../generated/LPStaking_0/LPStakingTime";
import { _ERC20 } from "../../generated/LPStaking_0/_ERC20";

const conf = new BridgeConfig(
NetworkConfigs.getFactoryAddress(),
Expand Down
Loading
Loading