Skip to content

Commit 71be91d

Browse files
committed
Deploy DataProtectorModule to arbitrum & Avalanche testnet
1 parent 68e05f5 commit 71be91d

15 files changed

+14272
-4
lines changed

packages/smart-contract/.env.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ MNEMONIC=
1212

1313
## Arbiscan API key to verify contracts
1414
ARBISCAN_API_KEY=
15+
16+
## Snowscan API key to verify contracts - Etherscan like for Avalanche
17+
SNOWSCAN_API_KEY=

packages/smart-contract/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Hardhat files
22
cache
3-
artifacts
3+
./artifacts
44

55
# TypeChain files
66
typechain

packages/smart-contract/config/env.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dotenv/config';
22
import { z } from 'zod';
33

4-
const addressRegex = /(^|\b)(0x)?[0-9a-fA-F]{64}(\b|$)/;
4+
const addressRegex = /(^|\b)(0x)?[0-9a-fA-F]{40}(\b|$)/;
55
const privateKeyRegex = /(^|\b)(0x)?[0-9a-fA-F]{64}(\b|$)/;
66

77
const envSchema = z.object({
@@ -27,6 +27,9 @@ const envSchema = z.object({
2727

2828
// Arbiscan API key
2929
ARBISCAN_API_KEY: z.string().optional().or(z.literal('')),
30+
31+
// Snowscan API key
32+
SNOWSCAN_API_KEY: z.string().optional().or(z.literal('')),
3033
});
3134

3235
export const env = envSchema.parse(process.env);

packages/smart-contract/hardhat.config.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const config: HardhatUserConfig = {
5656
etherscan: {
5757
apiKey: {
5858
bellecour: 'nothing', // a non-empty string is needed by the plugin.
59-
avalancheFuji: 'nothing', // a non-empty string is needed by the plugin.
59+
avalancheFuji: env.SNOWSCAN_API_KEY || '', // a non-empty string is needed by the plugin.
6060
arbitrumSepolia: env.ARBISCAN_API_KEY || '',
6161
},
6262
customChains: [
@@ -68,6 +68,23 @@ const config: HardhatUserConfig = {
6868
browserURL: 'https://blockscout.bellecour.iex.ec',
6969
},
7070
},
71+
//uncomment one
72+
{
73+
network: 'avalancheFuji',
74+
chainId: 43113,
75+
urls: {
76+
apiURL: 'https://api.avascan.info/v2/network/testnet/evm/43113/etherscan',
77+
browserURL: 'https://testnet.avascan.info/blockchain/c/home/',
78+
},
79+
},
80+
{
81+
network: 'avalancheFuji',
82+
chainId: 43113,
83+
urls: {
84+
apiURL: 'https://api-testnet.snowscan.xyz/api',
85+
browserURL: 'https://testnet.snowscan.xyz/',
86+
},
87+
},
7188
],
7289
},
7390
// Create2 deployments: it use crateX factory to deploy the contract
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"_format": "hh-sol-dbg-1",
3+
"buildInfo": "../build-info/c2a62fb472c97ae3cd4cd0844546de5a.json"
4+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"_format": "hh-sol-artifact-1",
3+
"contractName": "DataProtector",
4+
"sourceName": "contracts/DataProtector.sol",
5+
"abi": [
6+
{
7+
"inputs": [
8+
{
9+
"internalType": "contract IDatasetRegistry",
10+
"name": "_registry",
11+
"type": "address"
12+
}
13+
],
14+
"stateMutability": "nonpayable",
15+
"type": "constructor"
16+
},
17+
{
18+
"anonymous": false,
19+
"inputs": [
20+
{
21+
"indexed": true,
22+
"internalType": "contract IDataset",
23+
"name": "dataset",
24+
"type": "address"
25+
},
26+
{
27+
"indexed": false,
28+
"internalType": "string",
29+
"name": "schema",
30+
"type": "string"
31+
}
32+
],
33+
"name": "DatasetSchema",
34+
"type": "event"
35+
},
36+
{
37+
"inputs": [
38+
{
39+
"internalType": "address",
40+
"name": "_datasetOwner",
41+
"type": "address"
42+
},
43+
{
44+
"internalType": "string",
45+
"name": "_datasetName",
46+
"type": "string"
47+
},
48+
{
49+
"internalType": "string",
50+
"name": "_datasetSchema",
51+
"type": "string"
52+
},
53+
{
54+
"internalType": "bytes",
55+
"name": "_datasetMultiaddr",
56+
"type": "bytes"
57+
},
58+
{
59+
"internalType": "bytes32",
60+
"name": "_datasetChecksum",
61+
"type": "bytes32"
62+
}
63+
],
64+
"name": "createDatasetWithSchema",
65+
"outputs": [
66+
{
67+
"internalType": "contract IDataset",
68+
"name": "",
69+
"type": "address"
70+
}
71+
],
72+
"stateMutability": "nonpayable",
73+
"type": "function"
74+
},
75+
{
76+
"inputs": [],
77+
"name": "registry",
78+
"outputs": [
79+
{
80+
"internalType": "contract IDatasetRegistry",
81+
"name": "",
82+
"type": "address"
83+
}
84+
],
85+
"stateMutability": "view",
86+
"type": "function"
87+
}
88+
],
89+
"bytecode": "0x60a0604052348015600f57600080fd5b50604051610415380380610415833981016040819052602c91603c565b6001600160a01b0316608052606a565b600060208284031215604d57600080fd5b81516001600160a01b0381168114606357600080fd5b9392505050565b60805161038b61008a60003960008181606f01526096015261038b6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063167fbf5f1461003b5780637b1039991461006a575b600080fd5b61004e6100493660046101e0565b610091565b6040516001600160a01b03909116815260200160405180910390f35b61004e7f000000000000000000000000000000000000000000000000000000000000000081565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633354bcdb8b8b8b8989896040518763ffffffff1660e01b81526004016100ea969594939291906102c9565b6020604051808303816000875af1158015610109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012d9190610315565b9050806001600160a01b03167f37b19b8900a9b045473748167f459fa16828f33c13d71473bca4b5e52e5f4d5d888860405161016a929190610339565b60405180910390a29998505050505050505050565b6001600160a01b038116811461019457600080fd5b50565b60008083601f8401126101a957600080fd5b50813567ffffffffffffffff8111156101c157600080fd5b6020830191508360208285010111156101d957600080fd5b9250929050565b60008060008060008060008060a0898b0312156101fc57600080fd5b88356102078161017f565b9750602089013567ffffffffffffffff81111561022357600080fd5b61022f8b828c01610197565b909850965050604089013567ffffffffffffffff81111561024f57600080fd5b61025b8b828c01610197565b909650945050606089013567ffffffffffffffff81111561027b57600080fd5b6102878b828c01610197565b999c989b50969995989497949560800135949350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03871681526080602082018190526000906102ee90830187896102a0565b82810360408401526103018186886102a0565b915050826060830152979650505050505050565b60006020828403121561032757600080fd5b81516103328161017f565b9392505050565b60208152600061034d6020830184866102a0565b94935050505056fea2646970667358221220f178247810e731b2c7a76fcefad2ca335779409b90779f5dbe730d9eac01709164736f6c634300081d0033",
90+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063167fbf5f1461003b5780637b1039991461006a575b600080fd5b61004e6100493660046101e0565b610091565b6040516001600160a01b03909116815260200160405180910390f35b61004e7f000000000000000000000000000000000000000000000000000000000000000081565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633354bcdb8b8b8b8989896040518763ffffffff1660e01b81526004016100ea969594939291906102c9565b6020604051808303816000875af1158015610109573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012d9190610315565b9050806001600160a01b03167f37b19b8900a9b045473748167f459fa16828f33c13d71473bca4b5e52e5f4d5d888860405161016a929190610339565b60405180910390a29998505050505050505050565b6001600160a01b038116811461019457600080fd5b50565b60008083601f8401126101a957600080fd5b50813567ffffffffffffffff8111156101c157600080fd5b6020830191508360208285010111156101d957600080fd5b9250929050565b60008060008060008060008060a0898b0312156101fc57600080fd5b88356102078161017f565b9750602089013567ffffffffffffffff81111561022357600080fd5b61022f8b828c01610197565b909850965050604089013567ffffffffffffffff81111561024f57600080fd5b61025b8b828c01610197565b909650945050606089013567ffffffffffffffff81111561027b57600080fd5b6102878b828c01610197565b999c989b50969995989497949560800135949350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03871681526080602082018190526000906102ee90830187896102a0565b82810360408401526103018186886102a0565b915050826060830152979650505050505050565b60006020828403121561032757600080fd5b81516103328161017f565b9392505050565b60208152600061034d6020830184866102a0565b94935050505056fea2646970667358221220f178247810e731b2c7a76fcefad2ca335779409b90779f5dbe730d9eac01709164736f6c634300081d0033",
91+
"linkReferences": {},
92+
"deployedLinkReferences": {}
93+
}

0 commit comments

Comments
 (0)