Skip to main content

delegate_call_err_slice

Function delegate_call_err_slice 

Source
pub fn delegate_call_err_slice<const DATA_CAP: usize>(
    contract: [u8; 20],
    calldata: &[u8],
    gas: u64,
    offset: usize,
) -> (bool, usize, [u8; DATA_CAP])
Expand description

Call a contract, writing its returndata to the slice given. Returns true for if the contract ran without issue, or false if a revert happened. An offset can be used to start reading the return data from, writing to the buffer given. The code will not read from the offset given if a revert has happened. The function will panic if the returndata exceeds the capacity. Enforces write control if static, and delegates if delegatecall. The function will also panic if the offset is greater than the size of the returndata. Programmers making this mistake must be making an error with the decoding.