Skip to content

Commit

Permalink
Merge pull request #249 from graphprotocol/mde/sepolia-testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikol authored Nov 8, 2023
2 parents a4b6ba0 + df4ecf2 commit 05dd81d
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 3 deletions.
10 changes: 10 additions & 0 deletions packages/contracts/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"421614": {
"DataEdge": "0x17f1fcD16E2A9fF2a55c63C97a778D96Fa473548",
"EventfulDataEdge": "0x9b9402939133F27c6eba81a321dfBFa1feE6714E"
},
"11155111": {
"DataEdge": "0x00C602A72363917Bc30a793593731F93352eB85d",
"EventfulDataEdge": "0xEFC8D47673777b899f2FB597C6FC0E87ecce98Cb"
}
}
18 changes: 18 additions & 0 deletions packages/contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const networkConfigs: NetworkConfig[] = [
{ network: 'ropsten', chainId: 3 },
{ network: 'rinkeby', chainId: 4 },
{ network: 'kovan', chainId: 42 },
{ network: 'sepolia', chainId: 11155111 },
{
network: 'arbitrum-one',
chainId: 42161,
Expand All @@ -46,6 +47,11 @@ const networkConfigs: NetworkConfig[] = [
chainId: 421613,
url: 'https://goerli-rollup.arbitrum.io/rpc',
},
{
network: 'arbitrum-sepolia',
chainId: 421614,
url: 'https://sepolia-rollup.arbitrum.io/rpcblock',
},
]

function getAccountMnemonic() {
Expand Down Expand Up @@ -129,9 +135,21 @@ const config: HardhatUserConfig = {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY,
goerli: process.env.ETHERSCAN_API_KEY,
sepolia: process.env.ETHERSCAN_API_KEY,
arbitrumOne: process.env.ARBISCAN_API_KEY,
arbitrumGoerli: process.env.ARBISCAN_API_KEY,
arbitrumSepolia: process.env.ARBISCAN_API_KEY,
},
customChains: [
{
network: 'arbitrumSepolia',
chainId: 421614,
urls: {
apiURL: 'https://api-sepolia.arbiscan.io/api',
browserURL: 'https://sepolia.arbiscan.io',
},
},
],
},
gasReporter: {
enabled: process.env.REPORT_GAS ? true : false,
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@graphprotocol/graph-data-edge",
"version": "0.1.0",
"version": "0.2.0",
"description": "The Graph Data Edge",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 13 additions & 1 deletion packages/contracts/scripts/deploy-local.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import '@nomiclabs/hardhat-ethers'
import { ethers } from 'hardhat'
import { ethers, network } from 'hardhat'

import addresses from '../addresses.json'

import { promises as fs } from 'fs'

async function main() {
const factory = await ethers.getContractFactory('EventfulDataEdge')
Expand All @@ -17,6 +21,14 @@ async function main() {
// The contract is NOT deployed yet; we must wait until it is mined
await contract.deployed()
console.log(`Done!`)

// Update addresses.json
const chainId = (network.config.chainId as number).toString()
if (!addresses[chainId]) {
addresses[chainId] = {}
}
addresses[chainId]['EventfulDataEdge'] = contract.address
return fs.writeFile('addresses.json', JSON.stringify(addresses, null, 2))
}

main()
Expand Down
14 changes: 13 additions & 1 deletion packages/contracts/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import '@nomiclabs/hardhat-ethers'
import { ethers } from 'hardhat'
import { ethers, network } from 'hardhat'

import addresses from '../addresses.json'

import { promises as fs } from 'fs'

async function main() {
const factory = await ethers.getContractFactory('DataEdge')
Expand All @@ -17,6 +21,14 @@ async function main() {
// The contract is NOT deployed yet; we must wait until it is mined
await contract.deployed()
console.log(`Done!`)

// Update addresses.json
const chainId = (network.config.chainId as number).toString()
if (!addresses[chainId]) {
addresses[chainId] = {}
}
addresses[chainId]['DataEdge'] = contract.address
return fs.writeFile('addresses.json', JSON.stringify(addresses, null, 2))
}

main()
Expand Down

0 comments on commit 05dd81d

Please sign in to comment.