forked from balancer/balancer-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from defi-wonderland/chore/merge-dev-into-fuzz
chore: merge dev into fuzz
- Loading branch information
Showing
82 changed files
with
3,048 additions
and
4,366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
174743 | ||
174820 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
138985 | ||
138974 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
4200675 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3397437 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4130621 | ||
3442127 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3477592 | ||
2841995 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
215793 | ||
215771 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
225641 | ||
225619 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
104914 | ||
104964 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
114583 | ||
114787 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"rules": { | ||
"one-contract-per-file": "off", | ||
"custom-errors": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.25; | ||
|
||
import {BCoWFactory} from 'contracts/BCoWFactory.sol'; | ||
import {BCoWHelper} from 'contracts/BCoWHelper.sol'; | ||
import {BFactory} from 'contracts/BFactory.sol'; | ||
import {IBFactory} from 'interfaces/IBFactory.sol'; | ||
|
||
import {Script} from 'forge-std/Script.sol'; | ||
import {Params} from 'script/Params.s.sol'; | ||
|
||
/// @notice This base script is shared across `yarn script:{b|bcow}factory:{mainnet|testnet}` | ||
abstract contract DeployBaseFactory is Script, Params { | ||
constructor() Params(block.chainid) {} | ||
|
||
function run() public { | ||
vm.startBroadcast(); | ||
IBFactory bFactory = _deployFactory(); | ||
bFactory.setBDao(_bFactoryDeploymentParams.bDao); | ||
vm.stopBroadcast(); | ||
} | ||
|
||
function _deployFactory() internal virtual returns (IBFactory); | ||
} | ||
|
||
/// @notice This script will be executed by `yarn script:bfactory:{mainnet|testnet}` | ||
contract DeployBFactory is DeployBaseFactory { | ||
function _deployFactory() internal override returns (IBFactory bFactory) { | ||
bFactory = new BFactory(); | ||
} | ||
} | ||
|
||
/// @notice This script will be executed by `yarn script:bcowfactory:{mainnet|testnet}` | ||
contract DeployBCoWFactory is DeployBaseFactory { | ||
function _deployFactory() internal override returns (IBFactory bFactory) { | ||
bFactory = new BCoWFactory({ | ||
solutionSettler: _bCoWFactoryDeploymentParams.settlement, | ||
appData: _bCoWFactoryDeploymentParams.appData | ||
}); | ||
|
||
new BCoWHelper(address(bFactory)); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,44 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.25; | ||
|
||
contract Params { | ||
/// @notice Deployment parameters | ||
abstract contract Params { | ||
struct BFactoryDeploymentParams { | ||
address bLabs; | ||
address bDao; | ||
} | ||
|
||
struct BCoWFactoryDeploymentParams { | ||
address bLabs; | ||
address settlement; | ||
bytes32 appData; | ||
} | ||
|
||
/// @notice Settlement address | ||
address internal constant _GPV2_SETTLEMENT = 0x9008D19f58AAbD9eD0D60971565AA8510560ab41; | ||
|
||
/// @notice AppData identifier | ||
bytes32 internal constant _APP_DATA = bytes32('appData'); | ||
|
||
/// @notice BFactory deployment parameters for each chain | ||
mapping(uint256 _chainId => BFactoryDeploymentParams _params) internal _bFactoryDeploymentParams; | ||
|
||
/// @notice BCoWFactory deployment parameters for each chain | ||
mapping(uint256 _chainId => BCoWFactoryDeploymentParams _params) internal _bCoWFactoryDeploymentParams; | ||
|
||
constructor() { | ||
// Mainnet | ||
_bFactoryDeploymentParams[1] = BFactoryDeploymentParams(address(this)); | ||
_bCoWFactoryDeploymentParams[1] = BCoWFactoryDeploymentParams(address(this), _GPV2_SETTLEMENT, _APP_DATA); | ||
|
||
// Sepolia | ||
_bFactoryDeploymentParams[11_155_111] = BFactoryDeploymentParams(address(this)); | ||
_bCoWFactoryDeploymentParams[11_155_111] = BCoWFactoryDeploymentParams(address(this), _GPV2_SETTLEMENT, _APP_DATA); | ||
/// @notice Balancer DAO address (has controller permission to collect fees from BFactory pools) | ||
address internal constant _B_DAO = 0xce88686553686DA562CE7Cea497CE749DA109f9F; | ||
|
||
/** | ||
* @notice AppData identifier | ||
* @dev Value obtained from https://explorer.cow.fi/appdata?tab=encode | ||
* - appCode: "CoW AMM Balancer" | ||
* - metadata:hooks:version: 0.1.0 | ||
* - version: 1.1.0 | ||
*/ | ||
bytes32 internal constant _APP_DATA = 0x362e5182440b52aa8fffe70a251550fbbcbca424740fe5a14f59bf0c1b06fe1d; | ||
|
||
/// @notice BFactory deployment parameters | ||
BFactoryDeploymentParams internal _bFactoryDeploymentParams; | ||
|
||
/// @notice BCoWFactory deployment parameters | ||
BCoWFactoryDeploymentParams internal _bCoWFactoryDeploymentParams; | ||
|
||
constructor(uint256 chainId) { | ||
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}); | ||
} else { | ||
revert('Params: unknown chain ID'); | ||
} | ||
} | ||
} |
Oops, something went wrong.