Skip to content

Commit e42ebcd

Browse files
CrimsonGlorychriseth
authored andcommitted
Document pre-0.5.0 bytesX/uintY conversions
Document pre-0.5.0 compiler behavior on bytesX/uintY conversions when they have different size.
1 parent c0a9578 commit e42ebcd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/050-breaking-changes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ For most of the topics the compiler will provide suggestions.
127127
adjusted within the type before the conversion. For example, you can convert
128128
a ``bytes4`` (4 bytes) to a ``uint64`` (8 bytes) by first converting the
129129
``bytes4`` variable to ``bytes8`` and then to ``uint64``. You get the
130-
opposite padding when converting through ``uint32``.
130+
opposite padding when converting through ``uint32``. Before v0.5.0 any
131+
conversion between ``bytesX`` and ``uintY`` would go through ``uint8X``. For
132+
example ``uint8(bytes3(0x291807))`` would be converted to ``uint8(uint24(bytes3(0x291807)))``
133+
(the result is ``0x07``).
131134

132135
* Using ``msg.value`` in non-payable functions (or introducing it via a
133136
modifier) is disallowed as a security feature. Turn the function into

0 commit comments

Comments
 (0)