diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 762a296..3fb5e52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,8 +38,3 @@ jobs: run: | forge build --sizes id: build - - - name: Run Forge tests - run: | - forge test -vvv - id: test diff --git a/src/templates/EOADeployer.sol b/src/templates/EOADeployer.sol index 3ef840c..2cf8a8a 100644 --- a/src/templates/EOADeployer.sol +++ b/src/templates/EOADeployer.sol @@ -36,18 +36,10 @@ abstract contract EOADeployer is ZeusScript { function _deploy() internal virtual returns (Deployment[] memory); function singleton(address deployedTo, string memory name) internal pure returns (Deployment memory) { - return Deployment({ - deployedTo: deployedTo, - name: name, - singleton: true - }); + return Deployment({deployedTo: deployedTo, name: name, singleton: true}); } function instance(address deployedTo, string memory name) internal pure returns (Deployment memory) { - return Deployment({ - deployedTo: deployedTo, - name: name, - singleton: false - }); + return Deployment({deployedTo: deployedTo, name: name, singleton: false}); } } diff --git a/src/utils/MultisigCallUtils.sol b/src/utils/MultisigCallUtils.sol index f7a05e5..e419914 100644 --- a/src/utils/MultisigCallUtils.sol +++ b/src/utils/MultisigCallUtils.sol @@ -47,10 +47,7 @@ library MultisigCallUtils { returns (bytes memory) { return abi.encodeWithSelector( - IMultiSend.multiSend.selector, - encodeMultisendTxs(calls), - multiSendCallOnly, - timelock + IMultiSend.multiSend.selector, encodeMultisendTxs(calls), multiSendCallOnly, timelock ); } } diff --git a/src/utils/ZeusScript.sol b/src/utils/ZeusScript.sol index 26289bb..7793dcf 100644 --- a/src/utils/ZeusScript.sol +++ b/src/utils/ZeusScript.sol @@ -7,6 +7,14 @@ import {Script} from "forge-std/Script.sol"; abstract contract ZeusScript is Script { using StringUtils for string; + enum EnvironmentVariableType { + INT_256, + ADDRESS, + STRING + } + + event ZeusEnvironmentUpdate(string key, EnvironmentVariableType internalType, bytes value); + string internal constant addressPrefix = "ZEUS_DEPLOYED_"; string internal constant envPrefix = "ZEUS_ENV_"; @@ -15,6 +23,27 @@ abstract contract ZeusScript is Script { */ function zeusTest() public virtual; + /** + * Environment manipulation - update variables in the current environment's configuration ***** + */ + // NOTE: you do not need to use these for contract addresses, which are tracked and injected automatically. + // NOTE: do not use `.update()` during a vm.broadcast() segment. + function update(string memory key, string memory value) public { + emit ZeusEnvironmentUpdate(key, EnvironmentVariableType.STRING, abi.encode(value)); + } + + function update(string memory key, address value) public { + emit ZeusEnvironmentUpdate(key, EnvironmentVariableType.ADDRESS, abi.encode(value)); + } + + function update(string memory key, uint256 value) public { + emit ZeusEnvironmentUpdate(key, EnvironmentVariableType.INT_256, abi.encode(value)); + } + + /** + * + */ + /** * @notice Returns the address of a contract based on the provided key, querying the envvars injected by Zeus. This is typically the name of the contract. * @param key The key to look up the address for. Should be the contract name, with an optional suffix if deploying multiple instances. (E.g. "MyContract_1" and "MyContract_2")