mirror of
https://github.com/vacp2p/foundry-template.git
synced 2026-01-09 15:17:57 -05:00
feat: add DeploymentConfig for network specifc deployments (#5)
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
This commit is contained in:
@@ -3,13 +3,19 @@ pragma solidity >=0.8.19 <0.9.0;
|
||||
|
||||
import { Test, console } from "forge-std/Test.sol";
|
||||
|
||||
import { Deploy } from "../script/Deploy.s.sol";
|
||||
import { DeploymentConfig } from "../script/DeploymentConfig.s.sol";
|
||||
import { Foo } from "../src/Foo.sol";
|
||||
|
||||
contract FooTest is Test {
|
||||
Foo internal foo;
|
||||
DeploymentConfig internal deploymentConfig;
|
||||
|
||||
address internal deployer;
|
||||
|
||||
function setUp() public virtual {
|
||||
foo = new Foo();
|
||||
Deploy deployment = new Deploy();
|
||||
(foo, deploymentConfig) = deployment.run();
|
||||
}
|
||||
|
||||
function test_Example() external {
|
||||
|
||||
Reference in New Issue
Block a user