diff --git a/README.md b/README.md index f0a82413..d9c9487f 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,8 @@ This project utilizes a variety of NPM scripts to run various tasks and processe - `compile:size`: Compiles the smart contracts and analyzes the size of the compiled contracts using the hardhat-contract-sizer plugin. - `compile`: Compiles the smart contracts with specific configuration using `hardhat.node.config.ts`. - `coverage`: Generates a code coverage report for the smart contracts with specific network and coverage settings. -- `deploy:v1:gno_chiado`, `deploy:v1:gno_mainnet`, `deploy:v1:localhost`, `deploy:v1:otp_alphanet`, `deploy:v1:otp_devnet`, `deploy:v1:otp_mainnet`, `deploy:v1:otp_testnet`, and `deploy:v1`: Deploy version 1 of the smart contracts to various networks including Gnosis Chiado, Hardhat, OriginTrail Parachain Alphanet, OriginTrail Parachain Devnet, OriginTrail Parachain Testnet, and OriginTrail Parachain Mainnet. -- `deploy:v2:gno_chiado`, `deploy:v2:gno_mainnet`, `deploy:v2:localhost`, `deploy:v2:otp_alphanet`, `deploy:v2:otp_devnet`, `deploy:v2:otp_mainnet`, `deploy:v2:otp_testnet`, and `deploy:v2`: Similar to the v1 deploy scripts, these deploy version 2 of the smart contracts to the respective networks. +- `deploy:v1:gnosis_chiado_dev`, `deploy:v1:gnosis_chiado_test`, `deploy:v1:gnosis_mainnet`, `deploy:v1:localhost`, `deploy:v1:otp_alphanet`, `deploy:v1:otp_devnet`, `deploy:v1:otp_mainnet`, `deploy:v1:otp_testnet`, and `deploy:v1`: Deploy version 1 of the smart contracts to various networks including Gnosis Chiado, Hardhat, OriginTrail Parachain Alphanet, OriginTrail Parachain Devnet, OriginTrail Parachain Testnet, and OriginTrail Parachain Mainnet. +- `deploy:v2:gnosis_chiado_dev`, `deploy:v2:gnosis_chiado_test`, `deploy:v2:gnosis_mainnet`, `deploy:v2:localhost`, `deploy:v2:otp_alphanet`, `deploy:v2:otp_devnet`, `deploy:v2:otp_mainnet`, `deploy:v2:otp_testnet`, and `deploy:v2`: Similar to the v1 deploy scripts, these deploy version 2 of the smart contracts to the respective networks. - `dev:v1`, `dev:v2`, and `dev`: Run local development nodes with Hardhat for different versions of contracts. - `export-abi`: Updates ABI files according to the current state of the smart contracts. - `format:fix`: Automatically fixes code formatting issues for JSON, JavaScript, TypeScript, and Solidity files using Prettier. @@ -128,24 +128,35 @@ npm run deploy:v2:otp_mainnet
-Gnosis Chiado (v1 contracts) +Gnosis Chiado Dev (v1 contracts) ```sh -npm run deploy:v1:gno_chiado +npm run deploy:v1:gnosis_chiado_dev ``` or (v2 contracts) ```sh -npm run deploy:v2:gno_chiado +npm run deploy:v2:gnosis_chiado_dev +``` + +
+ +Gnosis Chiado Test (v1 contracts) +```sh +npm run deploy:v1:gnosis_chiado_test +``` +or (v2 contracts) +```sh +npm run deploy:v2:gnosis_chiado_test ```
Gnosis Mainnet (v1 contracts) ```sh -npm run deploy:v1:gno_mainnet +npm run deploy:v1:gnosis_mainnet ``` or (v2 contracts) ```sh -npm run deploy:v2:gno_mainnet +npm run deploy:v2:gnosis_mainnet ```
diff --git a/deploy/001_deploy_hub_v2.ts b/deploy/001_deploy_hub_v2.ts index e91ce96a..a0c442b3 100644 --- a/deploy/001_deploy_hub_v2.ts +++ b/deploy/001_deploy_hub_v2.ts @@ -2,7 +2,11 @@ import { DeployFunction } from 'hardhat-deploy/types'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - if (hre.helpers.isDeployed('Hub') && hre.helpers.contractDeployments.contracts['Hub'].version.startsWith('1.')) { + if ( + hre.helpers.isDeployed('Hub') && + (hre.helpers.contractDeployments.contracts['Hub'].version === undefined || + hre.helpers.contractDeployments.contracts['Hub'].version?.startsWith('1.')) + ) { return; } diff --git a/deploy/002_deploy_hub.ts b/deploy/002_deploy_hub.ts index 8ce4d67b..abb3aa13 100644 --- a/deploy/002_deploy_hub.ts +++ b/deploy/002_deploy_hub.ts @@ -2,7 +2,11 @@ import { DeployFunction } from 'hardhat-deploy/types'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { - if (hre.helpers.isDeployed('Hub') && hre.helpers.contractDeployments.contracts['Hub'].version.startsWith('2.')) { + if ( + hre.helpers.isDeployed('Hub') && + (hre.helpers.contractDeployments.contracts['Hub'].version === undefined || + hre.helpers.contractDeployments.contracts['Hub'].version?.startsWith('2.')) + ) { return; } diff --git a/deploy/011_deploy_identity_storage_v2.ts b/deploy/011_deploy_identity_storage_v2.ts index 1e235069..3c80d70e 100644 --- a/deploy/011_deploy_identity_storage_v2.ts +++ b/deploy/011_deploy_identity_storage_v2.ts @@ -4,7 +4,8 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { if ( hre.helpers.isDeployed('IdentityStorage') && - hre.helpers.contractDeployments.contracts['IdentityStorage'].version.startsWith('1.') + (hre.helpers.contractDeployments.contracts['IdentityStorage'].version === undefined || + hre.helpers.contractDeployments.contracts['IdentityStorage'].version?.startsWith('1.')) ) { return; } diff --git a/deploy/012_deploy_identity_storage.ts b/deploy/012_deploy_identity_storage.ts index 6c73e858..016cb80b 100644 --- a/deploy/012_deploy_identity_storage.ts +++ b/deploy/012_deploy_identity_storage.ts @@ -4,7 +4,8 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { if ( hre.helpers.isDeployed('IdentityStorage') && - hre.helpers.contractDeployments.contracts['IdentityStorage'].version.startsWith('2.') + (hre.helpers.contractDeployments.contracts['IdentityStorage'].version === undefined || + hre.helpers.contractDeployments.contracts['IdentityStorage'].version?.startsWith('2.')) ) { return; } diff --git a/deploy/019_deploy_content_asset_storage_v2.ts b/deploy/019_deploy_content_asset_storage_v2.ts index 9417abb4..02e1cb95 100644 --- a/deploy/019_deploy_content_asset_storage_v2.ts +++ b/deploy/019_deploy_content_asset_storage_v2.ts @@ -4,7 +4,8 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { if ( hre.helpers.isDeployed('ContentAssetStorage') && - hre.helpers.contractDeployments.contracts['ContentAssetStorage'].version.startsWith('1.') + (hre.helpers.contractDeployments.contracts['ContentAssetStorage'].version === undefined || + hre.helpers.contractDeployments.contracts['ContentAssetStorage'].version?.startsWith('1.')) ) { return; } diff --git a/deploy/020_deploy_content_asset_storage.ts b/deploy/020_deploy_content_asset_storage.ts index 555734c9..af8aeca2 100644 --- a/deploy/020_deploy_content_asset_storage.ts +++ b/deploy/020_deploy_content_asset_storage.ts @@ -4,7 +4,8 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'; const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { if ( hre.helpers.isDeployed('ContentAssetStorage') && - hre.helpers.contractDeployments.contracts['ContentAssetStorage'].version.startsWith('2.') + (hre.helpers.contractDeployments.contracts['ContentAssetStorage'].version === undefined || + hre.helpers.contractDeployments.contracts['ContentAssetStorage'].version?.startsWith('2.')) ) { return; } diff --git a/hardhat.config.ts b/hardhat.config.ts index fbbefcb7..2ba99599 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -62,17 +62,24 @@ config.networks = { accounts: accounts('otp_mainnet'), saveDeployments: false, }, - gno_chiado: { + gnosis_chiado_dev: { chainId: 10200, - url: rpc('gno_chiado'), + url: rpc('gnosis_chiado_dev'), gasPrice: 1_000_000_000, - accounts: accounts('gno_chiado'), + accounts: accounts('gnosis_chiado_dev'), saveDeployments: false, }, - gno_mainnet: { + gnosis_chiado_test: { + chainId: 10200, + url: rpc('gnosis_chiado_test'), + gasPrice: 1_000_000_000, + accounts: accounts('gnosis_chiado_test'), + saveDeployments: false, + }, + gnosis_mainnet: { chainId: 100, - url: rpc('gno_mainnet'), - accounts: accounts('gno_mainnet'), + url: rpc('gnosis_mainnet'), + accounts: accounts('gnosis_mainnet'), saveDeployments: false, }, }; diff --git a/package.json b/package.json index 76c9b366..44485cd2 100644 --- a/package.json +++ b/package.json @@ -80,16 +80,18 @@ "compile:size": "hardhat size-contracts", "compile": "hardhat compile --config hardhat.node.config.ts", "coverage": "cross-env COVERAGE_REPORT=true HARDHAT_DEPLOY_FIXTURE=true hardhat coverage --network hardhat --solcoverjs ./.solcover.js --temp artifacts --testfiles './test/**/*.test.ts'", - "deploy:v1:gno_chiado": "hardhat deploy --network gno_chiado --tags v1", - "deploy:v1:gno_mainnet": "hardhat deploy --network gno_mainnet --tags v1", + "deploy:v1:gnosis_chiado_dev": "hardhat deploy --network gnosis_chiado_dev --tags v1", + "deploy:v1:gnosis_chiado_test": "hardhat deploy --network gnosis_chiado_test --tags v1", + "deploy:v1:gnosis_mainnet": "hardhat deploy --network gnosis_mainnet --tags v1", "deploy:v1:localhost": "hardhat deploy --network hardhat --tags v1", "deploy:v1:otp_alphanet": "hardhat deploy --network otp_alphanet --tags v1", "deploy:v1:otp_devnet": "hardhat deploy --network otp_devnet --tags v1", "deploy:v1:otp_mainnet": "hardhat deploy --network otp_mainnet --tags v1", "deploy:v1:otp_testnet": "hardhat deploy --network otp_testnet --tags v1", "deploy:v1": "hardhat deploy --tags v1", - "deploy:v2:gno_chiado": "hardhat deploy --network gno_chiado --tags v1,v2", - "deploy:v2:gno_mainnet": "hardhat deploy --network gno_mainnet --tags v1,v2", + "deploy:v2:gnosis_chiado_dev": "hardhat deploy --network gnosis_chiado_dev --tags v1,v2", + "deploy:v2:gnosis_chiado_test": "hardhat deploy --network gnosis_chiado_test --tags v1,v2", + "deploy:v2:gnosis_mainnet": "hardhat deploy --network gnosis_mainnet --tags v1,v2", "deploy:v2:localhost": "hardhat deploy --network hardhat --tags v1,v2", "deploy:v2:otp_alphanet": "hardhat deploy --network otp_alphanet --tags v1,v2", "deploy:v2:otp_devnet": "hardhat deploy --network otp_devnet --tags v1,v2",