Skip to main content

Crate bobcat_call

Crate bobcat_call 

Source

Functions§

addr_has_code
call_bool
Invoke call, only reading a single byte at the first word for a check.
call_bool_opt
Invoke call, only reading a single byte at the first word for a check. Returns Some if success.
call_err_slice
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.
call_partial
Call a contract with the given parameters. Returns a tuple of (success, return_data_length).
call_slice
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, and the slice isn’t read to if a revert happens.
call_slice_opt
Same as the other slice function, though returning Option if error.
call_slice_res
Same as the other slice function, returning Result depending on return or revert.
call_unit
Call a contract, ignoring its returndata. Returns true if contract invoked successfully.
call_unit_opt
Call a contract, ignoring its returndata. Returns Some(()) if the contract invoked successfully.
call_word
Call a contract, returning a word of the returndata/revertdata. Complains if the other party does not write exactly a word, regardless of the reason!
delegate_call_bool
Invoke call, only reading a single byte at the first word for a check.
delegate_call_bool_opt
Invoke call, only reading a single byte at the first word for a check. Returns Some if success.
delegate_call_err_slice
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.
delegate_call_partial
Call a contract with the given parameters. Returns a tuple of (success, return_data_length).
delegate_call_slice
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, and the slice isn’t read to if a revert happens.
delegate_call_slice_opt
Same as the other slice function, though returning Option if error.
delegate_call_slice_res
Same as the other slice function, returning Result depending on return or revert.
delegate_call_unit
Call a contract, ignoring its returndata. Returns true if contract invoked successfully.
delegate_call_unit_opt
Call a contract, ignoring its returndata. Returns Some(()) if the contract invoked successfully.
delegate_call_word
Call a contract, returning a word of the returndata/revertdata. Complains if the other party does not write exactly a word, regardless of the reason!
read_return_data_slice
safe_call_bool
Check the codesize before invoking call, only reading a single byte at the location for a bool check. If the contract doesn’t return anything, then we assume everything went okay. If it does, then we check for true. We don’t return anything.
safe_call_bool_opt
Check the codesize before invoking call, returning a Option<()> if the contract call worked, and the return value is true.
safe_call_slice
Same as the slice variant, except check the length of the code for the address first. If code doesn’t exist, then we return None.
safe_delegate_call_bool
Check the codesize before invoking call, only reading a single byte at the location for a bool check. If the contract doesn’t return anything, then we assume everything went okay. If it does, then we check for true. We don’t return anything.
safe_delegate_call_bool_opt
Check the codesize before invoking call, returning a Option<()> if the contract call worked, and the return value is true.
safe_delegate_call_slice
Same as the slice variant, except check the length of the code for the address first. If code doesn’t exist, then we return None.
safe_static_call_bool
Check the codesize before invoking call, only reading a single byte at the location for a bool check. If the contract doesn’t return anything, then we assume everything went okay. If it does, then we check for true. We don’t return anything.
safe_static_call_bool_opt
Check the codesize before invoking call, returning a Option<()> if the contract call worked, and the return value is true.
safe_static_call_slice
Same as the slice variant, except check the length of the code for the address first. If code doesn’t exist, then we return None.
static_call_bool
Invoke call, only reading a single byte at the first word for a check.
static_call_bool_opt
Invoke call, only reading a single byte at the first word for a check. Returns Some if success.
static_call_err_slice
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.
static_call_partial
Call a contract with the given parameters. Returns a tuple of (success, return_data_length).
static_call_slice
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, and the slice isn’t read to if a revert happens.
static_call_slice_opt
Same as the other slice function, though returning Option if error.
static_call_slice_res
Same as the other slice function, returning Result depending on return or revert.
static_call_unit
Call a contract, ignoring its returndata. Returns true if contract invoked successfully.
static_call_unit_opt
Call a contract, ignoring its returndata. Returns Some(()) if the contract invoked successfully.
static_call_word
Call a contract, returning a word of the returndata/revertdata. Complains if the other party does not write exactly a word, regardless of the reason!