Class Logic
Logic class provides static checkProgram function that can be used for client-side program validation for size and execution cost.
Inheritance
object
Logic
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Algorand.Utils
Assembly: Algorand.dll
Syntax
public class Logic
Constructors
| Improve this Doc View SourceLogic()
Declaration
public Logic()
Methods
| Improve this Doc View SourceCheckProgram(byte[], List<byte[]>)
Performs basic program validation: instruction count and program cost
Declaration
public static bool CheckProgram(byte[] program, List<byte[]> args)
Parameters
Type | Name | Description |
---|---|---|
byte[] | program | |
System.Collections.Generic.List<T><byte[]> | args |
Returns
Type | Description |
---|---|
bool |
GetEvalMaxVersion()
Retrieves max supported version of TEAL evaluator
Declaration
public static int GetEvalMaxVersion()
Returns
Type | Description |
---|---|
int |
GetLogicSigVersion()
TEAL supported version
Declaration
public static int GetLogicSigVersion()
Returns
Type | Description |
---|---|
int | int |
GetUVarint(byte[], int)
Given a varint, get the integer value
Declaration
public static VarintResult GetUVarint(byte[] buffer, int bufferOffset)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | serialized varint |
int | bufferOffset | position in the buffer to start reading from |
Returns
Type | Description |
---|---|
VarintResult | pair of values in in array: value, read size |
ReadByteConstBlock(byte[], int)
Declaration
public static ByteConstBlock ReadByteConstBlock(byte[] program, int pc)
Parameters
Type | Name | Description |
---|---|---|
byte[] | program | |
int | pc |
Returns
Type | Description |
---|---|
ByteConstBlock |
ReadIntConstBlock(byte[], int)
Declaration
public static IntConstBlock ReadIntConstBlock(byte[] program, int pc)
Parameters
Type | Name | Description |
---|---|---|
byte[] | program | |
int | pc |
Returns
Type | Description |
---|---|
IntConstBlock |
ReadProgram(byte[], List<byte[]>)
Performs basic program validation: instruction count and program cost
Declaration
public static ProgramData ReadProgram(byte[] program, List<byte[]> args)
Parameters
Type | Name | Description |
---|---|---|
byte[] | program | program Program to validate |
System.Collections.Generic.List<T><byte[]> | args | Program arguments to validate |
Returns
Type | Description |
---|---|
ProgramData |
ReadPushByteOp(byte[], int)
Declaration
protected static ByteConstBlock ReadPushByteOp(byte[] program, int pc)
Parameters
Type | Name | Description |
---|---|---|
byte[] | program | |
int | pc |
Returns
Type | Description |
---|---|
ByteConstBlock |
ReadPushIntOp(byte[], int)
Declaration
protected static IntConstBlock ReadPushIntOp(byte[] program, int pc)
Parameters
Type | Name | Description |
---|---|---|
byte[] | program | |
int | pc |
Returns
Type | Description |
---|---|
IntConstBlock |