-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tomás Migone <tomas@edgeandnode.com>
- Loading branch information
1 parent
c0cf4e9
commit 9d0067c
Showing
10 changed files
with
499 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import * as fs from 'fs' | ||
import * as mustache from 'mustache' | ||
import * as networkAddresses from '@graphprotocol/contracts/addresses.json' | ||
import { Addresses } from './addresses.template' | ||
|
||
// mustache doesn't like numbered object keys | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
let renameAddresses: any = networkAddresses | ||
renameAddresses['arbgor'] = networkAddresses['421613'] | ||
|
||
export let addresses: Addresses = { | ||
controller: '{{arbgor.Controller.address}}', | ||
graphToken: '{{arbgor.GraphToken.address}}', | ||
epochManager: '{{arbgor.EpochManager.address}}', | ||
disputeManager: '{{arbgor.DisputeManager.address}}', | ||
staking: '{{arbgor.Staking.address}}', | ||
curation: '{{arbgor.Curation.address}}', | ||
rewardsManager: '{{arbgor.RewardsManager.address}}', | ||
serviceRegistry: '{{arbgor.ServiceRegistry.address}}', | ||
gns: '{{arbgor.GNS.address}}', | ||
ens: '{{arbgor.IENS.address}}', | ||
ensPublicResolver: '{{arbgor.IPublicResolver.address}}', | ||
blockNumber: '', | ||
bridgeBlockNumber: '', | ||
network: '', | ||
tokenLockManager: '', | ||
subgraphNFT: '{{arbgor.SubgraphNFT.address}}', | ||
l2GraphTokenGateway: '{{arbgor.L2GraphTokenGateway.address}}', | ||
} | ||
|
||
const main = (): void => { | ||
try { | ||
let output = JSON.parse(mustache.render(JSON.stringify(addresses), renameAddresses)) | ||
output.blockNumber = '1023264' // Protocol deployment | ||
output.bridgeBlockNumber = '1023272' // Bridge deployment block | ||
output.network = 'arbitrum-goerli' | ||
output.useTokenLockManager = false | ||
output.isL1 = false | ||
fs.writeFileSync(__dirname + '/generatedAddresses.json', JSON.stringify(output, null, 2)) | ||
} catch (e) { | ||
console.log(`Error saving artifacts: ${e.message}`) | ||
} | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { DepositInitiated } from '../types/L1GraphTokenGateway/L1GraphTokenGateway' | ||
import { GraphNetwork } from '../types/schema' | ||
|
||
export function handleDepositInitiated(event: DepositInitiated): void { | ||
let graphNetwork = GraphNetwork.load('1')! | ||
graphNetwork.totalGRTDeposited = graphNetwork.totalGRTDeposited.plus(event.params.amount) | ||
graphNetwork.save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { WithdrawalInitiated } from '../types/L1GraphTokenGateway/L2GraphTokenGateway' | ||
import { GraphNetwork } from '../types/schema' | ||
|
||
export function handleWithdrawalInitiated(event: WithdrawalInitiated): void { | ||
let graphNetwork = GraphNetwork.load('1')! | ||
graphNetwork.totalGRTWithdrawn = graphNetwork.totalGRTWithdrawn.plus(event.params.amount) | ||
graphNetwork.save() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.