Skip to content

Commit

Permalink
fix: contract comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase committed Jul 16, 2024
1 parent 6f23b2f commit 3bd1871
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ 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) {}

Expand All @@ -21,12 +22,14 @@ abstract contract DeployBaseFactory is Script, Params {
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({
Expand Down
3 changes: 2 additions & 1 deletion script/Params.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.25;

contract Params {
/// @notice Deployment parameters
abstract contract Params {
struct BFactoryDeploymentParams {
address bDao;
}
Expand Down
5 changes: 4 additions & 1 deletion script/Registry.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import {BFactory} from 'contracts/BFactory.sol';

import {Params} from 'script/Params.s.sol';

contract Registry is Params {
/// @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;

constructor(uint256 chainId) Params(chainId) {
Expand Down
5 changes: 3 additions & 2 deletions script/Script.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import {IFaucet} from 'interfaces/IFaucet.sol';
import {Script} from 'forge-std/Script.sol';
import {Registry} from 'script/Registry.s.sol';

/// @notice This base script is shared across `yarn script:{mainnet|testnet}`
abstract contract BaseScript is Registry, Script {
constructor() Registry(block.chainid) {}
}

/// @notice This script will be executed by `yarn script:mainnet`
contract MainnetScript is BaseScript {
/// @notice This script will be executed by `yarn script:mainnet`
function run() public {
assert(block.chainid == 1);
vm.startBroadcast();
Expand All @@ -24,14 +25,14 @@ contract MainnetScript is BaseScript {
}
}

/// @notice This script will be executed by `yarn script:testnet`
contract TestnetScript is BaseScript {
/// @notice ERC20 and Faucet addresses
address internal constant _SEPOLIA_FAUCET = 0x26bfAecAe4D5fa93eE1737ce1Ce7D53F2a0E9b2d;
address internal constant _SEPOLIA_BAL_TOKEN = 0xb19382073c7A0aDdbb56Ac6AF1808Fa49e377B75;
address internal constant _SEPOLIA_DAI_TOKEN = 0xB77EB1A70A96fDAAeB31DB1b42F2b8b5846b2613;
address internal constant _SEPOLIA_USDC_TOKEN = 0x80D6d3946ed8A1Da4E226aa21CCdDc32bd127d1A;

/// @notice This script will be executed by `yarn script:testnet`
/// @dev The following is an example of a script that deploys a Balancer CoW pool
function run() public {
assert(block.chainid == 11_155_111);
Expand Down

0 comments on commit 3bd1871

Please sign in to comment.