1

How many bytes are allocated to store an address in storage? In order to simplify my code I am considering using bytes32 as a generic data type to store addresses, strings and uint256, but this means I might be wasting space when it comes to addresses....

0

The minimum space in storage that can be modified is 32 bytes, an storage slot.

There are some possible optimizations, structs will pack its fields to save space, short strings are stored in a single storage slot.

Unless you know what you are doing I won't recommend using bytes32 for everything.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.