Skip to content

Commit

Permalink
feat: add helper methods for constructing deployment objects
Browse files Browse the repository at this point in the history
  • Loading branch information
nadir-akhtar committed Oct 30, 2024
1 parent 5f2207a commit b598e01
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/templates/EOADeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
}

0 comments on commit b598e01

Please sign in to comment.