Enum rgbstd::vm::ContractOp
source · pub enum ContractOp {
CnP(u16, Reg16),
CnS(u16, Reg16),
CnG(u16, Reg16),
CnC(u16, Reg16),
LdP(u16, u16, RegS),
LdS(u16, u16, RegS),
LdF(u16, u16, Reg16),
LdG(u16, u8, RegS),
LdC(u16, u16, RegS),
LdM(RegS),
PcVs(u16),
Fail(u8),
}Variants§
CnP(u16, Reg16)
Counts number of inputs (previous state entries) of the provided type
and assigns the number to the destination a16 register.
CnS(u16, Reg16)
Counts number of outputs (owned state entries) of the provided type
and assigns the number to the destination a16 register.
CnG(u16, Reg16)
Counts number of inputs (previous state entries) of the provided type
and assigns the number to the destination a8 register.
CnC(u16, Reg16)
Counts number of inputs (previous state entries) of the provided type
and assigns the number to the destination a16 register.
LdP(u16, u16, RegS)
Loads input (previous) state with type id from the first argument and index from the second argument into a register provided in the third argument.
If the state is absent or is not a structured state sets st0 to
false and terminates the program.
If the state at the index is concealed, sets destination to None.
LdS(u16, u16, RegS)
Loads owned structured state with type id from the first argument and index from the second argument into a register provided in the third argument.
If the state is absent or is not a structured state sets st0 to
false and terminates the program.
If the state at the index is concealed, sets destination to None.
LdF(u16, u16, Reg16)
Loads owned fungible state with type id from the first argument and
index from the second argument into a64 register provided in the third
argument.
If the state is absent or is not a fungible state sets st0 to
false and terminates the program.
If the state at the index is concealed, sets destination to None.
LdG(u16, u8, RegS)
Loads global state from the current operation with type id from the first argument and index from the second argument into a register provided in the third argument.
If the state is absent sets st0 to false and terminates the program.
LdC(u16, u16, RegS)
Loads part of the contract global state with type id from the first argument at the depth from the second argument into a register provided in the third argument.
If the state is absent or concealed sets destination to None.
Does not modify content of st0 register.
LdM(RegS)
Loads operation metadata into a register provided in the third argument.
If the operation doesn’t have metadata sets destination to None.
Does not modify content of st0 register.
PcVs(u16)
Verify sum of pedersen commitments from inputs and outputs.
The only argument specifies owned state type for the sum operation. If
this state does not exists, either inputs or outputs does not have
any data for the state, or the state is not
of FungibleState::Bits64 fails the verification.
If verification succeeds, doesn’t changes st0 value; otherwise sets it
to false.
Fail(u8)
All other future unsupported operations, which must set st0 to
false.
Trait Implementations§
source§impl Bytecode for ContractOp
impl Bytecode for ContractOp
source§fn byte_count(&self) -> u16
fn byte_count(&self) -> u16
source§fn instr_range() -> RangeInclusive<u8>
fn instr_range() -> RangeInclusive<u8>
source§fn instr_byte(&self) -> u8
fn instr_byte(&self) -> u8
source§fn encode_args<W>(&self, writer: &mut W) -> Result<(), BytecodeError>where
W: Write,
fn encode_args<W>(&self, writer: &mut W) -> Result<(), BytecodeError>where W: Write,
source§fn decode<R>(reader: &mut R) -> Result<ContractOp, CodeEofError>where
ContractOp: Sized,
R: Read,
fn decode<R>(reader: &mut R) -> Result<ContractOp, CodeEofError>where ContractOp: Sized, R: Read,
source§impl Clone for ContractOp
impl Clone for ContractOp
source§fn clone(&self) -> ContractOp
fn clone(&self) -> ContractOp
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ContractOp
impl Debug for ContractOp
source§impl Display for ContractOp
impl Display for ContractOp
source§impl Hash for ContractOp
impl Hash for ContractOp
source§impl InstructionSet for ContractOp
impl InstructionSet for ContractOp
source§fn isa_ids() -> BTreeSet<&'static str, Global>
fn isa_ids() -> BTreeSet<&'static str, Global>
source§fn exec(
&self,
regs: &mut CoreRegs,
site: LibSite,
context: &<ContractOp as InstructionSet>::Context<'_>
) -> ExecStep
fn exec( &self, regs: &mut CoreRegs, site: LibSite, context: &<ContractOp as InstructionSet>::Context<'_> ) -> ExecStep
§fn isa_string() -> String
fn isa_string() -> String
§fn isa_id() -> Box<[u8], Global>
fn isa_id() -> Box<[u8], Global>
§fn is_supported(id: &str) -> bool
fn is_supported(id: &str) -> bool
§fn complexity(&self) -> u64
fn complexity(&self) -> u64
source§impl Ord for ContractOp
impl Ord for ContractOp
source§fn cmp(&self, other: &ContractOp) -> Ordering
fn cmp(&self, other: &ContractOp) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<ContractOp> for ContractOp
impl PartialEq<ContractOp> for ContractOp
source§fn eq(&self, other: &ContractOp) -> bool
fn eq(&self, other: &ContractOp) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd<ContractOp> for ContractOp
impl PartialOrd<ContractOp> for ContractOp
source§fn partial_cmp(&self, other: &ContractOp) -> Option<Ordering>
fn partial_cmp(&self, other: &ContractOp) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self and other) and is used by the <=
operator. Read moreimpl Copy for ContractOp
impl Eq for ContractOp
impl StructuralEq for ContractOp
impl StructuralPartialEq for ContractOp
Auto Trait Implementations§
impl RefUnwindSafe for ContractOp
impl Send for ContractOp
impl Sync for ContractOp
impl Unpin for ContractOp
impl UnwindSafe for ContractOp
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.