#[repr(u8)]pub enum WeirollCommandFlags {
DelegateCall = 0,
Call = 1,
StaticCall = 2,
CallWithValue = 3,
}Expand description
Flags that modify the execution mode of a Weiroll command.
These correspond to the EVM opcodes used when the Weiroll executor
invokes each command’s target contract. The call-type variants live in
the lower 2 bits; combine them with the associated CALLTYPE_MASK,
EXTENDED_COMMAND, and TUPLE_RETURN constants using bitwise
operations.
§Example
use cow_weiroll::WeirollCommandFlags;
let flags = WeirollCommandFlags::Call;
assert_eq!(flags as u8, 0x01);
assert_eq!(flags as u8 & WeirollCommandFlags::CALLTYPE_MASK, WeirollCommandFlags::Call as u8,);Variants§
DelegateCall = 0
Execute via DELEGATECALL opcode (library calls).
Call = 1
Execute via CALL opcode (standard external calls).
StaticCall = 2
Execute via STATICCALL opcode (read-only calls).
CallWithValue = 3
Execute via CALL with an explicit value transfer; the first
argument is interpreted as the ETH value to send.
Implementations§
Source§impl WeirollCommandFlags
impl WeirollCommandFlags
Sourcepub const CALLTYPE_MASK: u8 = 0x03
pub const CALLTYPE_MASK: u8 = 0x03
Bitmask that isolates the call-type bits from other flag bits.
Sourcepub const EXTENDED_COMMAND: u8 = 0x40
pub const EXTENDED_COMMAND: u8 = 0x40
Marks an extended command that uses an additional 32-byte word for argument slot indices (internal use).
Sourcepub const TUPLE_RETURN: u8 = 0x80
pub const TUPLE_RETURN: u8 = 0x80
Signals that the return value should be ABI-wrapped as bytes
so that multi-return functions can be captured (internal use).
Trait Implementations§
Source§impl Clone for WeirollCommandFlags
impl Clone for WeirollCommandFlags
Source§fn clone(&self) -> WeirollCommandFlags
fn clone(&self) -> WeirollCommandFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more