Skip to content

Commit 9877bbd

Browse files
authored
Merge pull request #378 from derekpierre/fix-proxy-check
Fix bug where proxy contract address was not correctly being determined
2 parents 72e560e + 2223078 commit 9877bbd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

deployment/params.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,11 @@ def resolve(self) -> Any:
153153

154154
if self.check_for_proxy_instances:
155155
# check if contract is proxied - if so return proxy contract instead
156-
proxy_info = chain.contracts.get_proxy_info(contract_instance.address)
157-
if proxy_info:
158-
return proxy_info.address
156+
proxy_info_keys = chain.contracts.proxy_infos.memory.keys()
157+
for proxy_address in proxy_info_keys:
158+
proxy_info = chain.contracts.get_proxy_info(proxy_address)
159+
if proxy_info and proxy_info.target == contract_instance.address:
160+
return proxy_address
159161

160162
return contract_instance.address
161163

@@ -417,7 +419,7 @@ def from_config(cls, config: typing.Dict) -> "ProxyParameters":
417419
contract_names=contract_names,
418420
constants=constants,
419421
contract_name=contract_name,
420-
check_for_proxy_instances=False,
422+
check_for_proxy_instances=True,
421423
),
422424
)
423425
contracts_proxy_info.update({contract_name: proxy_info})

0 commit comments

Comments
 (0)