Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ability to skip proxy detection #2470

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Jan 14, 2025

What I did

inspired by #2465
added a kwarg to skip or provide proxy info to Contract("0x..."

How I did it

new kwarg to chain.contracts.instance_at()

How to verify it

Contract("0x123...", proxy_info=proxy)

or

Contract("0x123...", detect_proxy=False)

Checklist

  • All changes are completed
  • Change is covered in tests
  • Documentation is complete

@antazoey
Copy link
Member Author

example:

In [12]: %time Contract(router_addr)
CPU times: user 46.8 ms, sys: 11.3 ms, total: 58.1 ms
Wall time: 1.43 s
Out[12]: <DexRouter 0x7D0CcAa3Fac1e5A943c5168b6CEd828691b46B36>

In [13]: del chain.contracts[router_addr]

In [14]: %time Contract(router_addr, proxy_info="skip")
CPU times: user 22.5 ms, sys: 5.25 ms, total: 27.8 ms
Wall time: 783 ms
Out[14]: <DexRouter 0x7D0CcAa3Fac1e5A943c5168b6CEd828691b46B36>

@antazoey antazoey force-pushed the feat/proxy-info-kwarg branch from 7106790 to dbb0e0c Compare January 27, 2025 20:26
@antazoey antazoey marked this pull request as ready for review January 27, 2025 21:37
@antazoey antazoey requested a review from fubuloubu January 27, 2025 21:37
@antazoey antazoey merged commit 601e2c4 into ApeWorX:main Jan 27, 2025
19 checks passed
@antazoey antazoey deleted the feat/proxy-info-kwarg branch January 27, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants