mirror of
https://github.com/vacp2p/foundry-template.git
synced 2025-01-30 09:05:23 +00:00
013c9b7e9f
To allow deployment to different chains but using the same deployment scripts, this commit introduces a basic `DeploymentConfig` which can be extended as necessary in each project. There's a few things that should be considered: - `activeNetworkConfig` will be initialized via the constructor, at which point it is know what `block.chainid` is - To add new configuration settings, extend `NetworkConfig` - To add a new config for a different chain, extend the `if/else` block in the constructor so that it creates a `NetworkConfig` for the chain in question
14 lines
425 B
Solidity
14 lines
425 B
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity >=0.8.19 <=0.9.0;
|
|
|
|
import { Foo } from "../src/Foo.sol";
|
|
import { BaseScript } from "./Base.s.sol";
|
|
import { DeploymentConfig } from "./DeploymentConfig.s.sol";
|
|
|
|
contract Deploy is BaseScript {
|
|
function run() public returns (Foo foo, DeploymentConfig deploymentConfig) {
|
|
deploymentConfig = new DeploymentConfig(broadcaster);
|
|
foo = new Foo();
|
|
}
|
|
}
|