Skip to content

Commit 8a2a5d0

Browse files
committed
chore: deploy SAO data edge to testnet
1 parent ff8f0ed commit 8a2a5d0

File tree

7 files changed

+71
-88
lines changed

7 files changed

+71
-88
lines changed

packages/data-edge/addresses.json

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
2+
"1": {
3+
"EBODataEdge": "0xADE906194C923b28F03F48BC5D9D987AAE21fFab"
4+
},
5+
"42161": {
6+
"EBOEventfulDataEdge": "0x633bb9790d7c4c59991cebd377c0ed6501a35ebe"
7+
},
28
"421614": {
3-
"DataEdge": "0x17f1fcD16E2A9fF2a55c63C97a778D96Fa473548",
4-
"EventfulDataEdge": "0x9b9402939133F27c6eba81a321dfBFa1feE6714E"
9+
"EBOEventfulDataEdge": "0x9b9402939133F27c6eba81a321dfBFa1feE6714E",
10+
"SAOEventfulDataEdge": "0xB61AF143c79Cbdd68f179B657AaC86665CC2B469"
511
},
612
"11155111": {
7-
"DataEdge": "0x00C602A72363917Bc30a793593731F93352eB85d",
8-
"EventfulDataEdge": "0xEFC8D47673777b899f2FB597C6FC0E87ecce98Cb"
13+
"EBOEventfulDataEdge": "0xEFC8D47673777b899f2FB597C6FC0E87ecce98Cb"
914
}
1015
}

packages/data-edge/hardhat.config.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ import '@nomiclabs/hardhat-waffle'
1212
import 'hardhat-abi-exporter'
1313
import 'hardhat-gas-reporter'
1414
import 'hardhat-contract-sizer'
15-
import '@tenderly/hardhat-tenderly'
1615
import '@openzeppelin/hardhat-upgrades'
1716
import '@typechain/hardhat'
1817

18+
import * as tdly from "@tenderly/hardhat-tenderly";
19+
tdly.setup();
20+
1921
// Tasks
2022

2123
import './tasks/craft-calldata'
2224
import './tasks/post-calldata'
25+
import './tasks/deploy'
2326

2427
// Networks
2528

packages/data-edge/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@nomiclabs/hardhat-waffle": "^2.0.1",
4949
"@openzeppelin/contracts": "^4.5.0",
5050
"@openzeppelin/hardhat-upgrades": "^1.8.2",
51-
"@tenderly/hardhat-tenderly": "^1.0.12",
51+
"@tenderly/hardhat-tenderly": "^1.0.13",
5252
"@typechain/ethers-v5": "^9.0.0",
5353
"@typechain/hardhat": "^4.0.0",
5454
"@types/mocha": "^9.0.0",
@@ -60,7 +60,7 @@
6060
"ethereum-waffle": "^3.0.2",
6161
"ethers": "^5.1.3",
6262
"ethlint": "^1.2.5",
63-
"hardhat": "^2.6.1",
63+
"hardhat": "~2.14.0",
6464
"hardhat-abi-exporter": "^2.2.0",
6565
"hardhat-contract-sizer": "^2.0.3",
6666
"hardhat-gas-reporter": "^1.0.4",

packages/data-edge/scripts/deploy-local.ts

-39
This file was deleted.

packages/data-edge/scripts/deploy.ts

-39
This file was deleted.

packages/data-edge/tasks/deploy.ts

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import '@nomiclabs/hardhat-ethers'
2+
import { task } from 'hardhat/config'
3+
4+
import addresses from '../addresses.json'
5+
6+
import { promises as fs } from 'fs'
7+
8+
enum Contract {
9+
DataEdge,
10+
EventfulDataEdge
11+
}
12+
13+
enum DeployName {
14+
EBODataEdge = 'EBO',
15+
SAODataEdge = 'SAO',
16+
}
17+
18+
task('data-edge:deploy', 'Deploy a DataEdge contract')
19+
.addParam('contract', 'Chose DataEdge or EventfulDataEdge')
20+
.addParam('deployName', 'Chose EBO or SAO')
21+
.setAction(async (taskArgs, hre) => {
22+
if (!Object.values(Contract).includes(taskArgs.contract)) {
23+
throw new Error(`Contract ${taskArgs.contract} not supported`)
24+
}
25+
26+
if (!Object.values(DeployName).includes(taskArgs.deployName)) {
27+
throw new Error(`Deploy name ${taskArgs.deployName} not supported`)
28+
}
29+
30+
const factory = await hre.ethers.getContractFactory(taskArgs.contract)
31+
32+
console.log(`Deploying contract...`)
33+
const contract = await factory.deploy()
34+
const tx = contract.deployTransaction
35+
36+
// The address the Contract WILL have once mined
37+
console.log(`> deployer: ${await contract.signer.getAddress()}`)
38+
console.log(`> contract: ${contract.address}`)
39+
console.log(`> tx: ${tx.hash} nonce:${tx.nonce} limit: ${tx.gasLimit.toString()} gas: ${tx.gasPrice.toNumber() / 1e9} (gwei)`)
40+
41+
// The contract is NOT deployed yet; we must wait until it is mined
42+
await contract.deployed()
43+
console.log(`Done!`)
44+
45+
// Update addresses.json
46+
const chainId = (hre.network.config.chainId).toString()
47+
if (!addresses[chainId]) {
48+
addresses[chainId] = {}
49+
}
50+
let deployName = `${taskArgs.deployName}${taskArgs.contract}`
51+
addresses[chainId][deployName] = contract.address
52+
return fs.writeFile('addresses.json', JSON.stringify(addresses, null, 2))
53+
})

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -2887,7 +2887,7 @@ __metadata:
28872887
"@nomiclabs/hardhat-waffle": "npm:^2.0.1"
28882888
"@openzeppelin/contracts": "npm:^4.5.0"
28892889
"@openzeppelin/hardhat-upgrades": "npm:^1.8.2"
2890-
"@tenderly/hardhat-tenderly": "npm:^1.0.12"
2890+
"@tenderly/hardhat-tenderly": "npm:^1.0.13"
28912891
"@typechain/ethers-v5": "npm:^9.0.0"
28922892
"@typechain/hardhat": "npm:^4.0.0"
28932893
"@types/mocha": "npm:^9.0.0"
@@ -2899,7 +2899,7 @@ __metadata:
28992899
ethereum-waffle: "npm:^3.0.2"
29002900
ethers: "npm:^5.1.3"
29012901
ethlint: "npm:^1.2.5"
2902-
hardhat: "npm:^2.6.1"
2902+
hardhat: "npm:~2.14.0"
29032903
hardhat-abi-exporter: "npm:^2.2.0"
29042904
hardhat-contract-sizer: "npm:^2.0.3"
29052905
hardhat-gas-reporter: "npm:^1.0.4"
@@ -5382,7 +5382,7 @@ __metadata:
53825382
languageName: node
53835383
linkType: hard
53845384

5385-
"@tenderly/hardhat-tenderly@npm:^1.0.12":
5385+
"@tenderly/hardhat-tenderly@npm:^1.0.13":
53865386
version: 1.8.0
53875387
resolution: "@tenderly/hardhat-tenderly@npm:1.8.0"
53885388
dependencies:

0 commit comments

Comments
 (0)