Skip to content

Commit

Permalink
chore: adding deployment addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase committed Jul 24, 2024
1 parent c250754 commit ccdd8de
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
MAINNET_RPC=
MAINNET_DEPLOYER_PK=

GNOSIS_RPC=
GNOSIS_DEPLOYER_PK=

SEPOLIA_RPC=
SEPOLIA_DEPLOYER_PK=

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
- 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]
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@
"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",
"lint:check": "solhint 'src/**/*.sol' 'test/**/*.sol' 'script/**/*.sol' && forge fmt --check",
"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",
Expand Down
2 changes: 1 addition & 1 deletion script/Params.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down
17 changes: 8 additions & 9 deletions script/Registry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion script/Script.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ccdd8de

Please sign in to comment.