Skip to content

Commit 9ef0a7d

Browse files
authored
Merge pull request #16132 from pcaversaccio/docs/fix-type-casting-to-address
docs: fix unnecessary `uint160(bytes20(b))` casting
2 parents aef512f + 3d4a3c8 commit 9ef0a7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/types/value-types.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ Operators:
229229
To reduce conversion ambiguity, starting with version 0.4.24, the compiler will force you to make the truncation explicit in the conversion.
230230
Take for example the 32-byte value ``0x111122223333444455556666777788889999AAAABBBBCCCCDDDDEEEEFFFFCCCC``.
231231

232-
You can use ``address(uint160(bytes20(b)))``, which results in ``0x111122223333444455556666777788889999aAaa``,
232+
You can use ``address(bytes20(b))``, which results in ``0x111122223333444455556666777788889999aAaa``,
233233
or you can use ``address(uint160(uint256(b)))``, which results in ``0x777788889999AaAAbBbbCcccddDdeeeEfFFfCcCc``.
234234

235235
.. note::

0 commit comments

Comments
 (0)