Skip to content

Commit

Permalink
feat: added sepolia testnet to contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikol committed Nov 6, 2023
1 parent a4b6ba0 commit 59eded9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/contracts/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"421614": {
"DataEdge": "0x17f1fcD16E2A9fF2a55c63C97a778D96Fa473548"
},
"11155111": {
"DataEdge": "0x00C602A72363917Bc30a793593731F93352eB85d"
}
}
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
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 59eded9

Please sign in to comment.