Skip to content

Commit

Permalink
Merge pull request #101 from balancer/fraxtal-root-gauge
Browse files Browse the repository at this point in the history
add fraxtal root gauge
  • Loading branch information
mendesfabio committed Jun 14, 2024
2 parents 0055cc2 + b69f00f commit f05030c
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 2 deletions.
28 changes: 28 additions & 0 deletions manifest.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,34 @@ dataSources:
- event: GaugeCreated(indexed address)
handler: handleRootGaugeCreated
{{/if}}
{{#if fraxtalRootGaugeV2Factory}}
- kind: ethereum/contract
name: FraxtalRootGaugeV2Factory
# prettier-ignore
network: {{network}}
source:
address: '{{fraxtalRootGaugeV2Factory.address}}'
abi: OptimismRootGaugeV2Factory
# prettier-ignore
startBlock: {{ fraxtalRootGaugeV2Factory.startBlock }}
mapping:
kind: ethereum/events
apiVersion: 0.0.5
language: wasm/assemblyscript
file: ./src/gaugeFactory.ts
abis:
- name: LiquidityGauge
file: ./abis/LiquidityGaugeV2.json
- name: ArbitrumRootGauge
file: ./abis/ArbitrumRootGauge.json
- name: OptimismRootGaugeV2Factory
file: ./abis/OptimismRootGaugeV2Factory.json
entities:
- RootGauge
eventHandlers:
- event: GaugeCreated(indexed address)
handler: handleRootGaugeCreated
{{/if}}
{{#if gnosisRootGaugeV2Factory}}
- kind: ethereum/contract
name: GnosisRootGaugeV2Factory
Expand Down
7 changes: 5 additions & 2 deletions networks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ mainnet:
network: mainnet
supportTraces: true
graft:
base: QmbfxmF1pMSQPRtk4y4GC6Y946fNy7bjraJEp6aYpojTDt
block: 17331264
base: QmNjLuUukf1QcSDWyYYAvSpNThLKjX3KubckiS3H2mn6rG
block: 19994775
EventEmitter:
address: "0x1ACfEEA57d2ac674d7E65964f155AB9348A6C290"
startBlock: 16419620
Expand Down Expand Up @@ -88,6 +88,9 @@ mainnet:
polygonZkEVMRootGaugeV2Factory:
address: "0x9bF951848288cCD87d06FaC426150262cD3447De"
startBlock: 17295833
fraxtalRootGaugeV2Factory:
address: "0x18CC3C68A5e64b40c846Aa6E45312cbcBb94f71b"
startBlock: 19994775
authorizerAdaptorEntrypoint:
address: "0xf5dECDB1f3d1ee384908Fbe16D2F0348AE43a9eA"
startBlock: 16042168
Expand Down
1 change: 1 addition & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ enum Chain {
Avalanche
PolygonZkEvm
Base
Fraxtal
}

type RootGauge @entity {
Expand Down
3 changes: 3 additions & 0 deletions src/gaugeFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
isArbitrumFactory,
isAvalancheFactory,
isBaseFactory,
isFraxtalFactory,
isGnosisFactory,
isOptimismFactory,
isPolygonFactory,
Expand Down Expand Up @@ -193,6 +194,8 @@ export function handleRootGaugeCreated(event: RootGaugeCreated): void {
gauge.chain = 'PolygonZkEvm';
} else if (isBaseFactory(factoryAddress)) {
gauge.chain = 'Base';
} else if (isFraxtalFactory(factoryAddress)) {
gauge.chain = 'Fraxtal';
}

gauge.save();
Expand Down
8 changes: 8 additions & 0 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export const POLYGON_ZKEVM_ROOT_GAUGE_V2_FACTORY = Address.fromString(
'0x9bF951848288cCD87d06FaC426150262cD3447De',
);

export const FRAXTAL_ROOT_GAUGE_V2_FACTORY = Address.fromString(
'0x18CC3C68A5e64b40c846Aa6E45312cbcBb94f71b',
);

export function isArbitrumFactory(factory: Address): boolean {
return [ARBITRUM_ROOT_GAUGE_FACTORY, ARBITRUM_ROOT_GAUGE_V2_FACTORY].includes(
factory,
Expand Down Expand Up @@ -140,3 +144,7 @@ export function isPolygonZkEVMFactory(factory: Address): boolean {
export function isBaseFactory(factory: Address): boolean {
return factory == BASE_ROOT_GAUGE_V2_FACTORY;
}

export function isFraxtalFactory(factory: Address): boolean {
return factory == FRAXTAL_ROOT_GAUGE_V2_FACTORY;
}

0 comments on commit f05030c

Please sign in to comment.