Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix upgrade interface version detection #53

Merged
merged 3 commits into from
May 21, 2024
Merged

Conversation

qRoC
Copy link
Contributor

@qRoC qRoC commented May 21, 2024

Before:

    ├─ [5536] 0x526997541edA13B59320DF54f11dD5d3BD7b6CdD::be1c44ea()
    │   ├─ [740] 0x6a16cAF9831caDBd02Df2C43176214e7308f28b0::be1c44ea() [delegatecall]
    │   │   └─ ← [Revert]
    │   └─ ← [Revert]
    ├─ [5539] 0x526997541edA13B59320DF54f11dD5d3BD7b6CdD::upgradeTo(ImplementationV2: [0x74C98f4CC839B4660c90d7c1FacF3FdF9d651D17])
    │   ├─ [740] 0x6a16cAF9831caDBd02Df2C43176214e7308f28b0::upgradeTo(ImplementationV2: [0x74C98f4CC839B4660c90d7c1FacF3FdF9d651D17]) [delegatecall]
    │   │   └─ ← [Revert] EvmError: Revert
    │   └─ ← [Revert] EvmError: Revert
    └─ ← [Revert] EvmError: Revert

Error:
script failed: <empty revert data>

After:

  [5816] 0x9513774775cd8cA66D04B816D6Dc5e9F2025707a::UPGRADE_INTERFACE_VERSION()
    ├─ [1012] 0x74C98f4CC839B4660c90d7c1FacF3FdF9d651D17::UPGRADE_INTERFACE_VERSION() [delegatecall]
    │   └─ ← [Return] "5.0.0"
    └─ ← [Return] "5.0.0"

  [15617] 0x9513774775cd8cA66D04B816D6Dc5e9F2025707a::upgradeToAndCall(ImplementationV2: [0xCaFe8cdd71603b9B50bD5844ba2d7b9cEe82A3E9], 0x)
    ├─ [10810] 0x74C98f4CC839B4660c90d7c1FacF3FdF9d651D17::upgradeToAndCall(ImplementationV2: [0xCaFe8cdd71603b9B50bD5844ba2d7b9cEe82A3E9], 0x) [delegatecall]
    │   ├─ [396] ImplementationV2::proxiableUUID() [staticcall]
    │   │   └─ ← [Return] 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
    │   ├─ emit Upgraded(implementation: ImplementationV2: [0xCaFe8cdd71603b9B50bD5844ba2d7b9cEe82A3E9])
    │   └─ ← [Stop]
    └─ ← [Return]

@ericglau ericglau changed the title [fix] Contract Version Detection Fix upgrade interface version detection May 21, 2024
@ericglau
Copy link
Member

Thank you for the fix! Added some tests to cover this case as well.

@ericglau ericglau merged commit 4cd15fc into OpenZeppelin:main May 21, 2024
3 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants