Skip to content

Commit

Permalink
Merge pull request #72 from balancer/staging
Browse files Browse the repository at this point in the history
promote staging to prod
  • Loading branch information
mendesfabio authored Jul 17, 2023
2 parents a953106 + f5eb79e commit 523f0b4
Show file tree
Hide file tree
Showing 8 changed files with 290 additions and 213 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/graph-studio-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,50 @@ jobs:
graph_subgraph_name: "balancer-gauges-polygon-zk-b"
graph_account: "balancer-labs"
graph_config_file: "subgraph.polygon-zkevm.yaml"
graph_deploy_studio: true
deploy-sepolia:
runs-on: ubuntu-latest
environment: graph
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install
run: yarn --frozen-lockfile
- name: Codegen
run: yarn codegen
- name: Build
run: yarn build
- uses: gtaschuk/graph-deploy@v0.1.11
with:
graph_deploy_key: ${{secrets.GRAPH_DEPLOY_KEY}}
graph_version_label: ${GITHUB_SHA::8}
graph_subgraph_name: "balancer-gauges-sepolia-beta"
graph_account: "balancer-labs"
graph_config_file: "subgraph.sepolia.yaml"
graph_deploy_studio: true
deploy-base:
runs-on: ubuntu-latest
environment: graph
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install
run: yarn --frozen-lockfile
- name: Codegen
run: yarn codegen
- name: Build
run: yarn build
- uses: gtaschuk/graph-deploy@v0.1.11
with:
graph_deploy_key: ${{secrets.GRAPH_DEPLOY_KEY}}
graph_version_label: ${GITHUB_SHA::8}
graph_subgraph_name: "balancer-gauges-base-beta"
graph_account: "balancer-labs"
graph_config_file: "subgraph.base.yaml"
graph_deploy_studio: true
48 changes: 47 additions & 1 deletion .github/workflows/graph-studio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,50 @@ jobs:
graph_subgraph_name: "balancer-gauges-polygon-zk"
graph_account: "balancer-labs"
graph_config_file: "subgraph.polygon-zkevm.yaml"
graph_deploy_studio: true
graph_deploy_studio: true
deploy-sepolia:
runs-on: ubuntu-latest
environment: graph
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install
run: yarn --frozen-lockfile
- name: Codegen
run: yarn codegen
- name: Build
run: yarn build
- uses: gtaschuk/graph-deploy@v0.1.11
with:
graph_deploy_key: ${{secrets.GRAPH_DEPLOY_KEY}}
graph_version_label: ${GITHUB_SHA::8}
graph_subgraph_name: "balancer-gauges-sepolia"
graph_account: "balancer-labs"
graph_config_file: "subgraph.sepolia.yaml"
graph_deploy_studio: true
deploy-base:
runs-on: ubuntu-latest
environment: graph
steps:
- uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install
run: yarn --frozen-lockfile
- name: Codegen
run: yarn codegen
- name: Build
run: yarn build
- uses: gtaschuk/graph-deploy@v0.1.11
with:
graph_deploy_key: ${{secrets.GRAPH_DEPLOY_KEY}}
graph_version_label: ${GITHUB_SHA::8}
graph_subgraph_name: "balancer-gauges-base"
graph_account: "balancer-labs"
graph_config_file: "subgraph.base.yaml"
graph_deploy_studio: true
38 changes: 35 additions & 3 deletions networks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,27 @@ mainnet:
authorizerAdaptorEntrypoint:
address: "0xf5dECDB1f3d1ee384908Fbe16D2F0348AE43a9eA"
startBlock: 16042168
sepolia:
network: sepolia
supportTraces: true
gaugeV2Factory:
address: "0x2FF226CD12C80511a641A6101F071d853A4e5363"
startBlock: 3425130
singleRecipientGaugeV2Factory:
address: "0x7EE4D172Ae50C627a1BFA9A99E1260C54dA26fdF"
startBlock: 3425172
gaugeController:
address: "0x577e5993B9Cc480F07F98B5Ebd055604bd9071C4"
startBlock: 3425067
votingEscrow:
address: "0x150A72e4D4d81BbF045565E232c50Ed0931ad795"
startBlock: 3425066
childChainGaugeV2Factory:
address: "0xC370cD86d5488c1788b62f11b09adb0C47F47440"
startBlock: 3425268
authorizerAdaptorEntrypoint:
address: "0xb9aD3466cdd42015cc05d4804DC68D562b6a2065"
startBlock: 3421600
polygon:
network: matic
# graft:
Expand Down Expand Up @@ -164,9 +185,9 @@ gnosis:
startBlock: 25140518
avalanche:
network: avalanche
childChainGaugeFactory:
address: "0xb08E16cFc07C684dAA2f93C70323BAdb2A6CBFd2"
startBlock: 26386697
childChainGaugeV2Factory:
address: "0x161f4014C27773840ccb4EC1957113e6DD028846"
startBlock: 29338806
authorizerAdaptorEntrypoint:
address: "0x4E7bBd911cf1EFa442BC1b2e9Ea01ffE785412EC"
startBlock: 26387586
Expand All @@ -181,3 +202,14 @@ polygon-zkevm:
authorizerAdaptorEntrypoint:
address: "0xb9aD3466cdd42015cc05d4804DC68D562b6a2065"
startBlock: 203624
base:
network: base
EventEmitter:
address: "0x94eA79f1dD4f1B89D87fE1E71c9723b8003AB3d3"
startBlock: 1275405
childChainGaugeV2Factory:
address: "0x2498A2B0d6462d2260EAC50aE1C3e03F4829BA95"
startBlock: 1204492
authorizerAdaptorEntrypoint:
address: "0x9129E834e15eA19b6069e8f08a8EcFc13686B8dC"
startBlock: 1205742
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
},
"homepage": "https://github.com/balancer-labs/gauges-subgraph#readme",
"devDependencies": {
"@graphprotocol/graph-cli": "latest",
"@graphprotocol/graph-ts": "latest",
"@graphprotocol/graph-cli": "0.52.0",
"@graphprotocol/graph-ts": "0.31.0",
"@types/fs-extra": "^9.0.2",
"@types/js-yaml": "^3.12.5",
"@types/node": "^14.14.37",
Expand Down
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ enum Chain {
Polygon
Optimism
Avalanche
zkEVM
PolygonZkEvm
}

type RootGauge @entity {
Expand Down
2 changes: 1 addition & 1 deletion src/gaugeFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function handleRootGaugeCreated(event: RootGaugeCreated): void {
} else if (isAvalancheFactory(factoryAddress)) {
gauge.chain = 'Avalanche';
} else if (isPolygonZkEVMFactory(factoryAddress)) {
gauge.chain = 'zkEVM';
gauge.chain = 'PolygonZkEvm';
}

gauge.save();
Expand Down
18 changes: 15 additions & 3 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ export const LOCK_MAXTIME = BigInt.fromI32(365 * 86400); // 1 YEAR
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
export class AddressByNetwork {
public mainnet: string;

public sepolia: string;
public goerli: string;
}

let network: string = dataSource.network();

let controllerAddressByNetwork: AddressByNetwork = {
mainnet: '0xC128468b7Ce63eA702C1f104D55A2566b13D3ABD',
sepolia: '0x577e5993B9Cc480F07F98B5Ebd055604bd9071C4',
goerli: '0xBB1CE49b16d55A1f2c6e88102f32144C7334B116',
};

Expand All @@ -27,6 +28,8 @@ function forNetwork(
): Address {
if (network == 'mainnet') {
return Address.fromString(addressByNetwork.mainnet);
} else if (network == 'sepolia') {
return Address.fromString(addressByNetwork.sepolia);
}
return Address.fromString(addressByNetwork.goerli);
}
Expand Down Expand Up @@ -61,6 +64,9 @@ export const GOERLI_GAUGE_V1_FACTORY = Address.fromString(
export const GOERLI_GAUGE_V2_FACTORY = Address.fromString(
'0x3b8cA519122CdD8efb272b0D3085453404B25bD0',
);
export const SEPOLIA_GAUGE_V2_FACTORY = Address.fromString(
'0x2FF226CD12C80511a641A6101F071d853A4e5363',
);
export const ARBITRUM_ROOT_GAUGE_V2_FACTORY = Address.fromString(
'0x1c99324EDC771c82A0DCCB780CC7DDA0045E50e7',
);
Expand Down Expand Up @@ -93,9 +99,15 @@ export function isMainnetFactory(factory: Address): boolean {
export function isGoerliFactory(factory: Address): boolean {
return [GOERLI_GAUGE_V1_FACTORY, GOERLI_GAUGE_V2_FACTORY].includes(factory);
}

export function isSepoliaFactory(factory: Address): boolean {
return factory == SEPOLIA_GAUGE_V2_FACTORY;
}
export function isL1Factory(factory: Address): boolean {
return isMainnetFactory(factory) || isGoerliFactory(factory);
return (
isMainnetFactory(factory) ||
isGoerliFactory(factory) ||
isSepoliaFactory(factory)
);
}

export function isOptimismFactory(factory: Address): boolean {
Expand Down
Loading

0 comments on commit 523f0b4

Please sign in to comment.