Skip to content
Draft
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
9 changes: 6 additions & 3 deletions contracts/utils/LowLevelCall.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ library LowLevelCall {
/// in the scratch space of memory. Useful for functions that return a tuple with two single-word values.
///
/// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated
/// and this function doesn't zero it out.
/// and this function doesn't zero it out. Similarly, if `success` is true consider checking the return data size
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe its not worth distinguishing success values

/// WARNING: Do not assume that the results are zero if the call doesn't return data. Memory can be already allocated
/// and this function doesn't zero it out. Consider checking the return data size using {returnDataSize()} to check 
/// the results space was writen by the call.

/// (e.g., with `returnDataSize()`) to avoid reading memory already allocated.
function callReturn64Bytes(
address target,
bytes memory data
Expand Down Expand Up @@ -58,7 +59,8 @@ library LowLevelCall {
/// in the scratch space of memory. Useful for functions that return a tuple with two single-word values.
///
/// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated
/// and this function doesn't zero it out.
/// and this function doesn't zero it out. Similarly, if `success` is true consider checking the return data size
/// (e.g., with `returnDataSize()`) to avoid reading memory already allocated.
function staticcallReturn64Bytes(
address target,
bytes memory data
Expand All @@ -81,7 +83,8 @@ library LowLevelCall {
/// in the scratch space of memory. Useful for functions that return a tuple with two single-word values.
///
/// WARNING: Do not assume that the results are zero if `success` is false. Memory can be already allocated
/// and this function doesn't zero it out.
/// and this function doesn't zero it out. Similarly, if `success` is true consider checking the return data size
/// (e.g., with `returnDataSize()`) to avoid reading memory already allocated.
function delegatecallReturn64Bytes(
address target,
bytes memory data
Expand Down