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(cast): add support for beacon proxies in cast impl #9567

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

0xvv
Copy link
Contributor

@0xvv 0xvv commented Dec 17, 2024

Motivation

cast impl has no easy way to read the implementation for BeaconProxy like contract

Solution

Add a --beacon flag to cast impl that changes which storage slot is read to fetch the implementation address.

I added cast tests for both cases of cast impl however they are both using actively used proxies, if someone has addresses for an EIP1967Proxy and a BeaconProxy that will never be upgraded it would prevent those tests breaking in the future

@0xvv 0xvv force-pushed the cast-impl-beacons branch 2 times, most recently from 23098bb to 1dd8096 Compare December 17, 2024 11:09
@0xvv 0xvv force-pushed the cast-impl-beacons branch from 1dd8096 to 10c26f6 Compare December 17, 2024 11:15
@zerosnacks
Copy link
Member

Thanks @0xvv! This looks good

Related: https://eips.ethereum.org/EIPS/eip-1967

@grandizzy grandizzy self-requested a review December 17, 2024 12:09
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thank you!

@grandizzy grandizzy enabled auto-merge (squash) December 17, 2024 12:09
Copy link
Member

@yash-atreya yash-atreya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat

@grandizzy grandizzy merged commit 681bddd into foundry-rs:master Dec 17, 2024
22 checks passed
@grandizzy grandizzy added T-feature Type: feature C-cast Command: cast labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-feature Type: feature
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants