Skip to content

Commit

Permalink
fix default foundry network
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPereira committed Dec 16, 2024
1 parent daa7e41 commit d02a085
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/foundry/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
7 changes: 4 additions & 3 deletions packages/foundry/script/PoolHelpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";
const deployedContracts = {
31337: {
MockToken1: {
address: "0x5147c5c1cb5b5d3f56186c37a4bcfbb3cd0bd5a7",
address: "0xf2cb3cfa36bfb95e0fd855c1b41ab19c517fcdb9",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -365,7 +365,7 @@ const deployedContracts = {
},
},
MockToken2: {
address: "0xf2cb3cfa36bfb95e0fd855c1b41ab19c517fcdb9",
address: "0xc3549920b94a795d75e6c003944943d552c46f97",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -723,7 +723,7 @@ const deployedContracts = {
},
},
MockVeBAL: {
address: "0xc3549920b94a795d75e6c003944943d552c46f97",
address: "0xab8eb9f37bd460df99b11767aa843a8f27fb7a6e",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -1081,7 +1081,7 @@ const deployedContracts = {
},
},
ConstantSumFactory: {
address: "0xab8eb9f37bd460df99b11767aa843a8f27fb7a6e",
address: "0x205cfc23ef26922e116135500abb4b12ab6d4668",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -1554,7 +1554,7 @@ const deployedContracts = {
},
},
VeBALFeeDiscountHookExample: {
address: "0x205cfc23ef26922e116135500abb4b12ab6d4668",
address: "0xbb57fe325e769dedb1236525a91cded842143fa7",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -2264,7 +2264,7 @@ const deployedContracts = {
},
},
ConstantProductFactory: {
address: "0x87e8f332f34984728da4c0a008a495a5ec4e09a2",
address: "0x53e4daff2073f848dc3f7a8d7cc95b3607212a73",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -2737,7 +2737,7 @@ const deployedContracts = {
},
},
LotteryHookExample: {
address: "0x53e4daff2073f848dc3f7a8d7cc95b3607212a73",
address: "0x1e2e9190cea3a97b5aa85d9757117f499d31c47d",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -3691,7 +3691,7 @@ const deployedContracts = {
},
},
WeightedPoolFactory: {
address: "0x64386bc53c213f23c6960d3e080139a0f9ef1733",
address: "0x4a65b9d13908487a1654be48e6aa9bc701735910",
abi: [
{
type: "constructor",
Expand Down Expand Up @@ -4185,7 +4185,7 @@ const deployedContracts = {
},
},
ExitFeeHookExample: {
address: "0x4a65b9d13908487a1654be48e6aa9bc701735910",
address: "0x295129609d6876f5ecc62052ba6bc082139a982c",
abi: [
{
type: "constructor",
Expand Down

0 comments on commit d02a085

Please sign in to comment.