Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions contracts/SmartPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,10 @@ library RLP {
/// @param self The RLPItem.
/// @return The decoded string.
function toAddress(RLPItem memory self) internal pure returns (address data) {
if(!isData(self))
revert();
var (rStartPos, len) = _decode(self);
if (len != 20)
var (, len) = _decode(self);
if (len > 20)
revert();
assembly {
data := div(mload(rStartPos), exp(256, 12))
}
return address(toUint(self));
}

// Get the payload offset.
Expand Down