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>
fn decode<R>(reader: &mut R) -> Result<ContractOp, CodeEofError>
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>
fn isa_ids() -> BTreeSet<&'static str>
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
Source§fn isa_string() -> String
fn isa_string() -> String
Source§fn isa_id() -> Box<[u8]>
fn isa_id() -> Box<[u8]>
Source§fn is_supported(id: &str) -> bool
fn is_supported(id: &str) -> bool
Source§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 for ContractOp
impl PartialEq for ContractOp
Source§impl PartialOrd for ContractOp
impl PartialOrd for ContractOp
impl Copy for ContractOp
impl Eq for ContractOp
impl StructuralPartialEq for ContractOp
Auto Trait Implementations§
impl Freeze for ContractOp
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.