Skip to content

Commit 0ef6d89

Browse files
committed
feat: deployed iotexTestnet
also touched up the deployment scripts so that I can better document the end-to-end process of running that script, too: supplying env vars etc.
1 parent 5184b91 commit 0ef6d89

8 files changed

+634
-68
lines changed

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
[![Audit by LimeChain](https://img.shields.io/badge/Audit-LimeChain-green)](https://streamr-public.s3.amazonaws.com/DATAv2_audit_LimeChain.pdf)
44
[![Audit by Isentropy](https://img.shields.io/badge/Audit-Isentropy-green)](https://streamr-public.s3.amazonaws.com/DATAv2_audit_Isentropy.pdf)
55

6+
## Deployments
7+
8+
| Chain | Address |
9+
|-------|---------|
10+
| Ethereum Mainnet | [0x8f693ca8d21b157107184d29d398a8d082b38b76](https://etherscan.io/address/0x8f693ca8d21b157107184d29d398a8d082b38b76#readContract) |
11+
| Binance Smart Chain | [0x0864c156b3c5f69824564dec60c629ae6401bf2a](https://bscscan.com/address/0x0864c156b3c5f69824564dec60c629ae6401bf2a#readContract) |
12+
| Gnosis (formerly xDAI) | [0x256eb8a51f382650B2A1e946b8811953640ee47D](https://gnosis.blockscout.com/address/0x256eb8a51f382650B2A1e946b8811953640ee47D) |
13+
| Polygon | [0x3a9A81d576d83FF21f26f325066054540720fC34](https://polygonscan.com/address/0x3a9A81d576d83FF21f26f325066054540720fC34#code) |
14+
| Polygon Amoy testnet | [0xf5e28a2E7BbedbE97c3782b17b102410E10d90f1](https://amoy.polygonscan.com/address/0xf5e28a2E7BbedbE97c3782b17b102410E10d90f1#code) |
15+
| IoTeX testnet | [0x5ABD469031d2B5f939808565EAB8562d7Cbaa939](https://testnet.iotexscan.io/address/0x5ABD469031d2B5f939808565EAB8562d7Cbaa939) |
16+
617
## NPM package contents
718

819
JS/TypeScript utilities to get a nicely typed DATAv2 instance. Here's a sample code for plain node.js:
@@ -39,10 +50,10 @@ console.log("Symbol:", await token.symbol())
3950
## List of files
4051

4152
| File | Description | Deployed |
42-
|--------------------------------|-------------|---------|
43-
|contracts/CrowdsaleToken.sol | The current (or "old") DATA token | ETH [0x0cf0...23](https://etherscan.io/address/0x0cf0ee63788a0849fe5297f3407f701e122cc023#readContract)
44-
|contracts/DATAv2.sol | The new DATA token | ETH [0x8f6...b76](https://etherscan.io/address/0x8f693ca8d21b157107184d29d398a8d082b38b76#readContract) BSC [0x0864...2a](https://bscscan.com/address/0x0864c156b3c5f69824564dec60c629ae6401bf2a#readContract) xDAI [0x256...47D](https://blockscout.com/poa/xdai/address/0x256eb8a51f382650B2A1e946b8811953640ee47D)
45-
|contracts/DataTokenMigrator.sol | Migrator contract that acts as UpgradeAgent for the old token | ETH [0xc7...c16c](https://etherscan.io/address/0xc7aaf6c62e86a36395d8108fe95d5f758794c16c#readContract)
53+
|--------------------------------|-------------|----------|
54+
|contracts/CrowdsaleToken.sol | The current (or "old") DATA token | ETH [0x0cf0...23](https://etherscan.io/address/0x0cf0ee63788a0849fe5297f3407f701e122cc023#readContract) |
55+
|contracts/DATAv2.sol | The new DATA token | ETH [0x8f6...b76](https://etherscan.io/address/0x8f693ca8d21b157107184d29d398a8d082b38b76#readContract) (see above) |
56+
|contracts/DataTokenMigrator.sol | Migrator contract that acts as UpgradeAgent for the old token | ETH [0xc7...c16c](https://etherscan.io/address/0xc7aaf6c62e86a36395d8108fe95d5f758794c16c#readContract) |
4657
|contracts/IERC677.sol | Interface of ERC677 as defined in [the LINK token](https://etherscan.io/address/0x514910771af9ca656af840dff83e8264ecf986ca#code) |
4758
|contracts/IERC677Receiver.sol | Interface of ERC677Receiver also defined in [the LINK token](https://etherscan.io/address/0x514910771af9ca656af840dff83e8264ecf986ca#code) |
4859
|contracts/MockRecipient.sol | IERC677Receiver implementation for the purpose of testing |
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
$ ./scripts/2024-10-24-deploy-iotex-testnet.sh [20:20:54]
2+
+ '[' -z <redacted> ']'
3+
+ export PROVIDER=https://babel-api.testnet.iotex.io
4+
+ PROVIDER=https://babel-api.testnet.iotex.io
5+
+ export EXPLORER=https://testnet.iotexscan.io
6+
+ EXPLORER=https://testnet.iotexscan.io
7+
+ export OUTPUT_FILE=iotex-testnet-address.txt
8+
+ OUTPUT_FILE=iotex-testnet-address.txt
9+
+ ./scripts/deploy-without-migrator.js
10+
Deploying contracts from 0x41e36D4fFb5B443B20f55bcFf27c68fF086Fe06f
11+
Connected to network at https://babel-api.testnet.iotex.io: {"name":"unknown","chainId":"4690"}
12+
Follow deployment: https://testnet.iotexscan.io/tx/0x13c362b06e5a14c8826beb448c5d13527b17ec5d3517d3fa123b7cf164c2092c
13+
DATAv2 deployed to: 0x5ABD469031d2B5f939808565EAB8562d7Cbaa939
14+
Follow grant minter role: https://testnet.iotexscan.io/tx/0x9bcc8c2a79aad3ca9d94fc91e86caf6ab2c6f4abf1f66aa14513cc7d4cc4a747
15+
Follow grant admin role: https://testnet.iotexscan.io/tx/0xd204ed0533514ddcb07d42d2520728b6918296fcaf540cf2b485a44f36323588
16+
++ cat iotex-testnet-address.txt
17+
+ npx hardhat verify --network iotexTestnet 0x5ABD469031d2B5f939808565EAB8562d7Cbaa939
18+
[INFO] Sourcify Verification Skipped: Sourcify verification is currently disabled. To enable it, add the following entry to your Hardhat configuration:
19+
20+
sourcify: {
21+
enabled: true
22+
}
23+
24+
Or set 'enabled' to false to hide this message.
25+
26+
For more information, visit https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify#verifying-on-sourcify
27+
hardhat-verify found one or more errors during the verification process:
28+
29+
Etherscan:
30+
The address 0x5ABD469031d2B5f939808565EAB8562d7Cbaa939 has no bytecode. Is the contract deployed to this network?
31+
The selected network is iotexTestnet.
32+
33+
34+
+ echo 'Retrying in 10 seconds...'
35+
Retrying in 10 seconds...
36+
+ sleep 10
37+
++ cat iotex-testnet-address.txt
38+
+ npx hardhat verify --network iotexTestnet 0x5ABD469031d2B5f939808565EAB8562d7Cbaa939
39+
[INFO] Sourcify Verification Skipped: Sourcify verification is currently disabled. To enable it, add the following entry to your Hardhat configuration:
40+
41+
sourcify: {
42+
enabled: true
43+
}
44+
45+
Or set 'enabled' to false to hide this message.
46+
47+
For more information, visit https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-verify#verifying-on-sourcify
48+
Successfully submitted source code for contract
49+
contracts/DATAv2.sol:DATAv2 at 0x5ABD469031d2B5f939808565EAB8562d7Cbaa939
50+
for verification on the block explorer. Waiting for verification result...
51+
52+
Successfully verified contract DATAv2 on the block explorer.
53+
https://testnet.iotexscan.io/address/0x5ABD469031d2B5f939808565EAB8562d7Cbaa939#code

hardhat.config.js

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require("@nomicfoundation/hardhat-ethers")
33
require("@typechain/hardhat")
44
require("hardhat-gas-reporter")
55
require("solidity-coverage")
6+
require("@nomicfoundation/hardhat-verify")
67

78
// You need to export an object to set up your config
89
// Go to https://hardhat.org/config/ to learn more
@@ -27,8 +28,78 @@ module.exports = {
2728
}
2829
]
2930
},
31+
networks: {
32+
hardhat: {},
33+
polygon: {
34+
chainId: 137,
35+
url: "https://polygon-rpc.com",
36+
// gasPrice: 80000000000,
37+
},
38+
polygonAmoy: {
39+
chainId: 80002,
40+
url: process.env.ETHEREUM_RPC || "https://rpc-amoy.polygon.technology",
41+
},
42+
ethereum: {
43+
chainId: 1,
44+
url: "https://mainnet.infura.io/v3/" + process.env.INFURA_KEY || "",
45+
},
46+
peaq: {
47+
chainId: 3338,
48+
url: "https://peaq.api.onfinality.io/public",
49+
},
50+
iotex: {
51+
url: "https://babel-api.mainnet.IoTeX.io",
52+
chainId: 4689,
53+
gas: 8500000,
54+
gasPrice: 1000000000000
55+
},
56+
iotexTestnet: {
57+
url: "https://babel-api.testnet.IoTeX.io",
58+
chainId: 4690,
59+
gas: 8500000,
60+
gasPrice: 1000000000000
61+
},
62+
},
3063
typechain: {
3164
outDir: "typechain",
3265
target: "ethers-v6"
33-
}
66+
},
67+
etherscan: {
68+
apiKey: {
69+
polygon: process.env.VERIFY_API_KEY || "",
70+
polygonAmoy: process.env.VERIFY_API_KEY || "",
71+
peaq: process.env.VERIFY_API_KEY || "",
72+
iotexTestnet: "no key needed!",
73+
iotex: "no key needed!",
74+
},
75+
customChains: [{
76+
network: "polygonAmoy",
77+
chainId: 80002,
78+
urls: {
79+
apiURL: "https://api-amoy.polygonscan.com/api",
80+
browserURL: "https://amoy.polygonscan.com"
81+
},
82+
}, {
83+
network: "peaq",
84+
chainId: 3338,
85+
urls: {
86+
apiURL: "https://peaq-testnet.api.subscan.io",
87+
browserURL: "https://peaq.subscan.io/"
88+
},
89+
}, {
90+
network: "iotex",
91+
chainId: 4689,
92+
urls: {
93+
apiURL: "https://iotexscout.io/api",
94+
browserURL: "https://iotexscan.io"
95+
},
96+
}, {
97+
network: "iotexTestnet",
98+
chainId: 4690,
99+
urls: {
100+
apiURL: "https://testnet.iotexscout.io/api",
101+
browserURL: "https://testnet.iotexscan.io"
102+
},
103+
}]
104+
},
34105
}

0 commit comments

Comments
 (0)