Created
December 21, 2020 20:36
-
-
Save petejkim/6500894fec683aa9e02f2f22034d8c99 to your computer and use it in GitHub Desktop.
USDC v2: Upgrading a $1.4B Token - Testing Storage Slot 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Storage slot 0 contains "owner" (address) | |
const data = await web3.eth.getStorageAt(contract.address, 0); | |
// Take the last 20 bytes, left-pad with zeros if needed | |
const ownerData = data.slice(-40).padStart(40, "0"); | |
expect(ownerData).to.equal( | |
ownerAddress.slice(2).toLowerCase() // Remove "0x" | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment