From b598e01860405ff3c594905911eb307616ad2762 Mon Sep 17 00:00:00 2001 From: Nadir Akhtar Date: Wed, 30 Oct 2024 16:38:02 -0700 Subject: [PATCH] feat: add helper methods for constructing deployment objects --- src/templates/EOADeployer.sol | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/templates/EOADeployer.sol b/src/templates/EOADeployer.sol index 6772738..dcb903a 100644 --- a/src/templates/EOADeployer.sol +++ b/src/templates/EOADeployer.sol @@ -34,4 +34,28 @@ abstract contract EOADeployer is ZeusScript { * @return An array of Deployment structs representing the deployed contracts. */ function _deploy() internal virtual returns (Deployment[] memory); + + function singleton(address deployedTo) internal pure returns (Deployment memory) { + return Deployment({ + deployedTo: deployedTo, + overrideName: "", + singleton: true + }); + } + + function instance(address deployedTo) internal pure returns (Deployment memory) { + return Deployment({ + deployedTo: deployedTo, + overrideName: "", + singleton: false + }); + } + + function named(address deployedTo, string memory overrideName) internal pure returns (Deployment memory) { + return Deployment({ + deployedTo: deployedTo, + overrideName: overrideName, + singleton: true + }); + } }