Skip to main content

tryGetDeployedContract

Signatureโ€‹

function tryGetDeployedContract(string memory keyword) public returns(bool success, address deployedContract);

Descriptionโ€‹

Attempts to retrieve a deployed contract's address from the environment file using the specified keyword. If the retrieval fails or the obtained address does not have any associated code (indicating the contract might not be deployed), it returns false.

Exampleโ€‹

(bool success, address deployedContract) = tryGetDeployedContract("DICTIONARY_UPGRADEABLE_ETHERSCAN");