From ccdd8deef878a7af9163e872335361f2fb8bb35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wei=C3=9Fer=20Hase?= Date: Wed, 24 Jul 2024 21:40:30 +0200 Subject: [PATCH] chore: adding deployment addresses --- .env.example | 3 +++ README.md | 12 +++++++++--- foundry.toml | 2 ++ package.json | 3 +++ script/Params.s.sol | 2 +- script/Registry.s.sol | 17 ++++++++--------- script/Script.s.sol | 2 +- 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.env.example b/.env.example index fe295b73..ed757eec 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,9 @@ MAINNET_RPC= MAINNET_DEPLOYER_PK= +GNOSIS_RPC= +GNOSIS_DEPLOYER_PK= + SEPOLIA_RPC= SEPOLIA_DEPLOYER_PK= diff --git a/README.md b/README.md index 1245d520..4f4038de 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,14 @@ yarn test # run the tests # Deployments Ethereum Mainnet: - - BCoWFactory: (0x21Cd97D70f8475DF3d62917880aF9f41D9a9dCeF)[https://etherscan.io/address/0x21Cd97D70f8475DF3d62917880aF9f41D9a9dCeF#code] + - BCoWFactory: (0x5AC134DAC7070eFeE8b1C5e3fD0B353922ceD843)[https://etherscan.io/address/0x5AC134DAC7070eFeE8b1C5e3fD0B353922ceD843] + - BCoWHelper: (0x703Bd8115E6F21a37BB5Df97f78614ca72Ad7624)[https://etherscan.io/address/0x703Bd8115E6F21a37BB5Df97f78614ca72Ad7624] Ethereum Sepolia: - - BCoWFactory: (0xe8587525430fFC9193831e1113a672f3133C1B8A)[https://sepolia.etherscan.io/address/0xe8587525430fFC9193831e1113a672f3133C1B8A#code] - - BCoWPool: (0xFe1ce255D68B3Bff95E71DDef1c8fc55459aaCd7)[https://sepolia.etherscan.io/address/0xFe1ce255D68B3Bff95E71DDef1c8fc55459aaCd7#code] \ No newline at end of file + - BCoWFactory: (0xf3916A8567DdC51a60208B35AC542F5226f46773)[https://sepolia.etherscan.io/address/0xf3916A8567DdC51a60208B35AC542F5226f46773] + - BCoWHelper: (0x55DDf396886C85e443E0B5A8E42CAA3939E4Cf50)[https://sepolia.etherscan.io/address/0x55DDf396886C85e443E0B5A8E42CAA3939E4Cf50] + - BCoWPool: (0x60048091401F27117C3DFb8136c1ec550D949B12)[https://sepolia.etherscan.io/address/0x60048091401F27117C3DFb8136c1ec550D949B12] + + Gnosis Mainnet: + - BCoWFactory: (0xaD0447be7BDC80cf2e6DA20B13599E5dc859b667)[https://etherscan.io/address/0xaD0447be7BDC80cf2e6DA20B13599E5dc859b667] + - BCoWHelper: (0x21Ac2E4115429EcE4b5FE79409fCC48EB6315Ccc)[https://gnosisscan.io/address/0x21Ac2E4115429EcE4b5FE79409fCC48EB6315Ccc] \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index 9fd206be..1a2224e0 100644 --- a/foundry.toml +++ b/foundry.toml @@ -37,8 +37,10 @@ max_test_rejects = 2_500_000 [rpc_endpoints] mainnet = "${MAINNET_RPC}" +gnosis = "${GNOSIS_RPC}" sepolia = "${SEPOLIA_RPC}" [etherscan] mainnet = { key = "${ETHERSCAN_API_KEY}", chain = "mainnet" } +gnosis = { key = "${ETHERSCAN_API_KEY}", chain = "gnosis" } sepolia = { key = "${ETHERSCAN_API_KEY}", chain = "sepolia" } diff --git a/package.json b/package.json index a704b568..be7b3187 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,10 @@ "build": "forge build", "build:optimized": "FOUNDRY_PROFILE=optimized forge build", "coverage": "forge coverage --match-path 'test/unit/**'", + "deploy:bcowfactory:gnosis": "forge script DeployBCoWFactory -vvvvv --rpc-url $GNOSIS --broadcast --chain gnosis --private-key $GNOSIS_DEPLOYER_PK --verify", "deploy:bcowfactory:mainnet": "forge script DeployBCoWFactory -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK --verify", "deploy:bcowfactory:testnet": "forge script DeployBCoWFactory -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK --verify", + "deploy:bfactory:gnosis": "forge script DeployBFactory -vvvvv --rpc-url $GNOSIS --broadcast --chain gnosis --private-key $GNOSIS_DEPLOYER_PK --verify", "deploy:bfactory:mainnet": "forge script DeployBFactory -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK --verify", "deploy:bfactory:testnet": "forge script DeployBFactory -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK --verify", "lint:bulloak": "find test/unit -name '*.tree' | xargs bulloak check", @@ -25,6 +27,7 @@ "lint:fix": "solhint --fix 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol' && sort-package-json && forge fmt", "lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js", "prepare": "husky install", + "script:gnosis": "forge script MainnetScript -vvvvv --rpc-url $GNOSIS_RPC --broadcast --chain gnosis --private-key $GNOSIS_DEPLOYER_PK --verify", "script:mainnet": "forge script MainnetScript -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK --verify", "script:testnet": "forge script TestnetScript -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK --verify", "smock": "smock-foundry --contracts src/contracts", diff --git a/script/Params.s.sol b/script/Params.s.sol index 330f60e1..f60e1750 100644 --- a/script/Params.s.sol +++ b/script/Params.s.sol @@ -33,7 +33,7 @@ abstract contract Params { BCoWFactoryDeploymentParams internal _bCoWFactoryDeploymentParams; constructor(uint256 chainId) { - if (chainId == 1 || chainId == 11_155_111) { + if (chainId == 1 || chainId == 100 || chainId == 11_155_111) { // Ethereum Mainnet & Ethereum Sepolia [Testnet] _bFactoryDeploymentParams = BFactoryDeploymentParams({bDao: _B_DAO}); _bCoWFactoryDeploymentParams = BCoWFactoryDeploymentParams({settlement: _GPV2_SETTLEMENT, appData: _APP_DATA}); diff --git a/script/Registry.s.sol b/script/Registry.s.sol index 16334c1c..74d742e3 100644 --- a/script/Registry.s.sol +++ b/script/Registry.s.sol @@ -3,14 +3,11 @@ pragma solidity 0.8.25; import {BCoWFactory} from 'contracts/BCoWFactory.sol'; import {BCoWHelper} from 'contracts/BCoWHelper.sol'; -import {BFactory} from 'contracts/BFactory.sol'; import {Params} from 'script/Params.s.sol'; /// @notice Registry of deployed contracts abstract contract Registry is Params { - /// @notice Balancer Pool Factory - BFactory public bFactory; /// @notice Balancer CoW Pool Factory BCoWFactory public bCoWFactory; /// @notice Balancer CoW Helper @@ -20,14 +17,16 @@ abstract contract Registry is Params { // TODO: redeploy if (chainId == 1) { // Ethereum Mainnet - bFactory = BFactory(0xaD0447be7BDC80cf2e6DA20B13599E5dc859b667); - bCoWFactory = BCoWFactory(0x21Cd97D70f8475DF3d62917880aF9f41D9a9dCeF); - bCoWHelper = BCoWHelper(0xE50481D88f147B8b4aaCdf9a1B7b7bA44F87823f); + bCoWFactory = BCoWFactory(0x5AC134DAC7070eFeE8b1C5e3fD0B353922ceD843); + bCoWHelper = BCoWHelper(0x703Bd8115E6F21a37BB5Df97f78614ca72Ad7624); + } else if (chainId == 100) { + // Gnosis Mainnet + bCoWFactory = BCoWFactory(0xaD0447be7BDC80cf2e6DA20B13599E5dc859b667); + bCoWHelper = BCoWHelper(0x21Ac2E4115429EcE4b5FE79409fCC48EB6315Ccc); } else if (chainId == 11_155_111) { // Ethereum Sepolia [Testnet] - bFactory = BFactory(0x2bfA24B26B85DD812b2C69E3B1cb4C85C886C8E2); - bCoWFactory = BCoWFactory(0xe8587525430fFC9193831e1113a672f3133C1B8A); - bCoWHelper = BCoWHelper(0x0fd365F9Ed185512536E7dbfc7a8DaE43cD3CA09); + bCoWFactory = BCoWFactory(0xf3916A8567DdC51a60208B35AC542F5226f46773); + bCoWHelper = BCoWHelper(0x55DDf396886C85e443E0B5A8E42CAA3939E4Cf50); } else { // TODO: add Gnosis chain revert('Registry: unknown chain ID'); diff --git a/script/Script.s.sol b/script/Script.s.sol index d21a54cc..6d86aa49 100644 --- a/script/Script.s.sol +++ b/script/Script.s.sol @@ -16,7 +16,7 @@ abstract contract BaseScript is Registry, Script { /// @notice This script will be executed by `yarn script:mainnet` contract MainnetScript is BaseScript { function run() public { - assert(block.chainid == 1); + assert(block.chainid == 1 || block.chainid == 100); vm.startBroadcast(); // script logic here