From f2393b3542fefe58c3ae561b8cf604364a373ec0 Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 12:29:27 +0100 Subject: [PATCH 1/9] feat: update the env example --- .env.example | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index d277cd52..259bfa4b 100644 --- a/.env.example +++ b/.env.example @@ -1,16 +1,15 @@ # GENERAL ## The network used for testing purposes -NETWORK_NAME="sepolia" # ["mainnet", "sepolia", "polygon", "polygonMumbai", "base", "baseSepolia", "arbitrum", "arbitrumSepolia"] +NETWORK_NAME="sepolia" # ["mainnet", "sepolia", "polygon", "mumbai","baseMainnet", "baseGoerli", "baseSepolia", "arbitrum", "arbitrumSepolia"] # CONTRACTS ## One or multiple hex encoded private keys separated by commas `,` replacing the hardhat default accounts. PRIVATE_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" # Default hardhat account 0 private key. DON'T USE FOR DEPLOYMENTS -## Infura credentials -INFURA_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" - +## Alchemy RPC endpoint credentials +ALCHEMY_API_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" ## Gas Reporting REPORT_GAS='true' COINMARKETCAP_API_KEY="zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz" From 261ad00fe82622d7253a291559f7bc958423c569 Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 12:30:15 +0100 Subject: [PATCH 2/9] feat: set new rpc api keys in the workflows --- .github/workflows/contracts-tests.yml | 4 ++-- .github/workflows/subgraph-tests.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/contracts-tests.yml b/.github/workflows/contracts-tests.yml index 2a488102..fb411d46 100644 --- a/.github/workflows/contracts-tests.yml +++ b/.github/workflows/contracts-tests.yml @@ -31,9 +31,9 @@ jobs: - name: 'Build the contracts' run: 'yarn build' env: - INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} + ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} - name: 'Test the contracts and generate the coverage report' run: 'yarn coverage' env: - INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} + ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} diff --git a/.github/workflows/subgraph-tests.yml b/.github/workflows/subgraph-tests.yml index a5b62efb..ef013b86 100644 --- a/.github/workflows/subgraph-tests.yml +++ b/.github/workflows/subgraph-tests.yml @@ -41,7 +41,7 @@ jobs: working-directory: packages/subgraph env: SUBGRAPH_NETWORK_NAME: ${{ vars.SUBGRAPH_NETWORK_NAME }} - INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }} + ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} - name: 'Test the subgraph' run: yarn test From 7f1451a5c091788453b0e709734c7d2408bfc4bd Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 12:31:39 +0100 Subject: [PATCH 3/9] feat: update the package version --- packages/contracts/package.json | 2 +- packages/contracts/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/contracts/package.json b/packages/contracts/package.json index f5e9e1e8..4122a1ab 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -19,7 +19,7 @@ "@openzeppelin/contracts-upgradeable": "^4.9.5" }, "devDependencies": { - "@aragon/osx-commons-configs": "0.1.0", + "@aragon/osx-commons-configs": "0.4.0", "@aragon/osx-ethers": "1.4.0-alpha.0", "@aragon/osx-commons-sdk": "0.0.1-alpha.5", "@aragon/osx-v1.0.0": "npm:@aragon/osx@1.0.1", diff --git a/packages/contracts/yarn.lock b/packages/contracts/yarn.lock index f518f178..69a9628c 100644 --- a/packages/contracts/yarn.lock +++ b/packages/contracts/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@aragon/osx-artifacts/-/osx-artifacts-1.3.1.tgz#68fa04844086a92d74351df2e9392ade3c8696dc" integrity sha512-u6IFP8fQZIS65Ks5Sl1DKlw8Qp9s5I7DSn9n/odQohWnN65A17HwHaCPTEcXl2AL3r71rFawldQ8i5/2yU3UGA== -"@aragon/osx-commons-configs@0.1.0": - version "0.1.0" - resolved "https://registry.yarnpkg.com/@aragon/osx-commons-configs/-/osx-commons-configs-0.1.0.tgz#21bbc5a964eb144e30033a44cc352d35c62982f9" - integrity sha512-qTs/loihwqALBGmhZngORb+p7pjuQJY5UEd8TLNiEW/BGHEpAJPp4GeQu7GSnigRGEKWpPD5W96kfEsaPtLkuQ== +"@aragon/osx-commons-configs@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@aragon/osx-commons-configs/-/osx-commons-configs-0.4.0.tgz#5b6ae025de1ccf7f9a135bfbcb0aa822c774acf9" + integrity sha512-/2wIQCbv/spMRdOjRXK0RrXG1TK5aMcbD73RvMgMwQwSrKcA1dCntUuSxmTm2W8eEtOzs8E1VPjqZk0cXL4SSQ== dependencies: tslib "^2.6.2" From 4ca63e8209b7d26af2319721031a8723bf70ad76 Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 12:37:06 +0100 Subject: [PATCH 4/9] feat: updating the hardhat config --- packages/contracts/hardhat.config.ts | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/packages/contracts/hardhat.config.ts b/packages/contracts/hardhat.config.ts index b0a5a67e..b7b6e59d 100644 --- a/packages/contracts/hardhat.config.ts +++ b/packages/contracts/hardhat.config.ts @@ -1,7 +1,6 @@ import { - NetworkConfigs, - NetworkConfig, - networks, + addRpcUrlToNetwork, + networks as osxCommonsConfigNetworks, SupportedNetworks, } from '@aragon/osx-commons-configs'; import '@nomicfoundation/hardhat-chai-matchers'; @@ -20,12 +19,16 @@ import { } from 'hardhat/types'; import {resolve} from 'path'; import 'solidity-coverage'; +import type {NetworkUserConfig} from 'hardhat/types'; const dotenvConfigPath: string = process.env.DOTENV_CONFIG_PATH || '../../.env'; dotenvConfig({path: resolve(__dirname, dotenvConfigPath), override: true}); -if (!process.env.INFURA_API_KEY) { - throw new Error('INFURA_API_KEY in .env not set'); +// check alchemy Api key existence +if (process.env.ALCHEMY_API_KEY) { + addRpcUrlToNetwork(process.env.ALCHEMY_API_KEY); +} else { + throw new Error('ALCHEMY_API_KEY in .env not set'); } // Fetch the accounts specified in the .env file @@ -67,15 +70,11 @@ function getHardhatNetworkAccountsConfig( return accountsConfig; } -type HardhatNetworksExtension = NetworkConfig & { - accounts?: string[]; -}; - // Add the accounts specified in the `.env` file to the networks from osx-commons-configs -const osxCommonsConfigNetworks: NetworkConfigs = - networks; +const networks: {[index: string]: NetworkUserConfig} = osxCommonsConfigNetworks; + for (const network of Object.keys(networks) as SupportedNetworks[]) { - osxCommonsConfigNetworks[network].accounts = specifiedAccounts(); + networks[network].accounts = specifiedAccounts(); } // Extend HardhatRuntimeEnvironment @@ -110,7 +109,7 @@ const config: HardhatUserConfig = { Object.keys(namedAccounts).length ), }, - ...osxCommonsConfigNetworks, + ...networks, }, defaultNetwork: 'hardhat', From a6bcb2f30f1528d11e5d45cdf3f5d88c9ed8fbce Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 12:43:45 +0100 Subject: [PATCH 5/9] feat: change the accounts balance --- packages/contracts/hardhat.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/contracts/hardhat.config.ts b/packages/contracts/hardhat.config.ts index b7b6e59d..75ebc5f0 100644 --- a/packages/contracts/hardhat.config.ts +++ b/packages/contracts/hardhat.config.ts @@ -59,10 +59,10 @@ function getHardhatNetworkAccountsConfig( const accountsConfig: HardhatNetworkAccountsUserConfig = accounts.map( privateKey => { - const oneEther = BigNumber.from(10).pow(18); + const balance = BigNumber.from(1_000_000).pow(18).toString(); return { privateKey, - balance: oneEther.mul(1000).toString(), + balance, }; } ); From c387f6a72923fb832bb87c4cb745ffd05abd9869 Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 12:44:53 +0100 Subject: [PATCH 6/9] feat: update commons config version in subgraph --- packages/subgraph/package.json | 2 +- packages/subgraph/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/subgraph/package.json b/packages/subgraph/package.json index c00bb5cb..3fb8e0db 100644 --- a/packages/subgraph/package.json +++ b/packages/subgraph/package.json @@ -24,7 +24,7 @@ "matchstick-as": "^0.5.2", "mustache": "^4.2.0", "@aragon/osx-ethers": "1.4.0-alpha.0", - "@aragon/osx-commons-configs": "0.2.0", + "@aragon/osx-commons-configs": "0.4.0", "ts-morph": "^17.0.1", "ts-node": "^10.9.1", "typescript": "^5.2.2" diff --git a/packages/subgraph/yarn.lock b/packages/subgraph/yarn.lock index e209c607..7d11039e 100644 --- a/packages/subgraph/yarn.lock +++ b/packages/subgraph/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@aragon/osx-commons-configs@0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@aragon/osx-commons-configs/-/osx-commons-configs-0.2.0.tgz#32f83596f4a2e9e48aef61cf560c1c5b4d32a049" - integrity sha512-wCFtgmuGCzs8L5mCxVCYQ6uEu69IrofS7q2w7E1Fjk7/nWuSmRUpgmif3ki9BQq1qpOvDu2P+u3UNLnIz8J82g== +"@aragon/osx-commons-configs@0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@aragon/osx-commons-configs/-/osx-commons-configs-0.4.0.tgz#5b6ae025de1ccf7f9a135bfbcb0aa822c774acf9" + integrity sha512-/2wIQCbv/spMRdOjRXK0RrXG1TK5aMcbD73RvMgMwQwSrKcA1dCntUuSxmTm2W8eEtOzs8E1VPjqZk0cXL4SSQ== dependencies: tslib "^2.6.2" From 5d5da625a030c6cd7f4a66c7f22b464269de6a4d Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 12:58:46 +0100 Subject: [PATCH 7/9] fix: change account balance --- packages/contracts/hardhat.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/contracts/hardhat.config.ts b/packages/contracts/hardhat.config.ts index 75ebc5f0..6d34948f 100644 --- a/packages/contracts/hardhat.config.ts +++ b/packages/contracts/hardhat.config.ts @@ -59,10 +59,10 @@ function getHardhatNetworkAccountsConfig( const accountsConfig: HardhatNetworkAccountsUserConfig = accounts.map( privateKey => { - const balance = BigNumber.from(1_000_000).pow(18).toString(); + const hundredEther = BigNumber.from(100).pow(18); return { privateKey, - balance, + balance: hundredEther.mul(1000).toString(), }; } ); From ba92d319a6a0328c0ccfc02dbae71fcb91d785af Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 13:01:02 +0100 Subject: [PATCH 8/9] ci: update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b68ad004..6fa7fea9 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ yarn lint To be able to work on the contracts, make sure that you have created an `.env` file from the `.env.example` file and put in the API keys for -- [Infura](https://www.infura.io/) that we use as the web3 provider +- [Alchemy](https://www.alchemy.com) that we use as the web3 provider - [Alchemy Subgraphs](https://www.alchemy.com/subgraphs) that we use as the subgraph provider - the block explorer that you want to use depending on the networks that you want to deploy to From 5ce3d511cc5e2cdb09239795a2acaabd743d5c17 Mon Sep 17 00:00:00 2001 From: Claudia Date: Thu, 14 Mar 2024 13:08:09 +0100 Subject: [PATCH 9/9] fix: prettier --- packages/contracts/hardhat.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/contracts/hardhat.config.ts b/packages/contracts/hardhat.config.ts index 6d34948f..68c3485d 100644 --- a/packages/contracts/hardhat.config.ts +++ b/packages/contracts/hardhat.config.ts @@ -17,9 +17,9 @@ import { HardhatNetworkAccountsUserConfig, HardhatRuntimeEnvironment, } from 'hardhat/types'; +import type {NetworkUserConfig} from 'hardhat/types'; import {resolve} from 'path'; import 'solidity-coverage'; -import type {NetworkUserConfig} from 'hardhat/types'; const dotenvConfigPath: string = process.env.DOTENV_CONFIG_PATH || '../../.env'; dotenvConfig({path: resolve(__dirname, dotenvConfigPath), override: true});