Hi everyone,
I’m encountering an issue with my upgradeable contract on BSC mainnet using Hardhat and would appreciate any insights.
Context
-
Pattern: UUPS upgradeable contract
-
Network: BSC Mainnet
-
Tooling: Hardhat + OpenZeppelin Upgrades plugin
Issue
I performed an upgrade transaction, and:
-
The transaction succeeds
-
The
Upgraded(address indexed implementation)event is emitted -
The emitted address is the new implementation
However:
-
When I check the implementation using:
await upgrades.erc1967.getImplementationAddress(PROXY_ADDRESS)it still returns the old implementation address
What I Expected
After a successful upgrade, I expect:
-
getImplementationAddress(proxy)to return the new implementation -
Contract behavior to reflect the updated logic
What Actually Happens
-
Event shows correct new implementation
-
But storage (implementation slot) seems unchanged
-
Contract behavior also does not reflect updates
Additional Notes
-
I verified I am using the correct proxy address
-
The upgrade transaction does not revert
-
No errors are thrown during upgrade
Questions
-
Is it possible for the
Upgradedevent to emit even if the implementation slot is not updated? -
Could this be related to:
-
Using
forceImportincorrectly? -
Proxy mismatch (e.g., calling upgrade on a different proxy instance)?
-
Storage slot collision or corrupted proxy state?
-
-
Is there a way to manually verify the implementation slot directly on-chain?
-
Has anyone encountered this specifically on BSC?
Any guidance or things I should double-check would be greatly appreciated. Thanks!