From d02a085148ff841b35402f5c089cb510a3e95d78 Mon Sep 17 00:00:00 2001 From: Matthew Pereira Date: Mon, 16 Dec 2024 15:07:05 -0800 Subject: [PATCH] fix default foundry network --- README.md | 4 ++-- packages/foundry/foundry.toml | 2 +- packages/foundry/script/PoolHelpers.sol | 7 ++++--- packages/nextjs/contracts/deployedContracts.ts | 18 +++++++++--------- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6c711fef..91662d25 100644 --- a/README.md +++ b/README.md @@ -55,14 +55,14 @@ GNOSIS_RPC_URL= ``` 4. Start a local anvil fork of Ethereum mainnet - > To fork gnosis: + > By default, this project is setup to fork Ethereum mainnet. However, you can fork another network by following these steps: > > 1. Change `targetFork` in `scaffold.config.ts` to `chains.gnosis` > 2. Make sure the right addresses are un-commented in `PoolHelpers.sol` > 3. Run `yarn fork --network gnosis` ```bash -yarn fork --network mainnet +yarn fork ``` 1. Deploy the mock tokens, pool factories, pool hooks, and custom pools contracts diff --git a/packages/foundry/foundry.toml b/packages/foundry/foundry.toml index 8e03409a..6cfc1d58 100644 --- a/packages/foundry/foundry.toml +++ b/packages/foundry/foundry.toml @@ -12,7 +12,7 @@ fs_permissions = [{ access = "read-write", path = "./"}] # SE-2 default to allow [rpc_endpoints] -default_network = "http://127.0.0.1:8545" +default_network = "${MAINNET_RPC_URL}" localhost = "http://127.0.0.1:8545" sepolia = "${SEPOLIA_RPC_URL}" mainnet = "${MAINNET_RPC_URL}" diff --git a/packages/foundry/script/PoolHelpers.sol b/packages/foundry/script/PoolHelpers.sol index 5e843480..6594ddb4 100644 --- a/packages/foundry/script/PoolHelpers.sol +++ b/packages/foundry/script/PoolHelpers.sol @@ -17,11 +17,12 @@ import { console } from "forge-std/Script.sol"; /** * @title Pool Helpers * @notice Helpful addresses,functions, and types for deploying pools on Balancer v3 - * @dev the block.chainid will always be 31337 when deploying to local anvil fork + * @dev Since the block.chainid will always be 31337 when deploying to local anvil fork, + * if you wish to fork another network, uncomment the relevant addresses below */ contract PoolHelpers { - // Same on all chains - IPermit2 internal permit2 = IPermit2(0x000000000022D473030F116dDEE9F6B43aC78BA3); // same on all chains + // Same address on all chains + IPermit2 internal permit2 = IPermit2(0x000000000022D473030F116dDEE9F6B43aC78BA3); IVault internal vault = IVault(0xbA1333333333a1BA1108E8412f11850A5C319bA9); // Mainnet diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index a5135be6..5a27ea52 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: "0x5147c5c1cb5b5d3f56186c37a4bcfbb3cd0bd5a7", + address: "0xf2cb3cfa36bfb95e0fd855c1b41ab19c517fcdb9", abi: [ { type: "constructor", @@ -365,7 +365,7 @@ const deployedContracts = { }, }, MockToken2: { - address: "0xf2cb3cfa36bfb95e0fd855c1b41ab19c517fcdb9", + address: "0xc3549920b94a795d75e6c003944943d552c46f97", abi: [ { type: "constructor", @@ -723,7 +723,7 @@ const deployedContracts = { }, }, MockVeBAL: { - address: "0xc3549920b94a795d75e6c003944943d552c46f97", + address: "0xab8eb9f37bd460df99b11767aa843a8f27fb7a6e", abi: [ { type: "constructor", @@ -1081,7 +1081,7 @@ const deployedContracts = { }, }, ConstantSumFactory: { - address: "0xab8eb9f37bd460df99b11767aa843a8f27fb7a6e", + address: "0x205cfc23ef26922e116135500abb4b12ab6d4668", abi: [ { type: "constructor", @@ -1554,7 +1554,7 @@ const deployedContracts = { }, }, VeBALFeeDiscountHookExample: { - address: "0x205cfc23ef26922e116135500abb4b12ab6d4668", + address: "0xbb57fe325e769dedb1236525a91cded842143fa7", abi: [ { type: "constructor", @@ -2264,7 +2264,7 @@ const deployedContracts = { }, }, ConstantProductFactory: { - address: "0x87e8f332f34984728da4c0a008a495a5ec4e09a2", + address: "0x53e4daff2073f848dc3f7a8d7cc95b3607212a73", abi: [ { type: "constructor", @@ -2737,7 +2737,7 @@ const deployedContracts = { }, }, LotteryHookExample: { - address: "0x53e4daff2073f848dc3f7a8d7cc95b3607212a73", + address: "0x1e2e9190cea3a97b5aa85d9757117f499d31c47d", abi: [ { type: "constructor", @@ -3691,7 +3691,7 @@ const deployedContracts = { }, }, WeightedPoolFactory: { - address: "0x64386bc53c213f23c6960d3e080139a0f9ef1733", + address: "0x4a65b9d13908487a1654be48e6aa9bc701735910", abi: [ { type: "constructor", @@ -4185,7 +4185,7 @@ const deployedContracts = { }, }, ExitFeeHookExample: { - address: "0x4a65b9d13908487a1654be48e6aa9bc701735910", + address: "0x295129609d6876f5ecc62052ba6bc082139a982c", abi: [ { type: "constructor",