I'm trying to do some low-level hacking of a smart contract, so I need to find the storage position of a variable. The smart contract is a multi-file project, all the source codes can be fetched from Etherscan.

I've read the solidity document about storage layout, which mentioned the slot could be gotten from the compiling output.

So I tried to compile the project with solc, and I do get those JSON outputs, the problem is that the slots in those outputs seem to be relative to the specific .sol file, but what I need is the global slot position.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.