Dynamic Replacement Demo
This is a simple demo to explain the logic of Dynamic Replacement
These replacements are applied to your Smart Contracts, allowing you to change constants without needing to create a new branch
Variable Name
Value
Remove
Variable Name
Value
Remove
Variable Name
Value
Remove
Variable Name
Value
Remove
Add More Variables
Source Code
pragma solidity ^0.8.0; import {BaseSetup} from "@chimera/BaseSetup.sol"; import {IInitiative} from "governance/interfaces/IInitiative.sol"; import {Initiative} from "src/Initiative.sol"; import {vm} from "@chimera/Hevm.sol"; abstract contract Setup is BaseSetup { Initiative initiative; address constant MAINNET_GOVERNANCE = address(0); address constant MAINNET_BOLD = address(0); uint256 constant MIN_GAS_TO_HOOK = 350_000; address constant NOT_FORMATTED= address( 0x123); function setup() internal virtual override { initiative = new Initiative(MAINNET_GOVERNANCE, MAINNET_BOLD); } function setupFork() internal virtual { vm.warp(123); vm.roll(123); uint MIN_GAS_TO_HOOK = 123; address INITIATIVE_TO_TEST = address(0x123123); initiative = Initiative(INITIATIVE_TO_TEST); } }
Generated Template
1