Skip to content
Merged
Changes from 3 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
14 changes: 12 additions & 2 deletions contracts/utils/RLP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,12 @@ library RLP {
return string(readBytes(item));
}

/// @dev Decodes an RLP encoded list into an array of RLP Items.
/**
* @dev Decodes an RLP encoded list in a memory slice into an array of RLP Items.
*
* NOTE: The returned array contains slice references into the original payload, not copied bytes. Any further
* modification of the input buffer may cause the output result to become invalid.
*/
function readList(Memory.Slice item) internal pure returns (Memory.Slice[] memory list) {
uint256 itemLength = item.length();

Expand Down Expand Up @@ -413,7 +418,12 @@ library RLP {
return readString(item.asSlice());
}

/// @dev Decode an RLP encoded list from bytes. See {readList}
/**
* @dev Decode an RLP encoded list from bytes. See {readList}
*
* NOTE: The returned array contains slice references into the original payload, not copied bytes. Any further
* modification of the input buffer may cause the output result to become invalid.
*/
function decodeList(bytes memory value) internal pure returns (Memory.Slice[] memory) {
return readList(value.asSlice());
}
Expand Down
Loading