eEVM icon indicating copy to clipboard operation
eEVM copied to clipboard

Add distinct Address type

Open eddyashton opened this issue 6 years ago • 0 comments

Currently the 20-byte Addresses are simply a typedef for uint256_t. This means we can easily reuse the parsing and serialisation code, but introduces type confusion and memory bloat (32 bytes for every 20-byte Address). In particular, we always want to export an Address as a fixed-size 20 byte hex value, ideally checksum-encoded, whereas uint256_ts are written with variable length (rather than padded with leading 0s). We can achieve this by explicitly calling the correct functions everywhere we do these conversions, but it would be neater if these were automatically handled by the type system.

eddyashton avatar Aug 09 '19 08:08 eddyashton