From 25438dd7c71142cc98fc9f0d2cc67ba39ac362f1 Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Fri, 17 May 2024 11:50:32 -0700 Subject: [PATCH] Use SEPOLIA_RPC_URL instead of ACLHEMY_API_KEY --- README.md | 16 +++++++-------- packages/foundry/.env.example | 2 +- packages/foundry/foundry.toml | 20 +------------------ .../foundry/script/DeployFactoryAndPool.s.sol | 2 +- .../nextjs/contracts/deployedContracts.ts | 6 +++--- 5 files changed, 14 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 101a1952..1281147c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Let's outline what this repo provides in more detail: 👀 Watch this video to quickly get started with the full stack development environment 👇 -[![Getting Started Demo](https://github.com/Dev-Rel-as-a-Service/scaffold-balancer-v3/assets/73561520/ad988ac7-67a6-4dd4-8e12-18c2be2773ea)](https://www.loom.com/share/31cabf0568a845abadcbdbb0df416b20?sid=9b1176c7-5ee4-4feb-8b6e-c971721440a0) +[![Getting Started Demo](https://github.com/Dev-Rel-as-a-Service/scaffold-balancer-v3/assets/73561520/ad988ac7-67a6-4dd4-8e12-18c2be2773ea)](https://www.loom.com/share/31cabf0568a845abadcbdbb0df416b20?sid=9b1176c7-5ee4-4feb-8b6e-c971721440a0) 👀 Watch this video to get better acquainted with the smart contracts 👇 @@ -76,15 +76,15 @@ yarn install #### 0.2.2 Set Environment Variables -Set a `DEPLOYER_PRIVATE_KEY`, referred to as 'DEPLOYER' throughout this README, `ALCHEMY_API_KEY`, and `ETHERSCAN_API_KEY` at the path `packagages/foundry/.env` +Set the following environment variables in a `packagages/foundry/.env` file + ``` DEPLOYER_PRIVATE_KEY=0x... ETHERSCAN_API_KEY=... -ALCHEMY_API_KEY=... +SEPOLIA_RPC_URL=... ``` -- The `DEPLOYER_PRIVATE_KEY` needs to start with 0x and will be referred to as 'DEPLOYER' throughout this README -- The `ETHERSCAN_API_KEY` is used to conveniently verify contracts from the command line with `yarn verify` -- The `ALCHEMY_API_KEY` is used to power a bunch of rpc url aliases in the `foundry.toml` + +The `DEPLOYER_PRIVATE_KEY` must start with `0x` and will be referred to as 'DEPLOYER' throughout this README. The `ETHERSCAN_API_KEY` is used to conveniently verify contracts from the command line with `yarn verify` #### 0.2.3 Start Local Fork @@ -401,7 +401,7 @@ This section will walk you through: ## 🏭 3.1: Creating the Custom Pool Factory -We will focus on creating the `CustomPoolFactoryExample.sol` contract. Let's focus on the constructor first. +We will focus on creating the `CustomPoolFactoryExample.sol` contract. Let's focus on the constructor first. Listed here for easy reference, the constructor discussed can also be found [here](https://github.com/Dev-Rel-as-a-Service/scaffold-balancer-v3/blob/1bb9e662e1f94bba7f30b7ad2a50bcee17ad9232/packages/foundry/contracts/CustomPoolFactoryExample.sol#L22). @@ -562,7 +562,7 @@ Cool, now we have these gotcha's understood with the script. We can move on to s As seen in the beginning of this [README](#024-deploy-contracts), this repo comes with bash commands to deploy the discussed smart contracts on a local anvil fork of the Sepolia test network. For quick reference, here are the commands again: -> If you would like to change the network the local node is forking, [review this section.](https://github.com/Dev-Rel-as-a-Service/scaffold-balancer-v3/tree/dev#:~:text=0.3.4%20Changing%20The%20Frontend%20Network%20Connection) +> If you would like to change the network the local node is forking, [review this section.](https://github.com/Dev-Rel-as-a-Service/scaffold-balancer-v3/tree/dev#:~:text=0.3.4%20Changing%20The%20Frontend%20Network%20Connection) To simulate deployment transactions on your local fork diff --git a/packages/foundry/.env.example b/packages/foundry/.env.example index 7fe93e38..e25d4a5f 100644 --- a/packages/foundry/.env.example +++ b/packages/foundry/.env.example @@ -1,3 +1,3 @@ DEPLOYER_PRIVATE_KEY= ETHERSCAN_API_KEY= -ALCHEMY_API_KEY= \ No newline at end of file +SEPOLIA_RPC_URL= \ No newline at end of file diff --git a/packages/foundry/foundry.toml b/packages/foundry/foundry.toml index 96b20979..c8fdddef 100644 --- a/packages/foundry/foundry.toml +++ b/packages/foundry/foundry.toml @@ -15,25 +15,7 @@ fs_permissions = [{ access = "read-write", path = "./"}] # SE-2 default to allow [rpc_endpoints] default_network = "http://127.0.0.1:8545" localhost = "http://127.0.0.1:8545" -mainnet = "https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_API_KEY}" -sepolia = "https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -arbitrum = "https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -arbitrumSepolia = "https://arb-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -optimism = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -optimismSepolia = "https://opt-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -polygon = "https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -polygonMumbai = "https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -gnosis = "https://rpc.gnosischain.com" -chiado = "https://rpc.chiadochain.net" -base = "https://mainnet.base.org" -baseGoerli = "https://goerli.base.org" -baseSepolia = "https://sepolia.base.org" -polygonZkEvm = "https://polygonzkevm-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -polygonZkEvmTestnet = "https://polygonzkevm-testnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -zkSyncTestnet = "https://testnet.era.zksync.dev" -zkSync = "https://mainnet.era.zksync.io" -scrollSepolia = "https://sepolia-rpc.scroll.io" -scroll = "https://rpc.scroll.io" +sepolia = "${SEPOLIA_RPC_URL}" [etherscan] diff --git a/packages/foundry/script/DeployFactoryAndPool.s.sol b/packages/foundry/script/DeployFactoryAndPool.s.sol index 2ea37925..a15121c2 100644 --- a/packages/foundry/script/DeployFactoryAndPool.s.sol +++ b/packages/foundry/script/DeployFactoryAndPool.s.sol @@ -28,7 +28,7 @@ contract DeployFactoryAndPool is ScaffoldETHDeploy, DeployPool { ); } - // Deploy mock tokens. Remove this if using already deployed tokens and instead set the tokens above + // Deploy mock tokens. Remove this if using already deployed tokens vm.startBroadcast(deployerPrivateKey); (address mockToken1, address mockToken2) = deployMockTokens(); vm.stopBroadcast(); diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 34f0bb07..244afd55 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; const deployedContracts = { 31337: { MockToken1: { - address: "0x63bD53efc26cdA2cA9d7101cDB26e8808bFE95a9", + address: "0xC7A49f9D6A7AcD951f604e7838C51B451b5244f2", abi: [ { type: "constructor", @@ -360,7 +360,7 @@ const deployedContracts = { }, }, MockToken2: { - address: "0x8400A3A4CFdF3dDC12Ba45bA3DAE3381D206EC5e", + address: "0x579bB3a775c831526D5E94EF9ccd6601F62790Bc", abi: [ { type: "constructor", @@ -713,7 +713,7 @@ const deployedContracts = { }, }, CustomPoolFactoryExample: { - address: "0xA253c3212628FE3E380a042Cc2Ac57c0bdebadd4", + address: "0x3626DEff4AFB3Acd8f217288cd33FBE3a337Ce0B", abi: [ { type: "constructor",