From 94e4d6b8bb14deed2e39e918d8f718ab22f33ed3 Mon Sep 17 00:00:00 2001 From: Carter Carlson Date: Wed, 28 Feb 2024 15:09:19 -0800 Subject: [PATCH 1/3] feat: fraxtal test/deploy support --- .env.EXAMPLE | 8 ++- README.md | 13 +++-- foundry.toml | 4 +- package.json | 2 +- scripts/constants/fraxtal-deployments.ts | 3 - scripts/constants/fraxtal-l1.ts | 12 ++++ .../{fraxtal-mainnet.ts => fraxtal-l2.ts} | 5 +- scripts/constants/fraxtal-standard-proxies.ts | 2 + scripts/constants/fraxtal-testnet-l1.ts | 12 ++++ ...axtal-testnet.ts => fraxtal-testnet-l2.ts} | 5 +- scripts/constants/holesky.ts | 2 + scripts/constants/index.ts | 7 ++- scripts/constants/mainnet.ts | 2 + scripts/generateConstants.ts | 12 ++-- src/Constants.sol | 57 ++++++++++++++----- src/test/BaseTest.t.sol | 53 +++++++++++++++++ 16 files changed, 160 insertions(+), 39 deletions(-) delete mode 100644 scripts/constants/fraxtal-deployments.ts create mode 100644 scripts/constants/fraxtal-l1.ts rename scripts/constants/{fraxtal-mainnet.ts => fraxtal-l2.ts} (94%) create mode 100644 scripts/constants/fraxtal-testnet-l1.ts rename scripts/constants/{fraxtal-testnet.ts => fraxtal-testnet-l2.ts} (93%) diff --git a/.env.EXAMPLE b/.env.EXAMPLE index a534ddf..369bce8 100644 --- a/.env.EXAMPLE +++ b/.env.EXAMPLE @@ -8,6 +8,8 @@ POLYGON_RPC_URL=https://polygon-mainnet.g.alchemy.com/v2/{$INSERT_KEY_HERE} POLYGONSCAN_API_URL=https://api.polygonscan.com/api POLYGONSCAN_API_KEY={$INSERT_KEY_HERE} -FRAXTAL_RPC_URL={$INSERT_URL_HERE} -FRAXTAL_API_URL=https://api.fraxscan.com/api -FRAXTAL_API_KEY={$INSERT_KEY_HERE} \ No newline at end of file +FRAXTAL_RPC_URL=https://rpc.frax.com +FRAXTAL_TESTNET_RPC_URL=https://rpc.testnet.frax.com +FRAXSCAN_API_URL=https://api.fraxscan.com/api +FRAXSCAN_TESTNET_API_URL=https://api-holesky.fraxscan.com/api +FRAXSCAN_API_KEY={$INSERT_KEY_HERE} \ No newline at end of file diff --git a/README.md b/README.md index 15833ac..d682b06 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,14 @@ To easily execute specific foundry profiles like `profile test forge test -w` `profile test forge test -vvv` show stack traces for failed tests ## Deploy -- Update environment variables - - If deploying to networks other than mainnet/polygon, also update the bottom of `foundry.toml` -- Edit `package.json` scripts of `deploy` to your desired configuration - - NOTE: to dry-run only, remove all flags after `-vvvv` +- Update environment variables where needed - `source .env` -- `npm run deploy:{network}` - +``` +`forge script src/script/{ScriptName}.s.sol \ + --rpc-url ${mainnet || fraxtal || fraxtal_testnet || polygon} \ + --etherscan-api-key {$ETHERSCAN_API_KEY || FRAXSCAN_API_KEY || POLYGONSCAN_API_KEY} \ + --broadcast --verify --watch +``` ## Tooling This repo uses the following tools: diff --git a/foundry.toml b/foundry.toml index cdc3184..b2a2850 100644 --- a/foundry.toml +++ b/foundry.toml @@ -71,8 +71,10 @@ number_underscore = "thousands" mainnet = "${MAINNET_RPC_URL}" polygon = "${POLYGON_RPC_URL}" fraxtal = "${FRAXTAL_RPC_URL}" +fraxtal_testnet = "${FRAXTAL_TESTNET_RPC_URL}" [etherscan] mainnet = { key = "${ETHERSCAN_API_KEY}", url = "${ETHERSCAN_API_URL}" } polygon = { key = "${POLYGONSCAN_API_KEY}", url = "${POLYGONSCAN_API_URL}" } -fraxtal = { key = "${FRAXTAL_API_KEY}", url = "${FRAXTAL_API_URL}", chain=252 } +fraxtal = { key = "${FRAXTAL_API_KEY}", url = "${FRAXSCAN_API_URL}", chain=252 } +fraxtal_testnet = { key = "${FRAXTAL_API_KEY}", url = "${FRAXCAN_TESTNET_API_URL}", chain=2522 } diff --git a/package.json b/package.json index 4d04da1..101f8eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frax-template", - "version": "1.1.3", + "version": "1.2.0", "description": "", "directories": { "lib": "lib", diff --git a/scripts/constants/fraxtal-deployments.ts b/scripts/constants/fraxtal-deployments.ts deleted file mode 100644 index a29dc4d..0000000 --- a/scripts/constants/fraxtal-deployments.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const DEVNET = "devnet"; -export const TESTNET = "testnet"; -export const MAINNET = "mainnet"; diff --git a/scripts/constants/fraxtal-l1.ts b/scripts/constants/fraxtal-l1.ts new file mode 100644 index 0000000..784453a --- /dev/null +++ b/scripts/constants/fraxtal-l1.ts @@ -0,0 +1,12 @@ +export const CHAIN_ID = 1; + +export const PROXY_ADMIN = "0x13Fe62cB24aEa5afd179F20D362c056c3881ABcA"; +export const COMPTROLLER = "0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27"; +export const ADDRESS_MANAGER = "0x8c5D64d10394cFa070066e70Ec19E67398b4dABE"; +export const L1_CROSS_DOMAIN_MESSENGER_PROXY = "0x126bcc31Bc076B3d515f60FBC81FddE0B0d542Ed"; +export const L1_ERC721_BRIDGE_PROXY = "0xa9B5Fb84B7aeAF0D51C95DB04a76B1D4738D0eC5"; +export const L1_STANDARD_BRIDGE_PROXY = "0x34C0bD5877A5Ee7099D0f5688D65F4bB9158BDE2"; +export const L2_OUTPUT_ORACLE_PROXY = "0x66CC916Ed5C6C2FA97014f7D1cD141528Ae171e4"; +export const OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY = "0x11FE3be54aC01C13Dd985cE2BdD10eD77e1376cc"; +export const OPTIMISM_PORTAL_PROXY = "0x36cb65c1967A0Fb0EEE11569C51C2f2aA1Ca6f6D"; +export const SYSTEM_CONFIG_PROXY = "0x34a9f273cbD847d49c3De015FC26c3E66825f8b2"; diff --git a/scripts/constants/fraxtal-mainnet.ts b/scripts/constants/fraxtal-l2.ts similarity index 94% rename from scripts/constants/fraxtal-mainnet.ts rename to scripts/constants/fraxtal-l2.ts index d0078f3..a5fdb55 100644 --- a/scripts/constants/fraxtal-mainnet.ts +++ b/scripts/constants/fraxtal-l2.ts @@ -1,4 +1,7 @@ +export const CHAIN_ID = 252; + export const PROXY_ADMIN = "0xfC00000000000000000000000000000000000009"; +export const COMPTROLLER = "0xC4EB45d80DC1F079045E75D5d55de8eD1c1090E6"; // Fraxswap-specific export const FRAXSWAP_FACTORY = "0x7a07D606c87b7251c2953A30Fa445d8c5F856C7A"; @@ -6,5 +9,3 @@ export const FRAXSWAP_ROUTER = "0x195843F052052c3692dAcAB049e0Bf5715a24755"; export const FRAXSWAP_ROUTER_MULTIHOP = "0x31D982ebd82Ad900358984bd049207A4c2468640"; export const OPTIMISM_MINTABLE_PERMIT_ERC20_FACTORY_IMPLEMENTATION = "0x111ddab65Af5fF96b674400246699ED40F550De1"; - -export const COMPTROLLER = "0xC4EB45d80DC1F079045E75D5d55de8eD1c1090E6"; diff --git a/scripts/constants/fraxtal-standard-proxies.ts b/scripts/constants/fraxtal-standard-proxies.ts index d7a1bd3..1ccdb7b 100644 --- a/scripts/constants/fraxtal-standard-proxies.ts +++ b/scripts/constants/fraxtal-standard-proxies.ts @@ -8,5 +8,7 @@ export const WFRXETH_PROXY = "0xFC00000000000000000000000000000000000006"; export const FRXBTC_PROXY = "0xfC00000000000000000000000000000000000007"; export const SFRAX_PROXY = "0xfc00000000000000000000000000000000000008"; +export const CROSS_DOMAIN_MESSENGER = "0x4200000000000000000000000000000000000007"; export const L2_STANDARD_BRIDGE_PROXY = "0x4200000000000000000000000000000000000010"; export const ERC20_FACTORY_PROXY = "0x4200000000000000000000000000000000000012"; +export const L2_TO_L1_MESSAGE_PASSER = "0x4200000000000000000000000000000000000016"; diff --git a/scripts/constants/fraxtal-testnet-l1.ts b/scripts/constants/fraxtal-testnet-l1.ts new file mode 100644 index 0000000..2c8bffb --- /dev/null +++ b/scripts/constants/fraxtal-testnet-l1.ts @@ -0,0 +1,12 @@ +export const CHAIN_ID = 17000; + +export const PROXY_ADMIN = "0xA0c6294D524f56fF9BdAeE94b69064c529cB9a1e"; +export const COMPTROLLER = "0x0000000000000000000000000000000000000000"; +export const ADDRESS_MANAGER = "0x6C52d1f7aAdD1F27aaa6A9e228CE0312E3CB09A6"; +export const L1_CROSS_DOMAIN_MESSENGER_PROXY = "0x45A98115D5722C6cfC48D711e0053758E7C0b8ad"; +export const L1_ERC721_BRIDGE_PROXY = "0x0301A6b26a37566d3DCebC7fC4c2143B426bBf53"; +export const L1_STANDARD_BRIDGE_PROXY = "0x0BaafC217162f64930909aD9f2B27125121d6332"; +export const L2_OUTPUT_ORACLE_PROXY = "0x715EA64DA13F4d0831ece4Ad3E8c1aa013167F32"; +export const OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY = "0x740fAfe2383F736d0Bd1a042E50fE15dDa2726C6"; +export const OPTIMISM_PORTAL_PROXY = "0xB9c64BfA498d5b9a8398Ed6f46eb76d90dE5505d"; +export const SYSTEM_CONFIG_PROXY = "0x570Bf63A187776A19a44E6D1e055E3da65C1E3Db"; diff --git a/scripts/constants/fraxtal-testnet.ts b/scripts/constants/fraxtal-testnet-l2.ts similarity index 93% rename from scripts/constants/fraxtal-testnet.ts rename to scripts/constants/fraxtal-testnet-l2.ts index 4cfb537..e17aa79 100644 --- a/scripts/constants/fraxtal-testnet.ts +++ b/scripts/constants/fraxtal-testnet-l2.ts @@ -1,8 +1,9 @@ +export const CHAIN_ID = 2522; + export const PROXY_ADMIN = "0xfC00000000000000000000000000000000000007"; +export const COMPTROLLER = "0x012fcFb933b9a4335B1BCC836e6a9a475146beBd"; // Fraxswap-specific export const FRAXSWAP_FACTORY = "0xbc679bdd1bA59654bD50DEB03fd80dC97c713fF2"; export const FRAXSWAP_ROUTER = "0x938d99A81814f66b01010d19DDce92A633441699"; export const FRAXSWAP_ROUTER_MULTIHOP = "0x509728dC748586214Fa30cEF61359f136523F24d"; - -export const COMPTROLLER = "0x012fcFb933b9a4335B1BCC836e6a9a475146beBd"; diff --git a/scripts/constants/holesky.ts b/scripts/constants/holesky.ts index 2f6e6af..7316830 100644 --- a/scripts/constants/holesky.ts +++ b/scripts/constants/holesky.ts @@ -1,3 +1,5 @@ +export const CHAIN_ID = 17000; + export const FPI_ERC20 = "0xfBCB0F967817c924f83e26e04F0FB28ED4d6276F"; export const FPIS_ERC20 = "0x0363a32D18c25a3FD19a0d00B02106C03d8b8182"; export const FRAX_ERC20 = "0x0304A365C0fbb4b1Ad423887861b9b69a5f0c00E"; diff --git a/scripts/constants/index.ts b/scripts/constants/index.ts index 3161592..9872ff0 100644 --- a/scripts/constants/index.ts +++ b/scripts/constants/index.ts @@ -1,8 +1,9 @@ export * as Mainnet from "./mainnet"; export * as Holesky from "./holesky"; -export * as FraxtalDeployment from "./fraxtal-deployments"; export * as FraxtalL1Devnet from "./fraxtal-devnet-l1"; export * as FraxtalL2Devnet from "./fraxtal-devnet-l2"; -export * as FraxtalTestnet from "./fraxtal-testnet"; -export * as FraxtalMainnet from "./fraxtal-mainnet"; +export * as FraxtalL1 from "./fraxtal-l1"; +export * as FraxtalL2 from "./fraxtal-l2"; +export * as FraxtalTestnetL1 from "./fraxtal-testnet-l1"; +export * as FraxtalTestnetL2 from "./fraxtal-testnet-l2"; export * as FraxtalStandardProxies from "./fraxtal-standard-proxies"; diff --git a/scripts/constants/mainnet.ts b/scripts/constants/mainnet.ts index 9c3c5be..9b168f1 100644 --- a/scripts/constants/mainnet.ts +++ b/scripts/constants/mainnet.ts @@ -136,3 +136,5 @@ export const ORACLE_20261231 = "0x2ec5D1C13fEF1C7029eE329a1D31B2180c9b3707"; export const CURVE_20261231_MAINNET_POOL = "0xe035e27A8eD6842b478933820f90093D205F7098"; export const CURVE_20261231_ARBITRUM_POOL = "0x946adc524BD312D036776798c46ceDD948DD0A0f"; export const CURVE_20261231_ARBITRUM_GAUGE = "0xa2617A26f9f528fa7B0E47fc2e66FcC04C6682E9"; + +export const COMPTROLLER = "0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27"; diff --git a/scripts/generateConstants.ts b/scripts/generateConstants.ts index d9bec4b..827a9ea 100644 --- a/scripts/generateConstants.ts +++ b/scripts/generateConstants.ts @@ -23,11 +23,15 @@ import { TestBase } from "forge-std/Test.sol"; async function handleSingleNetwork(networkName, constants) { const constantString = Object.entries(constants) .map(([key, value]) => { - if ((value as string).startsWith("0x")) { - return ` address internal constant ${key} = ${value};`; + if (typeof value === "string") { + if (value.startsWith("0x")) { + return ` address internal constant ${key} = ${value};`; + } + return ` string internal constant ${key} = "${value}";`; + } else { + // number + return ` uint256 internal constant ${key} = ${value};`; } - - return ` string internal constant ${key} = "${value}";`; }) .join("\n"); diff --git a/src/Constants.sol b/src/Constants.sol index ec779b8..e397135 100644 --- a/src/Constants.sol +++ b/src/Constants.sol @@ -113,6 +113,7 @@ library Mainnet { address internal constant CURVE_20261231_MAINNET_POOL = 0xe035e27A8eD6842b478933820f90093D205F7098; address internal constant CURVE_20261231_ARBITRUM_POOL = 0x946adc524BD312D036776798c46ceDD948DD0A0f; address internal constant CURVE_20261231_ARBITRUM_GAUGE = 0xa2617A26f9f528fa7B0E47fc2e66FcC04C6682E9; + address internal constant COMPTROLLER = 0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27; } abstract contract Helper is TestBase { @@ -228,10 +229,12 @@ abstract contract Helper is TestBase { vm.label(0xe035e27A8eD6842b478933820f90093D205F7098, "Constants.CURVE_20261231_MAINNET_POOL"); vm.label(0x946adc524BD312D036776798c46ceDD948DD0A0f, "Constants.CURVE_20261231_ARBITRUM_POOL"); vm.label(0xa2617A26f9f528fa7B0E47fc2e66FcC04C6682E9, "Constants.CURVE_20261231_ARBITRUM_GAUGE"); + vm.label(0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27, "Constants.COMPTROLLER"); } } library Holesky { + uint256 internal constant CHAIN_ID = 17_000; address internal constant FPI_ERC20 = 0xfBCB0F967817c924f83e26e04F0FB28ED4d6276F; address internal constant FPIS_ERC20 = 0x0363a32D18c25a3FD19a0d00B02106C03d8b8182; address internal constant FRAX_ERC20 = 0x0304A365C0fbb4b1Ad423887861b9b69a5f0c00E; @@ -241,12 +244,6 @@ library Holesky { address internal constant FRXETH_MINTER = 0x5E8422345238F34275888049021821E8E08CAa1f; } -library FraxtalDeployment { - string internal constant DEVNET = "devnet"; - string internal constant TESTNET = "testnet"; - string internal constant MAINNET = "mainnet"; -} - library FraxtalL1Devnet { address internal constant FPI_ERC20 = 0x67218f66a84809201CfBa5c8b46dBd3aB95A42da; address internal constant FPIS_ERC20 = 0xC0497C072d3015fd7D45893157bCDCC1BcfEb6b5; @@ -264,22 +261,52 @@ library FraxtalL2Devnet { address internal constant COMPTROLLER = 0x8b1E899ec5d51387a41Ee68261149F7d3Dfd7160; } -library FraxtalTestnet { - address internal constant PROXY_ADMIN = 0xfC00000000000000000000000000000000000007; - address internal constant FRAXSWAP_FACTORY = 0xbc679bdd1bA59654bD50DEB03fd80dC97c713fF2; - address internal constant FRAXSWAP_ROUTER = 0x938d99A81814f66b01010d19DDce92A633441699; - address internal constant FRAXSWAP_ROUTER_MULTIHOP = 0x509728dC748586214Fa30cEF61359f136523F24d; - address internal constant COMPTROLLER = 0x012fcFb933b9a4335B1BCC836e6a9a475146beBd; +library FraxtalL1 { + uint256 internal constant CHAIN_ID = 1; + address internal constant PROXY_ADMIN = 0x13Fe62cB24aEa5afd179F20D362c056c3881ABcA; + address internal constant COMPTROLLER = 0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27; + address internal constant ADDRESS_MANAGER = 0x8c5D64d10394cFa070066e70Ec19E67398b4dABE; + address internal constant L1_CROSS_DOMAIN_MESSENGER_PROXY = 0x126bcc31Bc076B3d515f60FBC81FddE0B0d542Ed; + address internal constant L1_ERC721_BRIDGE_PROXY = 0xa9B5Fb84B7aeAF0D51C95DB04a76B1D4738D0eC5; + address internal constant L1_STANDARD_BRIDGE_PROXY = 0x34C0bD5877A5Ee7099D0f5688D65F4bB9158BDE2; + address internal constant L2_OUTPUT_ORACLE_PROXY = 0x66CC916Ed5C6C2FA97014f7D1cD141528Ae171e4; + address internal constant OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY = 0x11FE3be54aC01C13Dd985cE2BdD10eD77e1376cc; + address internal constant OPTIMISM_PORTAL_PROXY = 0x36cb65c1967A0Fb0EEE11569C51C2f2aA1Ca6f6D; + address internal constant SYSTEM_CONFIG_PROXY = 0x34a9f273cbD847d49c3De015FC26c3E66825f8b2; } -library FraxtalMainnet { +library FraxtalL2 { + uint256 internal constant CHAIN_ID = 252; address internal constant PROXY_ADMIN = 0xfC00000000000000000000000000000000000009; + address internal constant COMPTROLLER = 0xC4EB45d80DC1F079045E75D5d55de8eD1c1090E6; address internal constant FRAXSWAP_FACTORY = 0x7a07D606c87b7251c2953A30Fa445d8c5F856C7A; address internal constant FRAXSWAP_ROUTER = 0x195843F052052c3692dAcAB049e0Bf5715a24755; address internal constant FRAXSWAP_ROUTER_MULTIHOP = 0x31D982ebd82Ad900358984bd049207A4c2468640; address internal constant OPTIMISM_MINTABLE_PERMIT_ERC20_FACTORY_IMPLEMENTATION = 0x111ddab65Af5fF96b674400246699ED40F550De1; - address internal constant COMPTROLLER = 0xC4EB45d80DC1F079045E75D5d55de8eD1c1090E6; +} + +library FraxtalTestnetL1 { + uint256 internal constant CHAIN_ID = 17_000; + address internal constant PROXY_ADMIN = 0xA0c6294D524f56fF9BdAeE94b69064c529cB9a1e; + address internal constant COMPTROLLER = 0x0000000000000000000000000000000000000000; + address internal constant ADDRESS_MANAGER = 0x6C52d1f7aAdD1F27aaa6A9e228CE0312E3CB09A6; + address internal constant L1_CROSS_DOMAIN_MESSENGER_PROXY = 0x45A98115D5722C6cfC48D711e0053758E7C0b8ad; + address internal constant L1_ERC721_BRIDGE_PROXY = 0x0301A6b26a37566d3DCebC7fC4c2143B426bBf53; + address internal constant L1_STANDARD_BRIDGE_PROXY = 0x0BaafC217162f64930909aD9f2B27125121d6332; + address internal constant L2_OUTPUT_ORACLE_PROXY = 0x715EA64DA13F4d0831ece4Ad3E8c1aa013167F32; + address internal constant OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY = 0x740fAfe2383F736d0Bd1a042E50fE15dDa2726C6; + address internal constant OPTIMISM_PORTAL_PROXY = 0xB9c64BfA498d5b9a8398Ed6f46eb76d90dE5505d; + address internal constant SYSTEM_CONFIG_PROXY = 0x570Bf63A187776A19a44E6D1e055E3da65C1E3Db; +} + +library FraxtalTestnetL2 { + uint256 internal constant CHAIN_ID = 2522; + address internal constant PROXY_ADMIN = 0xfC00000000000000000000000000000000000007; + address internal constant COMPTROLLER = 0x012fcFb933b9a4335B1BCC836e6a9a475146beBd; + address internal constant FRAXSWAP_FACTORY = 0xbc679bdd1bA59654bD50DEB03fd80dC97c713fF2; + address internal constant FRAXSWAP_ROUTER = 0x938d99A81814f66b01010d19DDce92A633441699; + address internal constant FRAXSWAP_ROUTER_MULTIHOP = 0x509728dC748586214Fa30cEF61359f136523F24d; } library FraxtalStandardProxies { @@ -291,6 +318,8 @@ library FraxtalStandardProxies { address internal constant WFRXETH_PROXY = 0xFC00000000000000000000000000000000000006; address internal constant FRXBTC_PROXY = 0xfC00000000000000000000000000000000000007; address internal constant SFRAX_PROXY = 0xfc00000000000000000000000000000000000008; + address internal constant CROSS_DOMAIN_MESSENGER = 0x4200000000000000000000000000000000000007; address internal constant L2_STANDARD_BRIDGE_PROXY = 0x4200000000000000000000000000000000000010; address internal constant ERC20_FACTORY_PROXY = 0x4200000000000000000000000000000000000012; + address internal constant L2_TO_L1_MESSAGE_PASSER = 0x4200000000000000000000000000000000000016; } diff --git a/src/test/BaseTest.t.sol b/src/test/BaseTest.t.sol index eed56c0..5755dd9 100644 --- a/src/test/BaseTest.t.sol +++ b/src/test/BaseTest.t.sol @@ -10,4 +10,57 @@ contract BaseTest is FraxTest, Constants.Helper { Counter public counter; address timelock = Constants.Mainnet.TIMELOCK_ADDRESS; + // Fraxtal / Fraxtal Testnet L1 & L2 addresses + address public PROXY_ADMIN; + address public COMPTROLLER; + // Fraxtal / Fraxtal Testnet L1 addresses + address public ADDRESS_MANAGER; + address public L1_CROSS_DOMAIN_MESSENGER_PROXY; + address public L1_ERC721_BRIDGE_PROXY; + address public L1_STANDARD_BRIDGE_PROXY; + address public L2_OUTPUT_ORACLE_PROXY; + address public OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY; + address public OPTIMISM_PORTAL_PROXY; + address public SYSTEM_CONFIG_PROXY; + // Fraxtal / Fraxtal Testnet L2 addresses + address public FRAXSWAP_FACTORY; + address public FRAXSWAP_ROUTER; + address public FRAXSWAP_ROUTER_MULTIHOP; + + constructor() { + // Setup fraxtal / fraxtal testnet L1 addresses + if (block.chainid == Constants.FraxtalL1.CHAIN_ID) { + PROXY_ADMIN = Constants.FraxtalL1.PROXY_ADMIN; + COMPTROLLER = Constants.FraxtalL1.COMPTROLLER; + ADDRESS_MANAGER = Constants.FraxtalL1.ADDRESS_MANAGER; + L1_CROSS_DOMAIN_MESSENGER_PROXY = Constants.FraxtalL1.L1_CROSS_DOMAIN_MESSENGER_PROXY; + L1_ERC721_BRIDGE_PROXY = Constants.FraxtalL1.L1_ERC721_BRIDGE_PROXY; + L1_STANDARD_BRIDGE_PROXY = Constants.FraxtalL1.L1_STANDARD_BRIDGE_PROXY; + L2_OUTPUT_ORACLE_PROXY = Constants.FraxtalL1.L2_OUTPUT_ORACLE_PROXY; + OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY = Constants.FraxtalL1.OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY; + OPTIMISM_PORTAL_PROXY = Constants.FraxtalL1.OPTIMISM_PORTAL_PROXY; + SYSTEM_CONFIG_PROXY = Constants.FraxtalL1.SYSTEM_CONFIG_PROXY; + } else if (block.chainid == Constants.FraxtalTestnetL1.CHAIN_ID) { + PROXY_ADMIN = Constants.FraxtalTestnetL1.PROXY_ADMIN; + COMPTROLLER = Constants.FraxtalTestnetL1.COMPTROLLER; + ADDRESS_MANAGER = Constants.FraxtalTestnetL1.ADDRESS_MANAGER; + L1_CROSS_DOMAIN_MESSENGER_PROXY = Constants.FraxtalTestnetL1.L1_CROSS_DOMAIN_MESSENGER_PROXY; + L1_ERC721_BRIDGE_PROXY = Constants.FraxtalTestnetL1.L1_ERC721_BRIDGE_PROXY; + L1_STANDARD_BRIDGE_PROXY = Constants.FraxtalTestnetL1.L1_STANDARD_BRIDGE_PROXY; + L2_OUTPUT_ORACLE_PROXY = Constants.FraxtalTestnetL1.L2_OUTPUT_ORACLE_PROXY; + OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY = Constants.FraxtalTestnetL1.OPTIMISM_MINTABLE_ERC20_FACTORY_PROXY; + OPTIMISM_PORTAL_PROXY = Constants.FraxtalTestnetL1.OPTIMISM_PORTAL_PROXY; + SYSTEM_CONFIG_PROXY = Constants.FraxtalTestnetL1.SYSTEM_CONFIG_PROXY; + } + // Setup fraxtal / fraxtal testnet L2 addresses + if (block.chainid == Constants.FraxtalL2.CHAIN_ID) { + FRAXSWAP_FACTORY = Constants.FraxtalL2.FRAXSWAP_FACTORY; + FRAXSWAP_ROUTER = Constants.FraxtalL2.FRAXSWAP_ROUTER; + FRAXSWAP_ROUTER_MULTIHOP = Constants.FraxtalL2.FRAXSWAP_ROUTER_MULTIHOP; + } else if (block.chainid == Constants.FraxtalTestnetL2.CHAIN_ID) { + FRAXSWAP_FACTORY = Constants.FraxtalTestnetL2.FRAXSWAP_FACTORY; + FRAXSWAP_ROUTER = Constants.FraxtalTestnetL2.FRAXSWAP_ROUTER; + FRAXSWAP_ROUTER_MULTIHOP = Constants.FraxtalTestnetL2.FRAXSWAP_ROUTER_MULTIHOP; + } + } } From 183f489b612ca27fb83df730d358f9ded3744007 Mon Sep 17 00:00:00 2001 From: Carter Carlson Date: Wed, 28 Feb 2024 15:10:47 -0800 Subject: [PATCH 2/3] fix(build): foundry.toml --- foundry.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/foundry.toml b/foundry.toml index b2a2850..e55c3bb 100644 --- a/foundry.toml +++ b/foundry.toml @@ -76,5 +76,5 @@ fraxtal_testnet = "${FRAXTAL_TESTNET_RPC_URL}" [etherscan] mainnet = { key = "${ETHERSCAN_API_KEY}", url = "${ETHERSCAN_API_URL}" } polygon = { key = "${POLYGONSCAN_API_KEY}", url = "${POLYGONSCAN_API_URL}" } -fraxtal = { key = "${FRAXTAL_API_KEY}", url = "${FRAXSCAN_API_URL}", chain=252 } -fraxtal_testnet = { key = "${FRAXTAL_API_KEY}", url = "${FRAXCAN_TESTNET_API_URL}", chain=2522 } +fraxtal = { key = "${FRAXSCAN_API_KEY}", url = "${FRAXSCAN_API_URL}", chain=252 } +fraxtal_testnet = { key = "${FRAXSCAN_API_KEY}", url = "${FRAXSCAN_TESTNET_API_URL}", chain=2522 } From efb806389f8f2510062af7905195ac47a41d4d0b Mon Sep 17 00:00:00 2001 From: Carter Carlson Date: Wed, 6 Mar 2024 11:40:28 -0800 Subject: [PATCH 3/3] build: comptroller for fraxtal l1 --- scripts/constants/fraxtal-l1.ts | 2 +- scripts/constants/fraxtal-testnet-l1.ts | 2 +- src/Constants.sol | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/constants/fraxtal-l1.ts b/scripts/constants/fraxtal-l1.ts index 784453a..3b082e2 100644 --- a/scripts/constants/fraxtal-l1.ts +++ b/scripts/constants/fraxtal-l1.ts @@ -1,7 +1,7 @@ export const CHAIN_ID = 1; export const PROXY_ADMIN = "0x13Fe62cB24aEa5afd179F20D362c056c3881ABcA"; -export const COMPTROLLER = "0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27"; +export const COMPTROLLER = "0xe0d7755252873c4eF5788f7f45764E0e17610508"; export const ADDRESS_MANAGER = "0x8c5D64d10394cFa070066e70Ec19E67398b4dABE"; export const L1_CROSS_DOMAIN_MESSENGER_PROXY = "0x126bcc31Bc076B3d515f60FBC81FddE0B0d542Ed"; export const L1_ERC721_BRIDGE_PROXY = "0xa9B5Fb84B7aeAF0D51C95DB04a76B1D4738D0eC5"; diff --git a/scripts/constants/fraxtal-testnet-l1.ts b/scripts/constants/fraxtal-testnet-l1.ts index 2c8bffb..cd81b9f 100644 --- a/scripts/constants/fraxtal-testnet-l1.ts +++ b/scripts/constants/fraxtal-testnet-l1.ts @@ -1,7 +1,7 @@ export const CHAIN_ID = 17000; export const PROXY_ADMIN = "0xA0c6294D524f56fF9BdAeE94b69064c529cB9a1e"; -export const COMPTROLLER = "0x0000000000000000000000000000000000000000"; +export const COMPTROLLER = "0x88699c59E413e8A47117820D15d8D33b09B21edD"; export const ADDRESS_MANAGER = "0x6C52d1f7aAdD1F27aaa6A9e228CE0312E3CB09A6"; export const L1_CROSS_DOMAIN_MESSENGER_PROXY = "0x45A98115D5722C6cfC48D711e0053758E7C0b8ad"; export const L1_ERC721_BRIDGE_PROXY = "0x0301A6b26a37566d3DCebC7fC4c2143B426bBf53"; diff --git a/src/Constants.sol b/src/Constants.sol index e397135..cfaf204 100644 --- a/src/Constants.sol +++ b/src/Constants.sol @@ -264,7 +264,7 @@ library FraxtalL2Devnet { library FraxtalL1 { uint256 internal constant CHAIN_ID = 1; address internal constant PROXY_ADMIN = 0x13Fe62cB24aEa5afd179F20D362c056c3881ABcA; - address internal constant COMPTROLLER = 0xB1748C79709f4Ba2Dd82834B8c82D4a505003f27; + address internal constant COMPTROLLER = 0xe0d7755252873c4eF5788f7f45764E0e17610508; address internal constant ADDRESS_MANAGER = 0x8c5D64d10394cFa070066e70Ec19E67398b4dABE; address internal constant L1_CROSS_DOMAIN_MESSENGER_PROXY = 0x126bcc31Bc076B3d515f60FBC81FddE0B0d542Ed; address internal constant L1_ERC721_BRIDGE_PROXY = 0xa9B5Fb84B7aeAF0D51C95DB04a76B1D4738D0eC5; @@ -289,7 +289,7 @@ library FraxtalL2 { library FraxtalTestnetL1 { uint256 internal constant CHAIN_ID = 17_000; address internal constant PROXY_ADMIN = 0xA0c6294D524f56fF9BdAeE94b69064c529cB9a1e; - address internal constant COMPTROLLER = 0x0000000000000000000000000000000000000000; + address internal constant COMPTROLLER = 0x88699c59E413e8A47117820D15d8D33b09B21edD; address internal constant ADDRESS_MANAGER = 0x6C52d1f7aAdD1F27aaa6A9e228CE0312E3CB09A6; address internal constant L1_CROSS_DOMAIN_MESSENGER_PROXY = 0x45A98115D5722C6cfC48D711e0053758E7C0b8ad; address internal constant L1_ERC721_BRIDGE_PROXY = 0x0301A6b26a37566d3DCebC7fC4c2143B426bBf53;