Closed
Description
Component
Forge
Describe the feature you would like
Add new methods that parse JSON files in the broadcast
folder to find contract addresses.
// Returns the most recent deployment for the given contract on `chainId`
function getDeployment(string memory contractName, uint256 chainId) external returns (address);
// Returns the deployment given by `index` for the given contract on `chainId`,
// where index=0 is the first (oldest) deploy, index=1 is the second deploy,
// and index=`type(uint256).max` is the most recent deploy
function getDeployment(string memory contractName, uint256 chainId, uint256 index) external returns (address);
// Returns all deployments for the given contract on `chainId`
function getDeployments(string memory contractName, uint256 chainId) external returns (address[] memory);
// Returns deployments by index for the given contract on `chainId`.
// If the start index is `type(uint256).max`, the end index counts
// backwards to return the most recent contracts. End index is exclusive,
// similar to how most slice methods behave
function getDeployments(string memory contractName, uint256 chainId, uint256 startIndex, uint256 endIndex) external returns (address[] memory);
cc @PatrickAlphaC @karmacoma-eth for thoughts on syntax/UX/cheat names/etc
Additional context
No response
Metadata
Metadata
Assignees
Type
Projects
Status
Completed