Skip to content

Commit

Permalink
feat: lookup GovernanceFactory in deployed as well
Browse files Browse the repository at this point in the history
  • Loading branch information
bowd committed Aug 18, 2024
1 parent c2c5cfc commit 07ad2f4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Contracts.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,13 @@ abstract contract Contracts is CeloChains {
}

function _lookupGovernanceFactory(string memory contractName) private view returns (address payable addr) {
address governanceFactory = _lookupDependencies("GovernanceFactory");
if (governanceFactory == address(0)) return payable(address(0));

address governanceFactory = _lookupDeployed("GovernanceFactory");
if (governanceFactory == address(0)) {
governanceFactory = _lookupDependencies("GovernanceFactory");
if (governanceFactory == address(0)) {
return payable(address(0));
}
}
bytes memory getter = governanceFactoryLookupCalldata[keccak256(bytes(contractName))];

if (getter.length == 0) return payable(address(0));
Expand Down

0 comments on commit 07ad2f4

Please sign in to comment.