Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Commit

Permalink
Fix short address decoding
Browse files Browse the repository at this point in the history
Example addresses:
```
0x0014F55A50b281EFD12294f0Cda821Bd8171e920
0x0000000000000000000000000000000000000000
```
  • Loading branch information
k06a authored and boolafish committed Oct 26, 2018
1 parent 650d1a1 commit 794e6be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plasma_cash/root_chain/contracts/Libraries/RLP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,8 @@ library RLP {
uint rStartPos;
uint len;
(rStartPos, len) = _decode(self);
require(len == 20);
assembly {
data := div(mload(rStartPos), exp(256, 12))
}
require(len <= 20);
return address(toUint(self));
}

/// @dev Return the RLP encoded bytes.
Expand Down

0 comments on commit 794e6be

Please sign in to comment.