Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/core-smart-contract-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ on:
type: choice
options:
- hardhat
- avalancheFujiTestnet
- arbitrumSepolia
- arbitrum
- bellecour
default: 'hardhat'
environment:
description: 'Environment'
Expand Down Expand Up @@ -59,7 +57,7 @@ jobs:
NETWORK="${{ inputs.network }}"
ENVIRONMENT="${{ inputs.environment }}"
case "$NETWORK" in
arbitrum|bellecour)
arbitrum)
if [ "$ENVIRONMENT" = "dev" ]; then
echo "Error: Cannot deploy to mainnet ($NETWORK) with dev environment"
exit 1
Expand Down Expand Up @@ -109,7 +107,6 @@ jobs:
env:
# For Verification
EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}
IS_VERIFICATION_API_V2: ${{ vars.IS_VERIFICATION_API_V2 }}
run: |
# For testnets, use network-environment; for mainnets, use network only
if [ "$IS_MAINNET" = false ]; then
Expand Down
3 changes: 0 additions & 3 deletions packages/smart-contract/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ MNEMONIC=

## API key to verify contracts
EXPLORER_API_KEY=

## Whether to use API V2 verification format
IS_VERIFICATION_API_V2=
6 changes: 3 additions & 3 deletions packages/smart-contract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The `DataProtector` contract is designed to attach schemas to datasets and publi
To deploy the contract, run the following command:

```sh
npm run deploy -- --network avalancheFuji
npm run deploy -- --network arbitrumSepolia
```

If no network is specified, the local Hardhat network will be used by default.
Expand All @@ -21,13 +21,13 @@ If no network is specified, the local Hardhat network will be used by default.
To verify the contract during deployment, include the `--verify` option in the deployment command:

```sh
npm run deploy -- --network avalancheFuji --verify
npm run deploy -- --network arbitrumSepolia --verify
```

If the contract has already been deployed, you can verify it separately using the following command:

```sh
npx hardhat ignition verify chain-43113
npx hardhat ignition verify chain-421614
```

This ensures the contract's source code is verified on the blockchain explorer for the specified network.
3 changes: 2 additions & 1 deletion packages/smart-contract/config/config.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const DATASET_REGISTRY_ADDRESS = '0x799DAa22654128d0C64d5b79eac9283008158730';
// iExec PoCo DatasetRegistry, same address on arbitrum-sepolia and arbitrum mainnet
export const DATASET_REGISTRY_ADDRESS = '0x07Cc4E1EA30dD02796795876509A3BfC5053128D';
10 changes: 0 additions & 10 deletions packages/smart-contract/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ const envSchema = z.object({

// Arbiscan API key
EXPLORER_API_KEY: z.string().optional().or(z.literal('')),

// Whether to use API V2 verification format
IS_VERIFICATION_API_V2: z
.string()
.optional()
.default('true')
.refine((val) => val === 'true' || val === 'false', {
message: 'IS_VERIFICATION_API_V2 must be "true" or "false"',
})
.transform((val) => val === 'true'),
});

export const env = envSchema.parse(process.env);
44 changes: 4 additions & 40 deletions packages/smart-contract/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,12 @@ const privateKey = env.DEPLOYER_PRIVATE_KEY;
const config: HardhatUserConfig = {
networks: {
hardhat: {
// fork needed to expose the CreateX factory used by the create2 deploy strategy
forking: {
enabled: true,
url: 'https://bellecour.iex.ec',
url: 'https://sepolia-rollup.arbitrum.io/rpc',
},
},
// modify with the dev network when the environment is ready
bellecour: {
url: 'https://bellecour.iex.ec',
gasPrice: 0,
accounts: privateKey ? [privateKey] : [],
},
// Add Fuji as a network
avalancheFuji: {
url: env.RPC_URL || 'https://api.avax-test.network/ext/bc/C/rpc',
accounts: privateKey ? [privateKey] : [],
blockGasLimit: 8_000_000,
chainId: 43113,
},
// Add Arbitrum Sepolia as a network
arbitrumSepolia: {
url: env.RPC_URL || 'https://sepolia-rollup.arbitrum.io/rpc',
Expand All @@ -48,33 +36,9 @@ const config: HardhatUserConfig = {
gasPrice: 0,
},
},
//to verify contract on Blockscout
//to verify contract on the block explorer
etherscan: {
apiKey: env.IS_VERIFICATION_API_V2
? env.EXPLORER_API_KEY
: {
bellecour: env.EXPLORER_API_KEY || 'nothing', // a non-empty string is needed by the plugin.
avalancheFuji: env.EXPLORER_API_KEY || 'nothing', // a non-empty string is needed by the plugin.
},
customChains: [
{
network: 'bellecour',
chainId: 134,
urls: {
apiURL: 'https://blockscout.bellecour.iex.ec/api',
browserURL: 'https://blockscout.bellecour.iex.ec',
},
},
{
network: 'avalancheFuji',
chainId: 43113,
urls: {
// Snowtrace explorer.
apiURL: 'https://api.routescan.io/v2/network/testnet/evm/43113/etherscan/api',
browserURL: 'https://testnet.snowtrace.io/',
},
},
],
apiKey: env.EXPLORER_API_KEY || '',
},
sourcify: {
enabled: true,
Expand Down
22 changes: 0 additions & 22 deletions packages/subgraph/networks.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,4 @@
{
"fuji": {
"DataProtector": {
"address": "0x2296daeDD3090750a80fFB2D0147669984909ED2",
"startBlock": 39768073
},
"DatasetRegistry": {
"address": "0x3441A0C9FE488c51fcABa2bAAA048720f4D4F72D",
"startBlock": 39768073
},
"DataProtectorSharing": {
"address": "0x0000000000000000000000000000000000000000",
"startBlock": 0
},
"AppRegistry": {
"address": "0x4a6531ce5150ee716b2d93865D0fbB9ce5492D17",
"startBlock": 0
},
"AddOnlyAppWhitelistRegistry": {
"address": "0x0000000000000000000000000000000000000000",
"startBlock": 0
}
},
"arbitrum-sepolia": {
"DataProtector": {
"address": "0x168eAF6C33a77E3caD9db892452f51a5D91df621",
Expand Down
Loading