interpreter

package
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentEncodingVersion uint16 = 5
View Source
const Fix64MaxValue = math.MaxInt64
View Source
const UFix64MaxValue = math.MaxUint64
View Source
const VersionEncodingLength = 2

Variables

View Source
var Magic = []byte{0x0, 0xCA, 0xDE}

Magic is the prefix that is added to all encoded values

View Source
var MagicLength = len(Magic)

Functions

func ByteArrayValueToByteSlice added in v0.2.0

func ByteArrayValueToByteSlice(value Value) ([]byte, error)

func ByteValueToByte added in v0.2.0

func ByteValueToByte(element Value) (byte, error)

func ConvertStaticToSemaType

func ConvertStaticToSemaType(
	typ StaticType,
	getInterface func(location common.Location, qualifiedIdentifier string) *sema.InterfaceType,
	getComposite func(location common.Location, qualifiedIdentifier string) *sema.CompositeType,
) sema.Type

func HasMagic added in v0.7.0

func HasMagic(data []byte) bool

HasMagic tests whether the given data begins with the magic prefix.

func InspectValue added in v0.19.0

func InspectValue(value Value, f func(Value) bool)

func PrependMagic added in v0.7.0

func PrependMagic(unprefixedData []byte, version uint16) (result []byte)

PrependMagic returns the given data with the magic prefix. The function does *not* check if the data already has the prefix.

func SignedBigIntToBigEndianBytes added in v0.5.0

func SignedBigIntToBigEndianBytes(bigInt *big.Int) []byte

func StorageKey added in v0.15.0

func StorageKey(path PathValue) string

StorageKey returns the storage identifier with the proper prefix for the given path.

\x1F = Information Separator One

func StripMagic added in v0.7.0

func StripMagic(data []byte) (trimmed []byte, version uint16)

StripMagic returns the given data with the magic prefix and version removed.

If the data doesn't start with Magic, the data is returned unchanged and the version is 0.

func UnsignedBigIntToBigEndianBytes added in v0.5.0

func UnsignedBigIntToBigEndianBytes(bigInt *big.Int) []byte

func WalkValue added in v0.19.0

func WalkValue(walker ValueWalker, value Value)

WalkValue traverses a Value object graph in depth-first order: It starts by calling valueWalker.WalkValue(value); If the returned walker is nil, child values are not walked. If the returned walker is not-nil, then WalkValue is invoked recursively on this returned walker for each of the non-nil children of the value, followed by a call of WalkValue(nil) on the returned walker.

The initial walker may not be nil.

Types

type AccountHandlerFunc added in v0.15.0

type AccountHandlerFunc func(
	address AddressValue,
) *CompositeValue

AccountHandlerFunc is a function that handles retrieving a public account at a given address. The account returned must be of type `PublicAccount`.

type AddressDynamicType

type AddressDynamicType struct{}

func (AddressDynamicType) IsDynamicType

func (AddressDynamicType) IsDynamicType()

func (AddressDynamicType) IsImportable added in v0.18.0

func (AddressDynamicType) IsImportable() bool

type AddressValue

type AddressValue common.Address

func ConvertAddress

func ConvertAddress(value Value) AddressValue

func NewAddressValue

func NewAddressValue(a common.Address) AddressValue

func NewAddressValueFromBytes

func NewAddressValueFromBytes(b []byte) AddressValue

func (AddressValue) Accept added in v0.12.0

func (v AddressValue) Accept(interpreter *Interpreter, visitor Visitor)

func (AddressValue) ConformsToDynamicType added in v0.15.0

func (v AddressValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (AddressValue) Copy

func (v AddressValue) Copy() Value

func (AddressValue) DynamicType

func (AddressValue) Equal

func (v AddressValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (AddressValue) GetMember added in v0.3.0

func (v AddressValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (AddressValue) GetOwner

func (AddressValue) GetOwner() *common.Address

func (AddressValue) Hex

func (v AddressValue) Hex() string

func (AddressValue) IsModified added in v0.3.0

func (AddressValue) IsModified() bool

func (AddressValue) IsStorable added in v0.16.0

func (AddressValue) IsStorable() bool

func (AddressValue) IsValue

func (AddressValue) IsValue()

func (AddressValue) KeyString

func (v AddressValue) KeyString() string

func (AddressValue) RecursiveString added in v0.17.0

func (v AddressValue) RecursiveString(_ SeenReferences) string

func (AddressValue) SetMember added in v0.3.0

func (AddressValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (AddressValue) SetModified added in v0.3.0

func (AddressValue) SetModified(_ bool)

func (AddressValue) SetOwner

func (AddressValue) SetOwner(_ *common.Address)

func (AddressValue) StaticType added in v0.12.0

func (AddressValue) StaticType() StaticType

func (AddressValue) String

func (v AddressValue) String() string

func (AddressValue) ToAddress

func (v AddressValue) ToAddress() common.Address

func (AddressValue) Walk added in v0.19.0

func (AddressValue) Walk(_ func(Value))

type AllAppendableValue added in v0.15.0

type AllAppendableValue interface {
	Value
	AppendAll(inter *Interpreter, getLocationRange func() LocationRange, other AllAppendableValue)
}

type ArgumentCountError

type ArgumentCountError struct {
	ParameterCount int
	ArgumentCount  int
}

func (ArgumentCountError) Error

func (e ArgumentCountError) Error() string

type ArrayDynamicType

type ArrayDynamicType struct {
	ElementTypes []DynamicType
	StaticType   ArrayStaticType
}

func (*ArrayDynamicType) IsDynamicType

func (*ArrayDynamicType) IsDynamicType()

func (*ArrayDynamicType) IsImportable added in v0.18.0

func (t *ArrayDynamicType) IsImportable() bool

type ArrayIndexOutOfBoundsError added in v0.9.2

type ArrayIndexOutOfBoundsError struct {
	Index int
	Size  int
	LocationRange
}

ArrayIndexOutOfBoundsError

func (ArrayIndexOutOfBoundsError) Error added in v0.9.2

type ArrayStaticType added in v0.19.0

type ArrayStaticType interface {
	StaticType

	ElementType() StaticType
	// contains filtered or unexported methods
}

func ConvertSemaArrayTypeToStaticArrayType added in v0.19.0

func ConvertSemaArrayTypeToStaticArrayType(t sema.ArrayType) ArrayStaticType

type ArrayValue

type ArrayValue struct {
	Type ArrayStaticType

	Owner *common.Address
	// contains filtered or unexported fields
}

func ByteSliceToByteArrayValue added in v0.2.0

func ByteSliceToByteArrayValue(buf []byte) *ArrayValue

func NewArrayValueUnownedNonCopying

func NewArrayValueUnownedNonCopying(arrayType ArrayStaticType, values ...Value) *ArrayValue

func NewDeferredArrayValue added in v0.16.0

func NewDeferredArrayValue(
	path []string,
	content []byte,
	owner *common.Address,
	callback DecodingCallback,
	version uint16,
) *ArrayValue

func (*ArrayValue) Accept added in v0.12.0

func (v *ArrayValue) Accept(interpreter *Interpreter, visitor Visitor)

func (*ArrayValue) Append

func (v *ArrayValue) Append(inter *Interpreter, getLocationRange func() LocationRange, element Value)

func (*ArrayValue) AppendAll added in v0.15.0

func (v *ArrayValue) AppendAll(inter *Interpreter, getLocationRange func() LocationRange, other AllAppendableValue)

func (*ArrayValue) Concat

func (v *ArrayValue) Concat(other ConcatenatableValue) Value

func (*ArrayValue) ConformsToDynamicType added in v0.15.0

func (v *ArrayValue) ConformsToDynamicType(
	interpreter *Interpreter,
	dynamicType DynamicType,
	results TypeConformanceResults,
) bool

func (*ArrayValue) Contains

func (v *ArrayValue) Contains(needleValue Value) BoolValue

func (*ArrayValue) Copy

func (v *ArrayValue) Copy() Value

func (*ArrayValue) Count

func (v *ArrayValue) Count() int

func (*ArrayValue) Destroy

func (v *ArrayValue) Destroy(interpreter *Interpreter, getLocationRange func() LocationRange)

func (*ArrayValue) DynamicType

func (v *ArrayValue) DynamicType(interpreter *Interpreter, seenReferences SeenReferences) DynamicType

func (*ArrayValue) Elements added in v0.16.0

func (v *ArrayValue) Elements() []Value

func (*ArrayValue) Equal added in v0.15.0

func (v *ArrayValue) Equal(other Value, interpreter *Interpreter, loadDeferred bool) bool

func (*ArrayValue) Get

func (v *ArrayValue) Get(_ *Interpreter, getLocationRange func() LocationRange, key Value) Value

func (*ArrayValue) GetMember

func (v *ArrayValue) GetMember(inter *Interpreter, getLocationRange func() LocationRange, name string) Value

func (*ArrayValue) GetOwner

func (v *ArrayValue) GetOwner() *common.Address

func (*ArrayValue) Insert

func (v *ArrayValue) Insert(inter *Interpreter, getLocationRange func() LocationRange, index int, element Value)

func (*ArrayValue) IsModified added in v0.3.0

func (v *ArrayValue) IsModified() bool

func (*ArrayValue) IsStorable added in v0.16.0

func (v *ArrayValue) IsStorable() bool

func (*ArrayValue) IsValue

func (*ArrayValue) IsValue()

func (*ArrayValue) RecursiveString added in v0.17.0

func (v *ArrayValue) RecursiveString(seenReferences SeenReferences) string

func (*ArrayValue) Remove

func (v *ArrayValue) Remove(index int, getLocationRange func() LocationRange) Value

TODO: unset owner?

func (*ArrayValue) RemoveFirst

func (v *ArrayValue) RemoveFirst(getLocationRange func() LocationRange) Value

TODO: unset owner?

func (*ArrayValue) RemoveLast

func (v *ArrayValue) RemoveLast(getLocationRange func() LocationRange) Value

TODO: unset owner?

func (*ArrayValue) Set

func (v *ArrayValue) Set(inter *Interpreter, getLocationRange func() LocationRange, key Value, value Value)

func (*ArrayValue) SetIndex added in v0.2.1

func (v *ArrayValue) SetIndex(inter *Interpreter, getLocationRange func() LocationRange, index int, value Value)

func (*ArrayValue) SetMember

func (v *ArrayValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (*ArrayValue) SetModified added in v0.2.1

func (v *ArrayValue) SetModified(modified bool)

func (*ArrayValue) SetOwner

func (v *ArrayValue) SetOwner(owner *common.Address)

func (*ArrayValue) StaticType added in v0.12.0

func (v *ArrayValue) StaticType() StaticType

func (*ArrayValue) String

func (v *ArrayValue) String() string

func (*ArrayValue) Walk added in v0.19.0

func (v *ArrayValue) Walk(walkChild func(Value))

type BigNumberValue

type BigNumberValue interface {
	NumberValue
	ToBigInt() *big.Int
}

BigNumberValue. Implemented by values with an integer value outside the range of int64

type BlockDynamicType added in v0.12.0

type BlockDynamicType struct{}

func (BlockDynamicType) IsDynamicType added in v0.12.0

func (BlockDynamicType) IsDynamicType()

func (BlockDynamicType) IsImportable added in v0.18.0

func (BlockDynamicType) IsImportable() bool

type BlockValue added in v0.12.0

type BlockValue struct {
	Height    UInt64Value
	View      UInt64Value
	ID        *ArrayValue
	Timestamp UFix64Value
}

func (BlockValue) Accept added in v0.12.0

func (v BlockValue) Accept(interpreter *Interpreter, visitor Visitor)

func (BlockValue) ConformsToDynamicType added in v0.15.0

func (v BlockValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (BlockValue) Copy added in v0.12.0

func (v BlockValue) Copy() Value

func (BlockValue) DynamicType added in v0.12.0

func (BlockValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (BlockValue) GetMember added in v0.12.0

func (v BlockValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (BlockValue) GetOwner added in v0.12.0

func (BlockValue) GetOwner() *common.Address

func (BlockValue) IDAsByteArray added in v0.12.0

func (v BlockValue) IDAsByteArray() [sema.BlockIDSize]byte

func (BlockValue) IsModified added in v0.12.0

func (BlockValue) IsModified() bool

func (BlockValue) IsStorable added in v0.16.0

func (BlockValue) IsStorable() bool

func (BlockValue) IsValue added in v0.12.0

func (BlockValue) IsValue()

func (BlockValue) RecursiveString added in v0.17.0

func (v BlockValue) RecursiveString(seenReferences SeenReferences) string

func (BlockValue) SetMember added in v0.12.0

func (v BlockValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (BlockValue) SetModified added in v0.12.0

func (BlockValue) SetModified(_ bool)

func (BlockValue) SetOwner added in v0.12.0

func (BlockValue) SetOwner(_ *common.Address)

func (BlockValue) StaticType added in v0.12.0

func (BlockValue) StaticType() StaticType

func (BlockValue) String added in v0.12.0

func (v BlockValue) String() string

func (BlockValue) Walk added in v0.19.0

func (v BlockValue) Walk(walkChild func(Value))

type BoolDynamicType

type BoolDynamicType struct{}

func (BoolDynamicType) IsDynamicType

func (BoolDynamicType) IsDynamicType()

func (BoolDynamicType) IsImportable added in v0.18.0

func (BoolDynamicType) IsImportable() bool

type BoolValue

type BoolValue bool

func (BoolValue) Accept added in v0.12.0

func (v BoolValue) Accept(interpreter *Interpreter, visitor Visitor)

func (BoolValue) ConformsToDynamicType added in v0.15.0

func (v BoolValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (BoolValue) Copy

func (v BoolValue) Copy() Value

func (BoolValue) DynamicType

func (BoolValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (BoolValue) Equal

func (v BoolValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (BoolValue) GetOwner

func (BoolValue) GetOwner() *common.Address

func (BoolValue) IsModified added in v0.3.0

func (BoolValue) IsModified() bool

func (BoolValue) IsStorable added in v0.16.0

func (BoolValue) IsStorable() bool

func (BoolValue) IsValue

func (BoolValue) IsValue()

func (BoolValue) KeyString

func (v BoolValue) KeyString() string

func (BoolValue) Negate

func (v BoolValue) Negate() BoolValue

func (BoolValue) RecursiveString added in v0.17.0

func (v BoolValue) RecursiveString(_ SeenReferences) string

func (BoolValue) SetModified added in v0.3.0

func (BoolValue) SetModified(_ bool)

func (BoolValue) SetOwner

func (BoolValue) SetOwner(_ *common.Address)

func (BoolValue) StaticType added in v0.12.0

func (BoolValue) StaticType() StaticType

func (BoolValue) String

func (v BoolValue) String() string

func (BoolValue) Walk added in v0.19.0

func (BoolValue) Walk(_ func(Value))

type BoundFunctionValue

type BoundFunctionValue struct {
	Function FunctionValue
	Self     *CompositeValue
}

BoundFunctionValue

func (BoundFunctionValue) Accept added in v0.12.0

func (f BoundFunctionValue) Accept(interpreter *Interpreter, visitor Visitor)

func (BoundFunctionValue) ConformsToDynamicType added in v0.15.0

func (f BoundFunctionValue) ConformsToDynamicType(
	interpreter *Interpreter,
	dynamicType DynamicType,
	results TypeConformanceResults,
) bool

func (BoundFunctionValue) Copy

func (f BoundFunctionValue) Copy() Value

func (BoundFunctionValue) DynamicType

func (BoundFunctionValue) GetOwner

func (BoundFunctionValue) GetOwner() *common.Address

func (BoundFunctionValue) IsModified added in v0.3.0

func (BoundFunctionValue) IsModified() bool

func (BoundFunctionValue) IsStorable added in v0.16.0

func (BoundFunctionValue) IsStorable() bool

func (BoundFunctionValue) IsValue

func (BoundFunctionValue) IsValue()

func (BoundFunctionValue) RecursiveString added in v0.17.0

func (f BoundFunctionValue) RecursiveString(seenReferences SeenReferences) string

func (BoundFunctionValue) SetModified added in v0.3.0

func (BoundFunctionValue) SetModified(_ bool)

func (BoundFunctionValue) SetOwner

func (BoundFunctionValue) SetOwner(_ *common.Address)

func (BoundFunctionValue) StaticType added in v0.12.0

func (f BoundFunctionValue) StaticType() StaticType

func (BoundFunctionValue) String added in v0.2.0

func (f BoundFunctionValue) String() string

func (BoundFunctionValue) Walk added in v0.19.0

func (f BoundFunctionValue) Walk(_ func(Value))

type CapabilityDynamicType

type CapabilityDynamicType struct {
	BorrowType *sema.ReferenceType
}

func (CapabilityDynamicType) IsDynamicType

func (CapabilityDynamicType) IsDynamicType()

func (CapabilityDynamicType) IsImportable added in v0.18.0

func (CapabilityDynamicType) IsImportable() bool

type CapabilityStaticType added in v0.5.0

type CapabilityStaticType struct {
	BorrowType StaticType
}

func (CapabilityStaticType) Equal added in v0.15.0

func (t CapabilityStaticType) Equal(other StaticType) bool

func (CapabilityStaticType) String added in v0.5.0

func (t CapabilityStaticType) String() string

type CapabilityValue

type CapabilityValue struct {
	Address    AddressValue
	Path       PathValue
	BorrowType StaticType
}

func (CapabilityValue) Accept added in v0.12.0

func (v CapabilityValue) Accept(interpreter *Interpreter, visitor Visitor)

func (CapabilityValue) ConformsToDynamicType added in v0.15.0

func (v CapabilityValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (CapabilityValue) Copy

func (v CapabilityValue) Copy() Value

func (CapabilityValue) Destroy

func (v CapabilityValue) Destroy(_ *Interpreter, _ func() LocationRange)

func (CapabilityValue) DynamicType

func (v CapabilityValue) DynamicType(inter *Interpreter, _ SeenReferences) DynamicType

func (CapabilityValue) Equal added in v0.15.0

func (v CapabilityValue) Equal(other Value, interpreter *Interpreter, loadDeferred bool) bool

func (CapabilityValue) GetMember

func (v CapabilityValue) GetMember(inter *Interpreter, _ func() LocationRange, name string) Value

func (CapabilityValue) GetOwner

func (CapabilityValue) GetOwner() *common.Address

func (CapabilityValue) IsModified added in v0.3.0

func (CapabilityValue) IsModified() bool

func (CapabilityValue) IsStorable added in v0.16.0

func (CapabilityValue) IsStorable() bool

func (CapabilityValue) IsValue

func (CapabilityValue) IsValue()

func (CapabilityValue) RecursiveString added in v0.17.0

func (v CapabilityValue) RecursiveString(seenReferences SeenReferences) string

func (CapabilityValue) SetMember

func (CapabilityValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (CapabilityValue) SetModified added in v0.3.0

func (CapabilityValue) SetModified(_ bool)

func (CapabilityValue) SetOwner

func (CapabilityValue) SetOwner(_ *common.Address)

func (CapabilityValue) StaticType added in v0.12.0

func (v CapabilityValue) StaticType() StaticType

func (CapabilityValue) String

func (v CapabilityValue) String() string

func (CapabilityValue) Walk added in v0.19.0

func (v CapabilityValue) Walk(walkChild func(Value))

type CompositeDynamicType

type CompositeDynamicType struct {
	StaticType sema.Type
}

func (CompositeDynamicType) IsDynamicType

func (CompositeDynamicType) IsDynamicType()

func (CompositeDynamicType) IsImportable added in v0.18.0

func (t CompositeDynamicType) IsImportable() bool

type CompositeStaticType

type CompositeStaticType struct {
	Location            common.Location
	QualifiedIdentifier string
}

func (CompositeStaticType) Equal added in v0.15.0

func (t CompositeStaticType) Equal(other StaticType) bool

func (CompositeStaticType) String

func (t CompositeStaticType) String() string

type CompositeTypeCode added in v0.5.0

type CompositeTypeCode struct {
	CompositeFunctions map[string]FunctionValue
	DestructorFunction FunctionValue
}

CompositeTypeCode contains the the "prepared" / "callable" "code" for the functions and the destructor of a composite (contract, struct, resource, event).

As there is no support for inheritance of concrete types, these are the "leaf" nodes in the call chain, and are functions.

type CompositeValue

type CompositeValue struct {
	InjectedFields  *StringValueOrderedMap
	ComputedFields  *StringComputedFieldOrderedMap
	NestedVariables *StringVariableOrderedMap
	Functions       map[string]FunctionValue
	Destructor      FunctionValue
	Owner           *common.Address
	// contains filtered or unexported fields
}

func NewAccountKeyValue added in v0.14.0

func NewAccountKeyValue(
	keyIndex IntValue,
	publicKey *CompositeValue,
	hashAlgo *CompositeValue,
	weight UFix64Value,
	isRevoked BoolValue,
) *CompositeValue

NewAccountKeyValue constructs an AccountKey value.

func NewAuthAccountContractsValue added in v0.15.0

func NewAuthAccountContractsValue(
	address AddressValue,
	addFunction FunctionValue,
	updateFunction FunctionValue,
	getFunction FunctionValue,
	removeFunction FunctionValue,
	namesGet func() *ArrayValue,
) *CompositeValue

func NewAuthAccountKeysValue added in v0.14.0

func NewAuthAccountKeysValue(addFunction FunctionValue, getFunction FunctionValue, revokeFunction FunctionValue) *CompositeValue

NewAuthAccountKeysValue constructs a AuthAccount.Keys value.

func NewAuthAccountValue

func NewAuthAccountValue(
	address AddressValue,
	accountBalanceGet func() UFix64Value,
	accountAvailableBalanceGet func() UFix64Value,
	storageUsedGet func(interpreter *Interpreter) UInt64Value,
	storageCapacityGet func() UInt64Value,
	addPublicKeyFunction FunctionValue,
	removePublicKeyFunction FunctionValue,
	contracts *CompositeValue,
	keys *CompositeValue,
) *CompositeValue

NewAuthAccountValue constructs an auth account value.

func NewCompositeValue added in v0.2.1

func NewCompositeValue(
	location common.Location,
	qualifiedIdentifier string,
	kind common.CompositeKind,
	fields *StringValueOrderedMap,
	owner *common.Address,
) *CompositeValue

func NewDeferredCompositeValue added in v0.16.0

func NewDeferredCompositeValue(
	path []string,
	content []byte,
	owner *common.Address,
	decodeCallback DecodingCallback,
	version uint16,
) *CompositeValue

func NewEnumCaseValue added in v0.18.0

func NewEnumCaseValue(
	enumType *sema.CompositeType,
	rawValue NumberValue,
	functions map[string]FunctionValue,
) *CompositeValue

func NewPublicAccountContractsValue added in v0.19.0

func NewPublicAccountContractsValue(
	address AddressValue,
	getFunction FunctionValue,
	namesGet func() *ArrayValue,
) *CompositeValue

func NewPublicAccountKeysValue added in v0.14.0

func NewPublicAccountKeysValue(getFunction FunctionValue) *CompositeValue

NewPublicAccountKeysValue constructs a PublicAccount.Keys value.

func NewPublicAccountValue

func NewPublicAccountValue(
	address AddressValue,
	accountBalanceGet func() UFix64Value,
	accountAvailableBalanceGet func() UFix64Value,
	storageUsedGet func(interpreter *Interpreter) UInt64Value,
	storageCapacityGet func() UInt64Value,
	keys *CompositeValue,
	contracts *CompositeValue,
) *CompositeValue

NewPublicAccountValue constructs a public account value.

func NewPublicKeyValue added in v0.14.0

func NewPublicKeyValue(
	publicKey *ArrayValue,
	signAlgo *CompositeValue,
	validatePublicKey PublicKeyValidationHandlerFunc,
) *CompositeValue

NewPublicKeyValue constructs a PublicKey value.

func (*CompositeValue) Accept added in v0.12.0

func (v *CompositeValue) Accept(interpreter *Interpreter, visitor Visitor)

func (*CompositeValue) ConformsToDynamicType added in v0.15.0

func (v *CompositeValue) ConformsToDynamicType(
	interpreter *Interpreter,
	dynamicType DynamicType,
	results TypeConformanceResults,
) bool

func (*CompositeValue) Copy

func (v *CompositeValue) Copy() Value

func (*CompositeValue) Destroy

func (v *CompositeValue) Destroy(interpreter *Interpreter, getLocationRange func() LocationRange)

func (*CompositeValue) DynamicType

func (v *CompositeValue) DynamicType(interpreter *Interpreter, _ SeenReferences) DynamicType

func (*CompositeValue) Equal added in v0.10.0

func (v *CompositeValue) Equal(other Value, interpreter *Interpreter, loadDeferred bool) bool

func (*CompositeValue) Fields

func (*CompositeValue) GetField

func (v *CompositeValue) GetField(name string) Value

func (*CompositeValue) GetMember

func (v *CompositeValue) GetMember(interpreter *Interpreter, getLocationRange func() LocationRange, name string) Value

func (*CompositeValue) GetOwner

func (v *CompositeValue) GetOwner() *common.Address

func (*CompositeValue) InitializeFunctions added in v0.2.1

func (v *CompositeValue) InitializeFunctions(interpreter *Interpreter)

func (*CompositeValue) IsModified added in v0.3.0

func (v *CompositeValue) IsModified() bool

func (*CompositeValue) IsStorable added in v0.16.0

func (v *CompositeValue) IsStorable() bool

func (*CompositeValue) IsValue

func (*CompositeValue) IsValue()

func (*CompositeValue) KeyString added in v0.10.0

func (v *CompositeValue) KeyString() string

func (*CompositeValue) Kind

func (*CompositeValue) Location

func (v *CompositeValue) Location() common.Location

func (*CompositeValue) OwnerValue

func (v *CompositeValue) OwnerValue(interpreter *Interpreter) OptionalValue

func (*CompositeValue) QualifiedIdentifier added in v0.12.0

func (v *CompositeValue) QualifiedIdentifier() string

func (*CompositeValue) RecursiveString added in v0.17.0

func (v *CompositeValue) RecursiveString(seenReferences SeenReferences) string

func (*CompositeValue) SetMember

func (v *CompositeValue) SetMember(_ *Interpreter, getLocationRange func() LocationRange, name string, value Value)

func (*CompositeValue) SetModified added in v0.3.0

func (v *CompositeValue) SetModified(modified bool)

func (*CompositeValue) SetOwner

func (v *CompositeValue) SetOwner(owner *common.Address)

func (*CompositeValue) StaticType added in v0.12.0

func (v *CompositeValue) StaticType() StaticType

func (*CompositeValue) String

func (v *CompositeValue) String() string

func (*CompositeValue) TypeID

func (v *CompositeValue) TypeID() common.TypeID

func (*CompositeValue) Walk added in v0.19.0

func (v *CompositeValue) Walk(walkChild func(Value))

type ComputedField added in v0.13.5

type ComputedField func(*Interpreter) Value

type ConcatenatableValue

type ConcatenatableValue interface {
	Value
	Concat(other ConcatenatableValue) Value
}

type ConditionError

type ConditionError struct {
	ConditionKind ast.ConditionKind
	Message       string
	LocationRange
}

func (ConditionError) Error

func (e ConditionError) Error() string

type ConstantSizedStaticType

type ConstantSizedStaticType struct {
	Type StaticType
	Size int64
}

func (ConstantSizedStaticType) ElementType added in v0.19.0

func (t ConstantSizedStaticType) ElementType() StaticType

func (ConstantSizedStaticType) Equal added in v0.15.0

func (t ConstantSizedStaticType) Equal(other StaticType) bool

func (ConstantSizedStaticType) String

func (t ConstantSizedStaticType) String() string

type ContainerMutationError added in v0.19.0

type ContainerMutationError struct {
	ExpectedType sema.Type
	LocationRange
}

ContainerMutationError

func (ContainerMutationError) Error added in v0.19.0

func (e ContainerMutationError) Error() string

type ContractValueHandlerFunc

type ContractValueHandlerFunc func(
	inter *Interpreter,
	compositeType *sema.CompositeType,
	constructor FunctionValue,
	invocationRange ast.Range,
) *CompositeValue

ContractValueHandlerFunc is a function that handles contract values.

type CyclicLinkError

type CyclicLinkError struct {
	Address common.Address
	Paths   []PathValue
	LocationRange
}

CyclicLinkError

func (CyclicLinkError) Error

func (e CyclicLinkError) Error() string

type DecoderV4 added in v0.15.0

type DecoderV4 struct {
	// contains filtered or unexported fields
}

A DecoderV4 decodes CBOR-encoded representations of values. It can decode storage format version 4 and later.

func NewByteDecoderV4 added in v0.19.0

func NewByteDecoderV4(
	data []byte,
	owner *common.Address,
	version uint16,
	decodeCallback DecodingCallback,
) (
	*DecoderV4,
	error,
)

func NewDecoderV4 added in v0.19.0

func NewDecoderV4(
	reader io.Reader,
	owner *common.Address,
	version uint16,
	decodeCallback DecodingCallback,
) (
	*DecoderV4,
	error,
)

NewDecoder initializes a DecoderV4 that will decode CBOR-encoded bytes from the given io.Reader.

It sets the given address as the owner (can be `nil`).

func (*DecoderV4) Decode added in v0.15.0

func (d *DecoderV4) Decode(path []string) (Value, error)

Decode reads CBOR-encoded bytes and decodes them to a value.

type DecoderV5 added in v0.19.0

type DecoderV5 struct {
	// contains filtered or unexported fields
}

A DecoderV5 decodes CBOR-encoded representations of values. It can decode storage format version 4 and later.

func NewByteDecoder added in v0.16.0

func NewByteDecoder(
	data []byte,
	owner *common.Address,
	version uint16,
	decodeCallback DecodingCallback,
) (
	*DecoderV5,
	error,
)

func NewDecoder added in v0.2.0

func NewDecoder(
	reader io.Reader,
	owner *common.Address,
	version uint16,
	decodeCallback DecodingCallback,
) (
	*DecoderV5,
	error,
)

NewDecoder initializes a DecoderV5 that will decode CBOR-encoded bytes from the given io.Reader.

It sets the given address as the owner (can be `nil`).

func (*DecoderV5) Decode added in v0.19.0

func (d *DecoderV5) Decode(path []string) (Value, error)

Decode reads CBOR-encoded bytes and decodes them to a value.

type DecodingCallback added in v0.13.0

type DecodingCallback func(value interface{}, path []string)

type DeployedContractDynamicType added in v0.10.0

type DeployedContractDynamicType struct{}

func (DeployedContractDynamicType) IsDynamicType added in v0.10.0

func (DeployedContractDynamicType) IsDynamicType()

func (DeployedContractDynamicType) IsImportable added in v0.18.0

func (DeployedContractDynamicType) IsImportable() bool

type DeployedContractValue added in v0.10.0

type DeployedContractValue struct {
	Address AddressValue
	Name    *StringValue
	Code    *ArrayValue
}

func (DeployedContractValue) Accept added in v0.12.0

func (v DeployedContractValue) Accept(interpreter *Interpreter, visitor Visitor)

func (DeployedContractValue) ConformsToDynamicType added in v0.15.0

func (v DeployedContractValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (DeployedContractValue) Copy added in v0.10.0

func (v DeployedContractValue) Copy() Value

func (DeployedContractValue) Destroy added in v0.10.0

func (v DeployedContractValue) Destroy(_ *Interpreter, _ func() LocationRange)

func (DeployedContractValue) DynamicType added in v0.10.0

func (DeployedContractValue) GetMember added in v0.10.0

func (v DeployedContractValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (DeployedContractValue) GetOwner added in v0.10.0

func (DeployedContractValue) GetOwner() *common.Address

func (DeployedContractValue) IsModified added in v0.10.0

func (DeployedContractValue) IsModified() bool

func (DeployedContractValue) IsStorable added in v0.16.0

func (DeployedContractValue) IsStorable() bool

func (DeployedContractValue) IsValue added in v0.10.0

func (DeployedContractValue) IsValue()

func (DeployedContractValue) RecursiveString added in v0.17.0

func (v DeployedContractValue) RecursiveString(seenReferences SeenReferences) string

func (DeployedContractValue) SetMember added in v0.10.0

func (DeployedContractValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (DeployedContractValue) SetModified added in v0.10.0

func (DeployedContractValue) SetModified(_ bool)

func (DeployedContractValue) SetOwner added in v0.10.0

func (DeployedContractValue) SetOwner(_ *common.Address)

func (DeployedContractValue) StaticType added in v0.12.0

func (DeployedContractValue) StaticType() StaticType

func (DeployedContractValue) String added in v0.10.0

func (v DeployedContractValue) String() string

func (DeployedContractValue) Walk added in v0.19.0

func (v DeployedContractValue) Walk(walkChild func(Value))

type DereferenceError

type DereferenceError struct {
	LocationRange
}

func (DereferenceError) Error

func (e DereferenceError) Error() string

type DestroyableValue

type DestroyableValue interface {
	Value
	Destroy(interpreter *Interpreter, getLocationRange func() LocationRange)
}

type DestroyedCompositeError

type DestroyedCompositeError struct {
	CompositeKind common.CompositeKind
	LocationRange
}

func (DestroyedCompositeError) Error

func (e DestroyedCompositeError) Error() string

type DictionaryDynamicType

type DictionaryDynamicType struct {
	EntryTypes []DictionaryStaticTypeEntry
	StaticType DictionaryStaticType
}

func (*DictionaryDynamicType) IsDynamicType

func (*DictionaryDynamicType) IsDynamicType()

func (*DictionaryDynamicType) IsImportable added in v0.18.0

func (t *DictionaryDynamicType) IsImportable() bool

type DictionaryEntryValues

type DictionaryEntryValues struct {
	Key   Value
	Value Value
}

type DictionaryStaticType

type DictionaryStaticType struct {
	KeyType   StaticType
	ValueType StaticType
}

func ConvertSemaDictionaryTypeToStaticDictionaryType added in v0.19.0

func ConvertSemaDictionaryTypeToStaticDictionaryType(t *sema.DictionaryType) DictionaryStaticType

func (DictionaryStaticType) Equal added in v0.15.0

func (t DictionaryStaticType) Equal(other StaticType) bool

func (DictionaryStaticType) String

func (t DictionaryStaticType) String() string

type DictionaryStaticTypeEntry added in v0.19.0

type DictionaryStaticTypeEntry struct {
	KeyType   DynamicType
	ValueType DynamicType
}

type DictionaryValue

type DictionaryValue struct {
	Type DictionaryStaticType

	Owner *common.Address
	// contains filtered or unexported fields
}

func NewDeferredDictionaryValue added in v0.17.0

func NewDeferredDictionaryValue(
	path []string,
	content []byte,
	owner *common.Address,
	decodeCallback DecodingCallback,
	version uint16,
) *DictionaryValue

func NewDictionaryValueUnownedNonCopying

func NewDictionaryValueUnownedNonCopying(
	interpreter *Interpreter,
	dictionaryType DictionaryStaticType,
	keysAndValues ...Value,
) *DictionaryValue

func (*DictionaryValue) Accept added in v0.12.0

func (v *DictionaryValue) Accept(interpreter *Interpreter, visitor Visitor)

func (*DictionaryValue) ConformsToDynamicType added in v0.15.0

func (v *DictionaryValue) ConformsToDynamicType(
	interpreter *Interpreter,
	dynamicType DynamicType,
	results TypeConformanceResults,
) bool

func (*DictionaryValue) ContainsKey added in v0.14.4

func (v *DictionaryValue) ContainsKey(keyValue Value) BoolValue

func (*DictionaryValue) Copy

func (v *DictionaryValue) Copy() Value

func (*DictionaryValue) Count

func (v *DictionaryValue) Count() int

func (*DictionaryValue) DeferredKeys added in v0.3.0

func (*DictionaryValue) DeferredOwner added in v0.3.0

func (v *DictionaryValue) DeferredOwner() *common.Address

func (*DictionaryValue) DeferredStorageKeyBase added in v0.13.2

func (v *DictionaryValue) DeferredStorageKeyBase() string

func (*DictionaryValue) Destroy

func (v *DictionaryValue) Destroy(inter *Interpreter, getLocationRange func() LocationRange)

func (*DictionaryValue) DynamicType

func (v *DictionaryValue) DynamicType(interpreter *Interpreter, seenReferences SeenReferences) DynamicType

func (*DictionaryValue) Entries

func (v *DictionaryValue) Entries() *StringValueOrderedMap

func (*DictionaryValue) Equal added in v0.15.0

func (v *DictionaryValue) Equal(other Value, interpreter *Interpreter, loadDeferred bool) bool

func (*DictionaryValue) Get

func (v *DictionaryValue) Get(inter *Interpreter, _ func() LocationRange, keyValue Value) Value

func (*DictionaryValue) GetMember

func (v *DictionaryValue) GetMember(interpreter *Interpreter, getLocationRange func() LocationRange, name string) Value

func (*DictionaryValue) GetOwner

func (v *DictionaryValue) GetOwner() *common.Address

func (*DictionaryValue) Insert

func (v *DictionaryValue) Insert(inter *Interpreter, locationRangeGetter func() LocationRange, keyValue, value Value) OptionalValue

func (*DictionaryValue) IsModified added in v0.3.0

func (v *DictionaryValue) IsModified() bool

func (*DictionaryValue) IsStorable added in v0.16.0

func (v *DictionaryValue) IsStorable() bool

func (*DictionaryValue) IsValue

func (*DictionaryValue) IsValue()

func (*DictionaryValue) Keys

func (v *DictionaryValue) Keys() *ArrayValue

func (*DictionaryValue) RecursiveString added in v0.17.0

func (v *DictionaryValue) RecursiveString(seenReferences SeenReferences) string

func (*DictionaryValue) Remove

func (v *DictionaryValue) Remove(inter *Interpreter, getLocationRange func() LocationRange, keyValue Value) OptionalValue

TODO: unset owner?

func (*DictionaryValue) Set

func (v *DictionaryValue) Set(inter *Interpreter, getLocationRange func() LocationRange, keyValue Value, value Value)

func (*DictionaryValue) SetMember

func (v *DictionaryValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (*DictionaryValue) SetModified added in v0.2.1

func (v *DictionaryValue) SetModified(modified bool)

func (*DictionaryValue) SetOwner

func (v *DictionaryValue) SetOwner(owner *common.Address)

func (*DictionaryValue) StaticType added in v0.12.0

func (v *DictionaryValue) StaticType() StaticType

func (*DictionaryValue) String

func (v *DictionaryValue) String() string

func (*DictionaryValue) Walk added in v0.19.0

func (v *DictionaryValue) Walk(walkChild func(Value))

type DivisionByZeroError

type DivisionByZeroError struct{}

func (DivisionByZeroError) Error

func (e DivisionByZeroError) Error() string

type DynamicType

type DynamicType interface {
	IsDynamicType()
	IsImportable() bool
}

func UnwrapOptionalDynamicType added in v0.15.0

func UnwrapOptionalDynamicType(ty DynamicType) DynamicType

UnwrapOptionalDynamicType returns the type if it is not an optional type, or the inner-most type if it is (optional types are repeatedly unwrapped)

type EmptyVisitor added in v0.12.0

type EmptyVisitor struct {
	ValueVisitor                    func(interpreter *Interpreter, value Value)
	TypeValueVisitor                func(interpreter *Interpreter, value TypeValue)
	VoidValueVisitor                func(interpreter *Interpreter, value VoidValue)
	BoolValueVisitor                func(interpreter *Interpreter, value BoolValue)
	StringValueVisitor              func(interpreter *Interpreter, value *StringValue)
	ArrayValueVisitor               func(interpreter *Interpreter, value *ArrayValue) bool
	IntValueVisitor                 func(interpreter *Interpreter, value IntValue)
	Int8ValueVisitor                func(interpreter *Interpreter, value Int8Value)
	Int16ValueVisitor               func(interpreter *Interpreter, value Int16Value)
	Int32ValueVisitor               func(interpreter *Interpreter, value Int32Value)
	Int64ValueVisitor               func(interpreter *Interpreter, value Int64Value)
	Int128ValueVisitor              func(interpreter *Interpreter, value Int128Value)
	Int256ValueVisitor              func(interpreter *Interpreter, value Int256Value)
	UIntValueVisitor                func(interpreter *Interpreter, value UIntValue)
	UInt8ValueVisitor               func(interpreter *Interpreter, value UInt8Value)
	UInt16ValueVisitor              func(interpreter *Interpreter, value UInt16Value)
	UInt32ValueVisitor              func(interpreter *Interpreter, value UInt32Value)
	UInt64ValueVisitor              func(interpreter *Interpreter, value UInt64Value)
	UInt128ValueVisitor             func(interpreter *Interpreter, value UInt128Value)
	UInt256ValueVisitor             func(interpreter *Interpreter, value UInt256Value)
	Word8ValueVisitor               func(interpreter *Interpreter, value Word8Value)
	Word16ValueVisitor              func(interpreter *Interpreter, value Word16Value)
	Word32ValueVisitor              func(interpreter *Interpreter, value Word32Value)
	Word64ValueVisitor              func(interpreter *Interpreter, value Word64Value)
	Fix64ValueVisitor               func(interpreter *Interpreter, value Fix64Value)
	UFix64ValueVisitor              func(interpreter *Interpreter, value UFix64Value)
	CompositeValueVisitor           func(interpreter *Interpreter, value *CompositeValue) bool
	DictionaryValueVisitor          func(interpreter *Interpreter, value *DictionaryValue) bool
	NilValueVisitor                 func(interpreter *Interpreter, value NilValue)
	SomeValueVisitor                func(interpreter *Interpreter, value *SomeValue) bool
	StorageReferenceValueVisitor    func(interpreter *Interpreter, value *StorageReferenceValue)
	EphemeralReferenceValueVisitor  func(interpreter *Interpreter, value *EphemeralReferenceValue)
	AddressValueVisitor             func(interpreter *Interpreter, value AddressValue)
	PathValueVisitor                func(interpreter *Interpreter, value PathValue)
	CapabilityValueVisitor          func(interpreter *Interpreter, value CapabilityValue)
	LinkValueVisitor                func(interpreter *Interpreter, value LinkValue)
	InterpretedFunctionValueVisitor func(interpreter *Interpreter, value *InterpretedFunctionValue)
	HostFunctionValueVisitor        func(interpreter *Interpreter, value *HostFunctionValue)
	BoundFunctionValueVisitor       func(interpreter *Interpreter, value BoundFunctionValue)
	DeployedContractValueVisitor    func(interpreter *Interpreter, value DeployedContractValue)
}

func (EmptyVisitor) VisitAddressValue added in v0.12.0

func (v EmptyVisitor) VisitAddressValue(interpreter *Interpreter, value AddressValue)

func (EmptyVisitor) VisitArrayValue added in v0.12.0

func (v EmptyVisitor) VisitArrayValue(interpreter *Interpreter, value *ArrayValue) bool

func (EmptyVisitor) VisitBoolValue added in v0.12.0

func (v EmptyVisitor) VisitBoolValue(interpreter *Interpreter, value BoolValue)

func (EmptyVisitor) VisitBoundFunctionValue added in v0.12.0

func (v EmptyVisitor) VisitBoundFunctionValue(interpreter *Interpreter, value BoundFunctionValue)

func (EmptyVisitor) VisitCapabilityValue added in v0.12.0

func (v EmptyVisitor) VisitCapabilityValue(interpreter *Interpreter, value CapabilityValue)

func (EmptyVisitor) VisitCompositeValue added in v0.12.0

func (v EmptyVisitor) VisitCompositeValue(interpreter *Interpreter, value *CompositeValue) bool

func (EmptyVisitor) VisitDeployedContractValue added in v0.12.0

func (v EmptyVisitor) VisitDeployedContractValue(interpreter *Interpreter, value DeployedContractValue)

func (EmptyVisitor) VisitDictionaryValue added in v0.12.0

func (v EmptyVisitor) VisitDictionaryValue(interpreter *Interpreter, value *DictionaryValue) bool

func (EmptyVisitor) VisitEphemeralReferenceValue added in v0.12.0

func (v EmptyVisitor) VisitEphemeralReferenceValue(interpreter *Interpreter, value *EphemeralReferenceValue)

func (EmptyVisitor) VisitFix64Value added in v0.12.0

func (v EmptyVisitor) VisitFix64Value(interpreter *Interpreter, value Fix64Value)

func (EmptyVisitor) VisitHostFunctionValue added in v0.12.0

func (v EmptyVisitor) VisitHostFunctionValue(interpreter *Interpreter, value *HostFunctionValue)

func (EmptyVisitor) VisitInt128Value added in v0.12.0

func (v EmptyVisitor) VisitInt128Value(interpreter *Interpreter, value Int128Value)

func (EmptyVisitor) VisitInt16Value added in v0.12.0

func (v EmptyVisitor) VisitInt16Value(interpreter *Interpreter, value Int16Value)

func (EmptyVisitor) VisitInt256Value added in v0.12.0

func (v EmptyVisitor) VisitInt256Value(interpreter *Interpreter, value Int256Value)

func (EmptyVisitor) VisitInt32Value added in v0.12.0

func (v EmptyVisitor) VisitInt32Value(interpreter *Interpreter, value Int32Value)

func (EmptyVisitor) VisitInt64Value added in v0.12.0

func (v EmptyVisitor) VisitInt64Value(interpreter *Interpreter, value Int64Value)

func (EmptyVisitor) VisitInt8Value added in v0.12.0

func (v EmptyVisitor) VisitInt8Value(interpreter *Interpreter, value Int8Value)

func (EmptyVisitor) VisitIntValue added in v0.12.0

func (v EmptyVisitor) VisitIntValue(interpreter *Interpreter, value IntValue)

func (EmptyVisitor) VisitInterpretedFunctionValue added in v0.12.0

func (v EmptyVisitor) VisitInterpretedFunctionValue(interpreter *Interpreter, value *InterpretedFunctionValue)

func (EmptyVisitor) VisitLinkValue added in v0.12.0

func (v EmptyVisitor) VisitLinkValue(interpreter *Interpreter, value LinkValue)

func (EmptyVisitor) VisitNilValue added in v0.12.0

func (v EmptyVisitor) VisitNilValue(interpreter *Interpreter, value NilValue)

func (EmptyVisitor) VisitPathValue added in v0.12.0

func (v EmptyVisitor) VisitPathValue(interpreter *Interpreter, value PathValue)

func (EmptyVisitor) VisitSomeValue added in v0.12.0

func (v EmptyVisitor) VisitSomeValue(interpreter *Interpreter, value *SomeValue) bool

func (EmptyVisitor) VisitStorageReferenceValue added in v0.12.0

func (v EmptyVisitor) VisitStorageReferenceValue(interpreter *Interpreter, value *StorageReferenceValue)

func (EmptyVisitor) VisitStringValue added in v0.12.0

func (v EmptyVisitor) VisitStringValue(interpreter *Interpreter, value *StringValue)

func (EmptyVisitor) VisitTypeValue added in v0.12.0

func (v EmptyVisitor) VisitTypeValue(interpreter *Interpreter, value TypeValue)

func (EmptyVisitor) VisitUFix64Value added in v0.12.0

func (v EmptyVisitor) VisitUFix64Value(interpreter *Interpreter, value UFix64Value)

func (EmptyVisitor) VisitUInt128Value added in v0.12.0

func (v EmptyVisitor) VisitUInt128Value(interpreter *Interpreter, value UInt128Value)

func (EmptyVisitor) VisitUInt16Value added in v0.12.0

func (v EmptyVisitor) VisitUInt16Value(interpreter *Interpreter, value UInt16Value)

func (EmptyVisitor) VisitUInt256Value added in v0.12.0

func (v EmptyVisitor) VisitUInt256Value(interpreter *Interpreter, value UInt256Value)

func (EmptyVisitor) VisitUInt32Value added in v0.12.0

func (v EmptyVisitor) VisitUInt32Value(interpreter *Interpreter, value UInt32Value)

func (EmptyVisitor) VisitUInt64Value added in v0.12.0

func (v EmptyVisitor) VisitUInt64Value(interpreter *Interpreter, value UInt64Value)

func (EmptyVisitor) VisitUInt8Value added in v0.12.0

func (v EmptyVisitor) VisitUInt8Value(interpreter *Interpreter, value UInt8Value)

func (EmptyVisitor) VisitUIntValue added in v0.12.0

func (v EmptyVisitor) VisitUIntValue(interpreter *Interpreter, value UIntValue)

func (EmptyVisitor) VisitValue added in v0.12.0

func (v EmptyVisitor) VisitValue(interpreter *Interpreter, value Value)

func (EmptyVisitor) VisitVoidValue added in v0.12.0

func (v EmptyVisitor) VisitVoidValue(interpreter *Interpreter, value VoidValue)

func (EmptyVisitor) VisitWord16Value added in v0.12.0

func (v EmptyVisitor) VisitWord16Value(interpreter *Interpreter, value Word16Value)

func (EmptyVisitor) VisitWord32Value added in v0.12.0

func (v EmptyVisitor) VisitWord32Value(interpreter *Interpreter, value Word32Value)

func (EmptyVisitor) VisitWord64Value added in v0.12.0

func (v EmptyVisitor) VisitWord64Value(interpreter *Interpreter, value Word64Value)

func (EmptyVisitor) VisitWord8Value added in v0.12.0

func (v EmptyVisitor) VisitWord8Value(interpreter *Interpreter, value Word8Value)

type EncoderV4 added in v0.19.0

type EncoderV4 struct {
	// contains filtered or unexported fields
}

Encoder converts Values into CBOR-encoded bytes.

func NewEncoderV4 added in v0.19.0

func NewEncoderV4(w io.Writer, deferred bool, prepareCallback EncodingPrepareCallback) (*EncoderV4, error)

NewEncoder initializes an Encoder that will write CBOR-encoded bytes to the given io.Writer.

func (*EncoderV4) Encode added in v0.19.0

func (e *EncoderV4) Encode(
	v Value,
	path []string,
	deferrals *EncodingDeferrals,
) error

Encode writes the CBOR-encoded representation of the given value to this encoder's io.Writer.

This function returns an error if the given value's type is not supported by this encoder.

type EncoderV5 added in v0.19.0

type EncoderV5 struct {
	// contains filtered or unexported fields
}

EncoderV5 converts Values into CBOR-encoded bytes.

func NewEncoder added in v0.2.0

func NewEncoder(w io.Writer, deferred bool, prepareCallback EncodingPrepareCallback) (*EncoderV5, error)

NewEncoder initializes an EncoderV5 that will write CBOR-encoded bytes to the given io.Writer.

func (*EncoderV5) Encode added in v0.19.0

func (e *EncoderV5) Encode(
	v Value,
	path []string,
	deferrals *EncodingDeferrals,
) error

Encode writes the CBOR-encoded representation of the given value to this encoder's io.Writer.

This function returns an error if the given value's type is not supported by this encoder.

type EncodingDeferralMove added in v0.3.0

type EncodingDeferralMove struct {
	DeferredOwner      common.Address
	DeferredStorageKey string
	NewOwner           common.Address
	NewStorageKey      string
}

type EncodingDeferralValue added in v0.13.0

type EncodingDeferralValue struct {
	Key   string
	Value Value
}

type EncodingDeferrals added in v0.3.0

type EncodingDeferrals struct {
	Values []EncodingDeferralValue
	Moves  []EncodingDeferralMove
}

func EncodeValue added in v0.2.0

func EncodeValue(value Value, path []string, deferred bool, prepareCallback EncodingPrepareCallback) (
	encoded []byte,
	deferrals *EncodingDeferrals,
	err error,
)

EncodeValue returns the CBOR-encoded representation of the given value.

The given path is used to identify values in the object graph. For example, path elements are appended for array elements (the index), dictionary values (the key), and composites (the field name).

The deferred flag determines if child values should be deferred, i.e. should not be encoded into the result, but e.g. be eventually written to separate storage keys. If true, the deferrals result will contain the values which have not been encoded, and which values need to be moved from a previous storage key to another storage key.

func EncodeValueV4 added in v0.19.0

func EncodeValueV4(value Value, path []string, deferred bool, prepareCallback EncodingPrepareCallback) (
	encoded []byte,
	deferrals *EncodingDeferrals,
	err error,
)

EncodeValue returns the CBOR-encoded representation of the given value.

The given path is used to identify values in the object graph. For example, path elements are appended for array elements (the index), dictionary values (the key), and composites (the field name).

The deferred flag determines if child values should be deferred, i.e. should not be encoded into the result, but e.g. be eventually written to separate storage keys. If true, the deferrals result will contain the values which have not been encoded, and which values need to be moved from a previous storage key to another storage key.

type EncodingPrepareCallback added in v0.12.8

type EncodingPrepareCallback func(value Value, path []string)

type EncodingUnsupportedValueError added in v0.12.7

type EncodingUnsupportedValueError struct {
	Value Value
	Path  []string
}

EncodingUnsupportedValueError

func (EncodingUnsupportedValueError) Error added in v0.12.7

type EphemeralReferenceDynamicType

type EphemeralReferenceDynamicType struct {
	// contains filtered or unexported fields
}

func (EphemeralReferenceDynamicType) Authorized

func (t EphemeralReferenceDynamicType) Authorized() bool

func (EphemeralReferenceDynamicType) BorrowedType added in v0.16.0

func (t EphemeralReferenceDynamicType) BorrowedType() sema.Type

func (EphemeralReferenceDynamicType) InnerType

func (EphemeralReferenceDynamicType) IsDynamicType

func (EphemeralReferenceDynamicType) IsDynamicType()

func (EphemeralReferenceDynamicType) IsImportable added in v0.18.0

func (EphemeralReferenceDynamicType) IsImportable() bool

type EphemeralReferenceValue

type EphemeralReferenceValue struct {
	Authorized   bool
	Value        Value
	BorrowedType sema.Type
}

func (*EphemeralReferenceValue) Accept added in v0.12.0

func (v *EphemeralReferenceValue) Accept(interpreter *Interpreter, visitor Visitor)

func (*EphemeralReferenceValue) ConformsToDynamicType added in v0.15.0

func (v *EphemeralReferenceValue) ConformsToDynamicType(
	interpreter *Interpreter,
	dynamicType DynamicType,
	results TypeConformanceResults,
) bool

func (*EphemeralReferenceValue) Copy

func (v *EphemeralReferenceValue) Copy() Value

func (*EphemeralReferenceValue) DynamicType

func (v *EphemeralReferenceValue) DynamicType(interpreter *Interpreter, seenReferences SeenReferences) DynamicType

func (*EphemeralReferenceValue) Equal

func (v *EphemeralReferenceValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (*EphemeralReferenceValue) Get

func (v *EphemeralReferenceValue) Get(interpreter *Interpreter, getLocationRange func() LocationRange, key Value) Value

func (*EphemeralReferenceValue) GetMember

func (v *EphemeralReferenceValue) GetMember(interpreter *Interpreter, getLocationRange func() LocationRange, name string) Value

func (*EphemeralReferenceValue) GetOwner

func (v *EphemeralReferenceValue) GetOwner() *common.Address

func (*EphemeralReferenceValue) IsModified added in v0.3.0

func (*EphemeralReferenceValue) IsModified() bool

func (*EphemeralReferenceValue) IsStorable added in v0.16.0

func (*EphemeralReferenceValue) IsStorable() bool

func (*EphemeralReferenceValue) IsValue

func (*EphemeralReferenceValue) IsValue()

func (*EphemeralReferenceValue) RecursiveString added in v0.17.0

func (v *EphemeralReferenceValue) RecursiveString(seenReferences SeenReferences) string

func (*EphemeralReferenceValue) ReferencedValue added in v0.11.0

func (v *EphemeralReferenceValue) ReferencedValue() *Value

func (*EphemeralReferenceValue) Set

func (v *EphemeralReferenceValue) Set(interpreter *Interpreter, getLocationRange func() LocationRange, key Value, value Value)

func (*EphemeralReferenceValue) SetMember

func (v *EphemeralReferenceValue) SetMember(interpreter *Interpreter, getLocationRange func() LocationRange, name string, value Value)

func (*EphemeralReferenceValue) SetModified added in v0.3.0

func (*EphemeralReferenceValue) SetModified(_ bool)

func (*EphemeralReferenceValue) SetOwner

func (v *EphemeralReferenceValue) SetOwner(_ *common.Address)

func (*EphemeralReferenceValue) StaticType added in v0.12.0

func (v *EphemeralReferenceValue) StaticType() StaticType

func (*EphemeralReferenceValue) String added in v0.5.0

func (v *EphemeralReferenceValue) String() string

func (*EphemeralReferenceValue) Walk added in v0.19.0

func (*EphemeralReferenceValue) Walk(_ func(Value))

type EquatableValue

type EquatableValue interface {
	Value
	Equal(other Value, interpreter *Interpreter, loadDeferred bool) bool
}

type Error added in v0.12.0

type Error struct {
	Err      error
	Location common.Location
}

Error is the containing type for all errors produced by the interpreter.

func (Error) ChildErrors added in v0.12.1

func (e Error) ChildErrors() []error

func (Error) Error added in v0.12.0

func (e Error) Error() string

func (Error) ImportLocation added in v0.12.1

func (e Error) ImportLocation() common.Location

func (Error) Unwrap added in v0.12.0

func (e Error) Unwrap() error

type EventEmissionUnavailableError added in v0.10.4

type EventEmissionUnavailableError struct {
	LocationRange
}

EventEmissionUnavailableError

func (EventEmissionUnavailableError) Error added in v0.10.4

type ExitHandlerFunc added in v0.17.0

type ExitHandlerFunc func() error

ExitHandlerFunc is a function that is called at the end of execution

type ExpressionStatementResult

type ExpressionStatementResult struct {
	Value Value
}

type ExternalError added in v0.3.0

type ExternalError struct {
	Recovered interface{}
}

ExternalError is an error that occurred externally. It contains the recovered value.

func (ExternalError) Error added in v0.3.0

func (e ExternalError) Error() string

type Fix64Value

type Fix64Value int64

Fix64Value

func ConvertFix64

func ConvertFix64(value Value) Fix64Value

func NewFix64ValueWithInteger added in v0.2.0

func NewFix64ValueWithInteger(integer int64) Fix64Value

func (Fix64Value) Accept added in v0.12.0

func (v Fix64Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Fix64Value) ConformsToDynamicType added in v0.15.0

func (v Fix64Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Fix64Value) Copy

func (v Fix64Value) Copy() Value

func (Fix64Value) Div

func (v Fix64Value) Div(other NumberValue) NumberValue

func (Fix64Value) DynamicType

func (Fix64Value) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (Fix64Value) Equal

func (v Fix64Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Fix64Value) GetMember added in v0.3.0

func (v Fix64Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Fix64Value) GetOwner

func (Fix64Value) GetOwner() *common.Address

func (Fix64Value) Greater

func (v Fix64Value) Greater(other NumberValue) BoolValue

func (Fix64Value) GreaterEqual

func (v Fix64Value) GreaterEqual(other NumberValue) BoolValue

func (Fix64Value) IsModified added in v0.3.0

func (Fix64Value) IsModified() bool

func (Fix64Value) IsStorable added in v0.16.0

func (Fix64Value) IsStorable() bool

func (Fix64Value) IsValue

func (Fix64Value) IsValue()

func (Fix64Value) KeyString

func (v Fix64Value) KeyString() string

func (Fix64Value) Less

func (v Fix64Value) Less(other NumberValue) BoolValue

func (Fix64Value) LessEqual

func (v Fix64Value) LessEqual(other NumberValue) BoolValue

func (Fix64Value) Minus

func (v Fix64Value) Minus(other NumberValue) NumberValue

func (Fix64Value) Mod

func (v Fix64Value) Mod(other NumberValue) NumberValue

func (Fix64Value) Mul

func (v Fix64Value) Mul(other NumberValue) NumberValue

func (Fix64Value) Negate

func (v Fix64Value) Negate() NumberValue

func (Fix64Value) Plus

func (v Fix64Value) Plus(other NumberValue) NumberValue

func (Fix64Value) RecursiveString added in v0.17.0

func (v Fix64Value) RecursiveString(_ SeenReferences) string

func (Fix64Value) SaturatingDiv added in v0.15.0

func (v Fix64Value) SaturatingDiv(other NumberValue) NumberValue

func (Fix64Value) SaturatingMinus added in v0.15.0

func (v Fix64Value) SaturatingMinus(other NumberValue) NumberValue

func (Fix64Value) SaturatingMul added in v0.15.0

func (v Fix64Value) SaturatingMul(other NumberValue) NumberValue

func (Fix64Value) SaturatingPlus added in v0.15.0

func (v Fix64Value) SaturatingPlus(other NumberValue) NumberValue

func (Fix64Value) SetMember added in v0.3.0

func (Fix64Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Fix64Value) SetModified added in v0.3.0

func (Fix64Value) SetModified(_ bool)

func (Fix64Value) SetOwner

func (Fix64Value) SetOwner(_ *common.Address)

func (Fix64Value) StaticType added in v0.12.0

func (Fix64Value) StaticType() StaticType

func (Fix64Value) String

func (v Fix64Value) String() string

func (Fix64Value) ToBigEndianBytes added in v0.5.0

func (v Fix64Value) ToBigEndianBytes() []byte

func (Fix64Value) ToInt

func (v Fix64Value) ToInt() int

func (Fix64Value) Walk added in v0.19.0

func (Fix64Value) Walk(_ func(Value))

type ForceAssignmentToNonNilResourceError

type ForceAssignmentToNonNilResourceError struct {
	LocationRange
}

ForceAssignmentToNonNilResourceError

func (ForceAssignmentToNonNilResourceError) Error

type ForceCastTypeMismatchError added in v0.19.0

type ForceCastTypeMismatchError struct {
	ExpectedType sema.Type
	LocationRange
}

ForceCastTypeMismatchError

func (ForceCastTypeMismatchError) Error added in v0.19.0

type ForceNilError

type ForceNilError struct {
	LocationRange
}

ForceNilError

func (ForceNilError) Error

func (e ForceNilError) Error() string

type FunctionDynamicType

type FunctionDynamicType struct{}

func (FunctionDynamicType) IsDynamicType

func (FunctionDynamicType) IsDynamicType()

func (FunctionDynamicType) IsImportable added in v0.18.0

func (FunctionDynamicType) IsImportable() bool

type FunctionStaticType added in v0.19.0

type FunctionStaticType struct {
	Type *sema.FunctionType
}

func (FunctionStaticType) Equal added in v0.19.0

func (t FunctionStaticType) Equal(other StaticType) bool

func (FunctionStaticType) ParameterTypes added in v0.19.0

func (t FunctionStaticType) ParameterTypes() []StaticType

func (FunctionStaticType) ReceiverType added in v0.19.0

func (t FunctionStaticType) ReceiverType() StaticType

func (FunctionStaticType) ReturnType added in v0.19.0

func (t FunctionStaticType) ReturnType() StaticType

func (FunctionStaticType) String added in v0.19.0

func (t FunctionStaticType) String() string

func (FunctionStaticType) TypeParameters added in v0.19.0

func (t FunctionStaticType) TypeParameters() []*TypeParameter

type FunctionValue

type FunctionValue interface {
	Value
	// contains filtered or unexported methods
}

FunctionValue

type FunctionWrapper

type FunctionWrapper = func(inner FunctionValue) FunctionValue

type GlobalVariables added in v0.19.0

type GlobalVariables map[string]*Variable

GlobalVariables represents global variables defined in a program.

func (GlobalVariables) Contains added in v0.19.0

func (globalVars GlobalVariables) Contains(name string) bool

func (GlobalVariables) Get added in v0.19.0

func (globalVars GlobalVariables) Get(name string) (*Variable, bool)

func (GlobalVariables) Set added in v0.19.0

func (globalVars GlobalVariables) Set(name string, variable *Variable)

type HasKeyString

type HasKeyString interface {
	KeyString() string
}

type HashHandlerFunc added in v0.18.0

type HashHandlerFunc func(
	data *ArrayValue,
	tag *StringValue,
	hashAlgorithm *CompositeValue,
) *ArrayValue

HashHandlerFunc is a function that hashes.

type HostFunction

type HostFunction func(invocation Invocation) Value

HostFunctionValue

type HostFunctionValue

type HostFunctionValue struct {
	Function        HostFunction
	NestedVariables *StringVariableOrderedMap
}

func EnumConstructorFunction added in v0.14.0

func EnumConstructorFunction(
	caseValues []*CompositeValue,
	nestedVariables *StringVariableOrderedMap,
) *HostFunctionValue

func NewHostFunctionValue

func NewHostFunctionValue(
	function HostFunction,
) *HostFunctionValue

func (*HostFunctionValue) Accept added in v0.12.0

func (f *HostFunctionValue) Accept(interpreter *Interpreter, visitor Visitor)

func (*HostFunctionValue) ConformsToDynamicType added in v0.15.0

func (f *HostFunctionValue) ConformsToDynamicType(_ *Interpreter, _ DynamicType, _ TypeConformanceResults) bool

func (*HostFunctionValue) Copy

func (f *HostFunctionValue) Copy() Value

func (*HostFunctionValue) DynamicType

func (*HostFunctionValue) GetMember

func (f *HostFunctionValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (*HostFunctionValue) GetOwner

func (*HostFunctionValue) GetOwner() *common.Address

func (*HostFunctionValue) IsModified added in v0.3.0

func (*HostFunctionValue) IsModified() bool

func (*HostFunctionValue) IsStorable added in v0.16.0

func (*HostFunctionValue) IsStorable() bool

func (*HostFunctionValue) IsValue

func (*HostFunctionValue) IsValue()

func (*HostFunctionValue) RecursiveString added in v0.17.0

func (f *HostFunctionValue) RecursiveString(_ SeenReferences) string

func (*HostFunctionValue) SetMember

func (*HostFunctionValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (*HostFunctionValue) SetModified added in v0.3.0

func (*HostFunctionValue) SetModified(_ bool)

func (*HostFunctionValue) SetOwner

func (*HostFunctionValue) SetOwner(_ *common.Address)

func (*HostFunctionValue) StaticType added in v0.12.0

func (*HostFunctionValue) StaticType() StaticType

func (*HostFunctionValue) String added in v0.2.0

func (f *HostFunctionValue) String() string

func (*HostFunctionValue) Walk added in v0.19.0

func (f *HostFunctionValue) Walk(_ func(Value))

type Import added in v0.5.0

type Import interface {
	// contains filtered or unexported methods
}

type ImportLocationHandlerFunc added in v0.5.0

type ImportLocationHandlerFunc func(
	inter *Interpreter,
	location common.Location,
) Import

ImportLocationFunc is a function that handles imports of locations.

type InjectedCompositeFieldsHandlerFunc

type InjectedCompositeFieldsHandlerFunc func(
	inter *Interpreter,
	location common.Location,
	qualifiedIdentifier string,
	compositeKind common.CompositeKind,
) *StringValueOrderedMap

InjectedCompositeFieldsHandlerFunc is a function that handles storage reads.

type Int128Value

type Int128Value struct {
	BigInt *big.Int
}

func ConvertInt128

func ConvertInt128(value Value) Int128Value

func NewInt128ValueFromBigInt

func NewInt128ValueFromBigInt(value *big.Int) Int128Value

func NewInt128ValueFromInt64

func NewInt128ValueFromInt64(value int64) Int128Value

func (Int128Value) Accept added in v0.12.0

func (v Int128Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Int128Value) BitwiseAnd added in v0.2.0

func (v Int128Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Int128Value) BitwiseLeftShift added in v0.2.0

func (v Int128Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Int128Value) BitwiseOr added in v0.2.0

func (v Int128Value) BitwiseOr(other IntegerValue) IntegerValue

func (Int128Value) BitwiseRightShift added in v0.2.0

func (v Int128Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Int128Value) BitwiseXor added in v0.2.0

func (v Int128Value) BitwiseXor(other IntegerValue) IntegerValue

func (Int128Value) ConformsToDynamicType added in v0.15.0

func (v Int128Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Int128Value) Copy

func (v Int128Value) Copy() Value

func (Int128Value) Div

func (v Int128Value) Div(other NumberValue) NumberValue

func (Int128Value) DynamicType

func (Int128Value) Equal

func (v Int128Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Int128Value) GetMember added in v0.3.0

func (v Int128Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Int128Value) GetOwner

func (Int128Value) GetOwner() *common.Address

func (Int128Value) Greater

func (v Int128Value) Greater(other NumberValue) BoolValue

func (Int128Value) GreaterEqual

func (v Int128Value) GreaterEqual(other NumberValue) BoolValue

func (Int128Value) IsModified added in v0.3.0

func (Int128Value) IsModified() bool

func (Int128Value) IsStorable added in v0.16.0

func (Int128Value) IsStorable() bool

func (Int128Value) IsValue

func (v Int128Value) IsValue()

func (Int128Value) KeyString

func (v Int128Value) KeyString() string

func (Int128Value) Less

func (v Int128Value) Less(other NumberValue) BoolValue

func (Int128Value) LessEqual

func (v Int128Value) LessEqual(other NumberValue) BoolValue

func (Int128Value) Minus

func (v Int128Value) Minus(other NumberValue) NumberValue

func (Int128Value) Mod

func (v Int128Value) Mod(other NumberValue) NumberValue

func (Int128Value) Mul

func (v Int128Value) Mul(other NumberValue) NumberValue

func (Int128Value) Negate

func (v Int128Value) Negate() NumberValue

func (Int128Value) Plus

func (v Int128Value) Plus(other NumberValue) NumberValue

func (Int128Value) RecursiveString added in v0.17.0

func (v Int128Value) RecursiveString(_ SeenReferences) string

func (Int128Value) SaturatingDiv added in v0.15.0

func (v Int128Value) SaturatingDiv(other NumberValue) NumberValue

func (Int128Value) SaturatingMinus added in v0.15.0

func (v Int128Value) SaturatingMinus(other NumberValue) NumberValue

func (Int128Value) SaturatingMul added in v0.15.0

func (v Int128Value) SaturatingMul(other NumberValue) NumberValue

func (Int128Value) SaturatingPlus added in v0.15.0

func (v Int128Value) SaturatingPlus(other NumberValue) NumberValue

func (Int128Value) SetMember added in v0.3.0

func (Int128Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Int128Value) SetModified added in v0.3.0

func (Int128Value) SetModified(_ bool)

func (Int128Value) SetOwner

func (Int128Value) SetOwner(_ *common.Address)

func (Int128Value) StaticType added in v0.12.0

func (Int128Value) StaticType() StaticType

func (Int128Value) String

func (v Int128Value) String() string

func (Int128Value) ToBigEndianBytes added in v0.5.0

func (v Int128Value) ToBigEndianBytes() []byte

func (Int128Value) ToBigInt

func (v Int128Value) ToBigInt() *big.Int

func (Int128Value) ToInt

func (v Int128Value) ToInt() int

func (Int128Value) Walk added in v0.19.0

func (Int128Value) Walk(_ func(Value))

type Int16Value

type Int16Value int16

func ConvertInt16

func ConvertInt16(value Value) Int16Value

func (Int16Value) Accept added in v0.12.0

func (v Int16Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Int16Value) BitwiseAnd added in v0.2.0

func (v Int16Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Int16Value) BitwiseLeftShift added in v0.2.0

func (v Int16Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Int16Value) BitwiseOr added in v0.2.0

func (v Int16Value) BitwiseOr(other IntegerValue) IntegerValue

func (Int16Value) BitwiseRightShift added in v0.2.0

func (v Int16Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Int16Value) BitwiseXor added in v0.2.0

func (v Int16Value) BitwiseXor(other IntegerValue) IntegerValue

func (Int16Value) ConformsToDynamicType added in v0.15.0

func (v Int16Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Int16Value) Copy

func (v Int16Value) Copy() Value

func (Int16Value) Div

func (v Int16Value) Div(other NumberValue) NumberValue

func (Int16Value) DynamicType

func (Int16Value) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (Int16Value) Equal

func (v Int16Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Int16Value) GetMember added in v0.3.0

func (v Int16Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Int16Value) GetOwner

func (Int16Value) GetOwner() *common.Address

func (Int16Value) Greater

func (v Int16Value) Greater(other NumberValue) BoolValue

func (Int16Value) GreaterEqual

func (v Int16Value) GreaterEqual(other NumberValue) BoolValue

func (Int16Value) IsModified added in v0.3.0

func (Int16Value) IsModified() bool

func (Int16Value) IsStorable added in v0.16.0

func (Int16Value) IsStorable() bool

func (Int16Value) IsValue

func (Int16Value) IsValue()

func (Int16Value) KeyString

func (v Int16Value) KeyString() string

func (Int16Value) Less

func (v Int16Value) Less(other NumberValue) BoolValue

func (Int16Value) LessEqual

func (v Int16Value) LessEqual(other NumberValue) BoolValue

func (Int16Value) Minus

func (v Int16Value) Minus(other NumberValue) NumberValue

func (Int16Value) Mod

func (v Int16Value) Mod(other NumberValue) NumberValue

func (Int16Value) Mul

func (v Int16Value) Mul(other NumberValue) NumberValue

func (Int16Value) Negate

func (v Int16Value) Negate() NumberValue

func (Int16Value) Plus

func (v Int16Value) Plus(other NumberValue) NumberValue

func (Int16Value) RecursiveString added in v0.17.0

func (v Int16Value) RecursiveString(_ SeenReferences) string

func (Int16Value) SaturatingDiv added in v0.15.0

func (v Int16Value) SaturatingDiv(other NumberValue) NumberValue

func (Int16Value) SaturatingMinus added in v0.15.0

func (v Int16Value) SaturatingMinus(other NumberValue) NumberValue

func (Int16Value) SaturatingMul added in v0.15.0

func (v Int16Value) SaturatingMul(other NumberValue) NumberValue

func (Int16Value) SaturatingPlus added in v0.15.0

func (v Int16Value) SaturatingPlus(other NumberValue) NumberValue

func (Int16Value) SetMember added in v0.3.0

func (Int16Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Int16Value) SetModified added in v0.3.0

func (Int16Value) SetModified(_ bool)

func (Int16Value) SetOwner

func (Int16Value) SetOwner(_ *common.Address)

func (Int16Value) StaticType added in v0.12.0

func (Int16Value) StaticType() StaticType

func (Int16Value) String

func (v Int16Value) String() string

func (Int16Value) ToBigEndianBytes added in v0.5.0

func (v Int16Value) ToBigEndianBytes() []byte

func (Int16Value) ToInt

func (v Int16Value) ToInt() int

func (Int16Value) Walk added in v0.19.0

func (Int16Value) Walk(_ func(Value))

type Int256Value

type Int256Value struct {
	BigInt *big.Int
}

func ConvertInt256

func ConvertInt256(value Value) Int256Value

func NewInt256ValueFromBigInt

func NewInt256ValueFromBigInt(value *big.Int) Int256Value

func NewInt256ValueFromInt64

func NewInt256ValueFromInt64(value int64) Int256Value

func (Int256Value) Accept added in v0.12.0

func (v Int256Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Int256Value) BitwiseAnd added in v0.2.0

func (v Int256Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Int256Value) BitwiseLeftShift added in v0.2.0

func (v Int256Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Int256Value) BitwiseOr added in v0.2.0

func (v Int256Value) BitwiseOr(other IntegerValue) IntegerValue

func (Int256Value) BitwiseRightShift added in v0.2.0

func (v Int256Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Int256Value) BitwiseXor added in v0.2.0

func (v Int256Value) BitwiseXor(other IntegerValue) IntegerValue

func (Int256Value) ConformsToDynamicType added in v0.15.0

func (v Int256Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Int256Value) Copy

func (v Int256Value) Copy() Value

func (Int256Value) Div

func (v Int256Value) Div(other NumberValue) NumberValue

func (Int256Value) DynamicType

func (Int256Value) Equal

func (v Int256Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Int256Value) GetMember added in v0.3.0

func (v Int256Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Int256Value) GetOwner

func (Int256Value) GetOwner() *common.Address

func (Int256Value) Greater

func (v Int256Value) Greater(other NumberValue) BoolValue

func (Int256Value) GreaterEqual

func (v Int256Value) GreaterEqual(other NumberValue) BoolValue

func (Int256Value) IsModified added in v0.3.0

func (Int256Value) IsModified() bool

func (Int256Value) IsStorable added in v0.16.0

func (Int256Value) IsStorable() bool

func (Int256Value) IsValue

func (v Int256Value) IsValue()

func (Int256Value) KeyString

func (v Int256Value) KeyString() string

func (Int256Value) Less

func (v Int256Value) Less(other NumberValue) BoolValue

func (Int256Value) LessEqual

func (v Int256Value) LessEqual(other NumberValue) BoolValue

func (Int256Value) Minus

func (v Int256Value) Minus(other NumberValue) NumberValue

func (Int256Value) Mod

func (v Int256Value) Mod(other NumberValue) NumberValue

func (Int256Value) Mul

func (v Int256Value) Mul(other NumberValue) NumberValue

func (Int256Value) Negate

func (v Int256Value) Negate() NumberValue

func (Int256Value) Plus

func (v Int256Value) Plus(other NumberValue) NumberValue

func (Int256Value) RecursiveString added in v0.17.0

func (v Int256Value) RecursiveString(_ SeenReferences) string

func (Int256Value) SaturatingDiv added in v0.15.0

func (v Int256Value) SaturatingDiv(other NumberValue) NumberValue

func (Int256Value) SaturatingMinus added in v0.15.0

func (v Int256Value) SaturatingMinus(other NumberValue) NumberValue

func (Int256Value) SaturatingMul added in v0.15.0

func (v Int256Value) SaturatingMul(other NumberValue) NumberValue

func (Int256Value) SaturatingPlus added in v0.15.0

func (v Int256Value) SaturatingPlus(other NumberValue) NumberValue

func (Int256Value) SetMember added in v0.3.0

func (Int256Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Int256Value) SetModified added in v0.3.0

func (Int256Value) SetModified(_ bool)

func (Int256Value) SetOwner

func (Int256Value) SetOwner(_ *common.Address)

func (Int256Value) StaticType added in v0.12.0

func (Int256Value) StaticType() StaticType

func (Int256Value) String

func (v Int256Value) String() string

func (Int256Value) ToBigEndianBytes added in v0.5.0

func (v Int256Value) ToBigEndianBytes() []byte

func (Int256Value) ToBigInt

func (v Int256Value) ToBigInt() *big.Int

func (Int256Value) ToInt

func (v Int256Value) ToInt() int

func (Int256Value) Walk added in v0.19.0

func (Int256Value) Walk(_ func(Value))

type Int32Value

type Int32Value int32

func ConvertInt32

func ConvertInt32(value Value) Int32Value

func (Int32Value) Accept added in v0.12.0

func (v Int32Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Int32Value) BitwiseAnd added in v0.2.0

func (v Int32Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Int32Value) BitwiseLeftShift added in v0.2.0

func (v Int32Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Int32Value) BitwiseOr added in v0.2.0

func (v Int32Value) BitwiseOr(other IntegerValue) IntegerValue

func (Int32Value) BitwiseRightShift added in v0.2.0

func (v Int32Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Int32Value) BitwiseXor added in v0.2.0

func (v Int32Value) BitwiseXor(other IntegerValue) IntegerValue

func (Int32Value) ConformsToDynamicType added in v0.15.0

func (v Int32Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Int32Value) Copy

func (v Int32Value) Copy() Value

func (Int32Value) Div

func (v Int32Value) Div(other NumberValue) NumberValue

func (Int32Value) DynamicType

func (Int32Value) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (Int32Value) Equal

func (v Int32Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Int32Value) GetMember added in v0.3.0

func (v Int32Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Int32Value) GetOwner

func (Int32Value) GetOwner() *common.Address

func (Int32Value) Greater

func (v Int32Value) Greater(other NumberValue) BoolValue

func (Int32Value) GreaterEqual

func (v Int32Value) GreaterEqual(other NumberValue) BoolValue

func (Int32Value) IsModified added in v0.3.0

func (Int32Value) IsModified() bool

func (Int32Value) IsStorable added in v0.16.0

func (Int32Value) IsStorable() bool

func (Int32Value) IsValue

func (Int32Value) IsValue()

func (Int32Value) KeyString

func (v Int32Value) KeyString() string

func (Int32Value) Less

func (v Int32Value) Less(other NumberValue) BoolValue

func (Int32Value) LessEqual

func (v Int32Value) LessEqual(other NumberValue) BoolValue

func (Int32Value) Minus

func (v Int32Value) Minus(other NumberValue) NumberValue

func (Int32Value) Mod

func (v Int32Value) Mod(other NumberValue) NumberValue

func (Int32Value) Mul

func (v Int32Value) Mul(other NumberValue) NumberValue

func (Int32Value) Negate

func (v Int32Value) Negate() NumberValue

func (Int32Value) Plus

func (v Int32Value) Plus(other NumberValue) NumberValue

func (Int32Value) RecursiveString added in v0.17.0

func (v Int32Value) RecursiveString(_ SeenReferences) string

func (Int32Value) SaturatingDiv added in v0.15.0

func (v Int32Value) SaturatingDiv(other NumberValue) NumberValue

func (Int32Value) SaturatingMinus added in v0.15.0

func (v Int32Value) SaturatingMinus(other NumberValue) NumberValue

func (Int32Value) SaturatingMul added in v0.15.0

func (v Int32Value) SaturatingMul(other NumberValue) NumberValue

func (Int32Value) SaturatingPlus added in v0.15.0

func (v Int32Value) SaturatingPlus(other NumberValue) NumberValue

func (Int32Value) SetMember added in v0.3.0

func (Int32Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Int32Value) SetModified added in v0.3.0

func (Int32Value) SetModified(_ bool)

func (Int32Value) SetOwner

func (Int32Value) SetOwner(_ *common.Address)

func (Int32Value) StaticType added in v0.12.0

func (Int32Value) StaticType() StaticType

func (Int32Value) String

func (v Int32Value) String() string

func (Int32Value) ToBigEndianBytes added in v0.5.0

func (v Int32Value) ToBigEndianBytes() []byte

func (Int32Value) ToInt

func (v Int32Value) ToInt() int

func (Int32Value) Walk added in v0.19.0

func (Int32Value) Walk(_ func(Value))

type Int64Value

type Int64Value int64

func ConvertInt64

func ConvertInt64(value Value) Int64Value

func (Int64Value) Accept added in v0.12.0

func (v Int64Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Int64Value) BitwiseAnd added in v0.2.0

func (v Int64Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Int64Value) BitwiseLeftShift added in v0.2.0

func (v Int64Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Int64Value) BitwiseOr added in v0.2.0

func (v Int64Value) BitwiseOr(other IntegerValue) IntegerValue

func (Int64Value) BitwiseRightShift added in v0.2.0

func (v Int64Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Int64Value) BitwiseXor added in v0.2.0

func (v Int64Value) BitwiseXor(other IntegerValue) IntegerValue

func (Int64Value) ConformsToDynamicType added in v0.15.0

func (v Int64Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Int64Value) Copy

func (v Int64Value) Copy() Value

func (Int64Value) Div

func (v Int64Value) Div(other NumberValue) NumberValue

func (Int64Value) DynamicType

func (Int64Value) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (Int64Value) Equal

func (v Int64Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Int64Value) GetMember added in v0.3.0

func (v Int64Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Int64Value) GetOwner

func (Int64Value) GetOwner() *common.Address

func (Int64Value) Greater

func (v Int64Value) Greater(other NumberValue) BoolValue

func (Int64Value) GreaterEqual

func (v Int64Value) GreaterEqual(other NumberValue) BoolValue

func (Int64Value) IsModified added in v0.3.0

func (Int64Value) IsModified() bool

func (Int64Value) IsStorable added in v0.16.0

func (Int64Value) IsStorable() bool

func (Int64Value) IsValue

func (Int64Value) IsValue()

func (Int64Value) KeyString

func (v Int64Value) KeyString() string

func (Int64Value) Less

func (v Int64Value) Less(other NumberValue) BoolValue

func (Int64Value) LessEqual

func (v Int64Value) LessEqual(other NumberValue) BoolValue

func (Int64Value) Minus

func (v Int64Value) Minus(other NumberValue) NumberValue

func (Int64Value) Mod

func (v Int64Value) Mod(other NumberValue) NumberValue

func (Int64Value) Mul

func (v Int64Value) Mul(other NumberValue) NumberValue

func (Int64Value) Negate

func (v Int64Value) Negate() NumberValue

func (Int64Value) Plus

func (v Int64Value) Plus(other NumberValue) NumberValue

func (Int64Value) RecursiveString added in v0.17.0

func (v Int64Value) RecursiveString(_ SeenReferences) string

func (Int64Value) SaturatingDiv added in v0.15.0

func (v Int64Value) SaturatingDiv(other NumberValue) NumberValue

func (Int64Value) SaturatingMinus added in v0.15.0

func (v Int64Value) SaturatingMinus(other NumberValue) NumberValue

func (Int64Value) SaturatingMul added in v0.15.0

func (v Int64Value) SaturatingMul(other NumberValue) NumberValue

func (Int64Value) SaturatingPlus added in v0.15.0

func (v Int64Value) SaturatingPlus(other NumberValue) NumberValue

func (Int64Value) SetMember added in v0.3.0

func (Int64Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Int64Value) SetModified added in v0.3.0

func (Int64Value) SetModified(_ bool)

func (Int64Value) SetOwner

func (Int64Value) SetOwner(_ *common.Address)

func (Int64Value) StaticType added in v0.12.0

func (Int64Value) StaticType() StaticType

func (Int64Value) String

func (v Int64Value) String() string

func (Int64Value) ToBigEndianBytes added in v0.5.0

func (v Int64Value) ToBigEndianBytes() []byte

func (Int64Value) ToInt

func (v Int64Value) ToInt() int

func (Int64Value) Walk added in v0.19.0

func (Int64Value) Walk(_ func(Value))

type Int8Value

type Int8Value int8

func ConvertInt8

func ConvertInt8(value Value) Int8Value

func (Int8Value) Accept added in v0.12.0

func (v Int8Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Int8Value) BitwiseAnd added in v0.2.0

func (v Int8Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Int8Value) BitwiseLeftShift added in v0.2.0

func (v Int8Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Int8Value) BitwiseOr added in v0.2.0

func (v Int8Value) BitwiseOr(other IntegerValue) IntegerValue

func (Int8Value) BitwiseRightShift added in v0.2.0

func (v Int8Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Int8Value) BitwiseXor added in v0.2.0

func (v Int8Value) BitwiseXor(other IntegerValue) IntegerValue

func (Int8Value) ConformsToDynamicType added in v0.15.0

func (v Int8Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Int8Value) Copy

func (v Int8Value) Copy() Value

func (Int8Value) Div

func (v Int8Value) Div(other NumberValue) NumberValue

func (Int8Value) DynamicType

func (Int8Value) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (Int8Value) Equal

func (v Int8Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Int8Value) GetMember added in v0.3.0

func (v Int8Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Int8Value) GetOwner

func (Int8Value) GetOwner() *common.Address

func (Int8Value) Greater

func (v Int8Value) Greater(other NumberValue) BoolValue

func (Int8Value) GreaterEqual

func (v Int8Value) GreaterEqual(other NumberValue) BoolValue

func (Int8Value) IsModified added in v0.3.0

func (Int8Value) IsModified() bool

func (Int8Value) IsStorable added in v0.16.0

func (Int8Value) IsStorable() bool

func (Int8Value) IsValue

func (Int8Value) IsValue()

func (Int8Value) KeyString

func (v Int8Value) KeyString() string

func (Int8Value) Less

func (v Int8Value) Less(other NumberValue) BoolValue

func (Int8Value) LessEqual

func (v Int8Value) LessEqual(other NumberValue) BoolValue

func (Int8Value) Minus

func (v Int8Value) Minus(other NumberValue) NumberValue

func (Int8Value) Mod

func (v Int8Value) Mod(other NumberValue) NumberValue

func (Int8Value) Mul

func (v Int8Value) Mul(other NumberValue) NumberValue

func (Int8Value) Negate

func (v Int8Value) Negate() NumberValue

func (Int8Value) Plus

func (v Int8Value) Plus(other NumberValue) NumberValue

func (Int8Value) RecursiveString added in v0.17.0

func (v Int8Value) RecursiveString(_ SeenReferences) string

func (Int8Value) SaturatingDiv added in v0.15.0

func (v Int8Value) SaturatingDiv(other NumberValue) NumberValue

func (Int8Value) SaturatingMinus added in v0.15.0

func (v Int8Value) SaturatingMinus(other NumberValue) NumberValue

func (Int8Value) SaturatingMul added in v0.15.0

func (v Int8Value) SaturatingMul(other NumberValue) NumberValue

func (Int8Value) SaturatingPlus added in v0.15.0

func (v Int8Value) SaturatingPlus(other NumberValue) NumberValue

func (Int8Value) SetMember added in v0.3.0

func (Int8Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Int8Value) SetModified added in v0.3.0

func (Int8Value) SetModified(_ bool)

func (Int8Value) SetOwner

func (Int8Value) SetOwner(_ *common.Address)

func (Int8Value) StaticType added in v0.12.0

func (Int8Value) StaticType() StaticType

func (Int8Value) String

func (v Int8Value) String() string

func (Int8Value) ToBigEndianBytes added in v0.5.0

func (v Int8Value) ToBigEndianBytes() []byte

func (Int8Value) ToInt

func (v Int8Value) ToInt() int

func (Int8Value) Walk added in v0.19.0

func (Int8Value) Walk(_ func(Value))

type IntValue

type IntValue struct {
	BigInt *big.Int
}

func ConvertInt

func ConvertInt(value Value) IntValue

func NewIntValueFromBigInt

func NewIntValueFromBigInt(value *big.Int) IntValue

func NewIntValueFromInt64

func NewIntValueFromInt64(value int64) IntValue

func (IntValue) Accept added in v0.12.0

func (v IntValue) Accept(interpreter *Interpreter, visitor Visitor)

func (IntValue) BitwiseAnd added in v0.2.0

func (v IntValue) BitwiseAnd(other IntegerValue) IntegerValue

func (IntValue) BitwiseLeftShift added in v0.2.0

func (v IntValue) BitwiseLeftShift(other IntegerValue) IntegerValue

func (IntValue) BitwiseOr added in v0.2.0

func (v IntValue) BitwiseOr(other IntegerValue) IntegerValue

func (IntValue) BitwiseRightShift added in v0.2.0

func (v IntValue) BitwiseRightShift(other IntegerValue) IntegerValue

func (IntValue) BitwiseXor added in v0.2.0

func (v IntValue) BitwiseXor(other IntegerValue) IntegerValue

func (IntValue) ConformsToDynamicType added in v0.15.0

func (v IntValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (IntValue) Copy

func (v IntValue) Copy() Value

func (IntValue) Div

func (v IntValue) Div(other NumberValue) NumberValue

func (IntValue) DynamicType

func (IntValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (IntValue) Equal

func (v IntValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (IntValue) GetMember added in v0.3.0

func (v IntValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (IntValue) GetOwner

func (IntValue) GetOwner() *common.Address

func (IntValue) Greater

func (v IntValue) Greater(other NumberValue) BoolValue

func (IntValue) GreaterEqual

func (v IntValue) GreaterEqual(other NumberValue) BoolValue

func (IntValue) IsModified added in v0.3.0

func (IntValue) IsModified() bool

func (IntValue) IsStorable added in v0.16.0

func (IntValue) IsStorable() bool

func (IntValue) IsValue

func (v IntValue) IsValue()

func (IntValue) KeyString

func (v IntValue) KeyString() string

func (IntValue) Less

func (v IntValue) Less(other NumberValue) BoolValue

func (IntValue) LessEqual

func (v IntValue) LessEqual(other NumberValue) BoolValue

func (IntValue) Minus

func (v IntValue) Minus(other NumberValue) NumberValue

func (IntValue) Mod

func (v IntValue) Mod(other NumberValue) NumberValue

func (IntValue) Mul

func (v IntValue) Mul(other NumberValue) NumberValue

func (IntValue) Negate

func (v IntValue) Negate() NumberValue

func (IntValue) Plus

func (v IntValue) Plus(other NumberValue) NumberValue

func (IntValue) RecursiveString added in v0.17.0

func (v IntValue) RecursiveString(_ SeenReferences) string

func (IntValue) SaturatingDiv added in v0.15.0

func (v IntValue) SaturatingDiv(other NumberValue) NumberValue

func (IntValue) SaturatingMinus added in v0.15.0

func (v IntValue) SaturatingMinus(other NumberValue) NumberValue

func (IntValue) SaturatingMul added in v0.15.0

func (v IntValue) SaturatingMul(other NumberValue) NumberValue

func (IntValue) SaturatingPlus added in v0.15.0

func (v IntValue) SaturatingPlus(other NumberValue) NumberValue

func (IntValue) SetMember added in v0.3.0

func (IntValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (IntValue) SetModified added in v0.3.0

func (IntValue) SetModified(_ bool)

func (IntValue) SetOwner

func (IntValue) SetOwner(_ *common.Address)

func (IntValue) StaticType added in v0.12.0

func (IntValue) StaticType() StaticType

func (IntValue) String

func (v IntValue) String() string

func (IntValue) ToBigEndianBytes added in v0.5.0

func (v IntValue) ToBigEndianBytes() []byte

func (IntValue) ToBigInt

func (v IntValue) ToBigInt() *big.Int

func (IntValue) ToInt

func (v IntValue) ToInt() int

func (IntValue) Walk added in v0.19.0

func (IntValue) Walk(_ func(Value))

type IntegerValue added in v0.2.0

type IntegerValue interface {
	NumberValue
	BitwiseOr(other IntegerValue) IntegerValue
	BitwiseXor(other IntegerValue) IntegerValue
	BitwiseAnd(other IntegerValue) IntegerValue
	BitwiseLeftShift(other IntegerValue) IntegerValue
	BitwiseRightShift(other IntegerValue) IntegerValue
}

type InterfaceStaticType

type InterfaceStaticType struct {
	Location            common.Location
	QualifiedIdentifier string
}

func ConvertSemaInterfaceTypeToStaticInterfaceType added in v0.19.0

func ConvertSemaInterfaceTypeToStaticInterfaceType(t *sema.InterfaceType) InterfaceStaticType

func (InterfaceStaticType) Equal added in v0.15.0

func (t InterfaceStaticType) Equal(other StaticType) bool

func (InterfaceStaticType) String

func (t InterfaceStaticType) String() string

type InterpretedFunctionValue

type InterpretedFunctionValue struct {
	Interpreter      *Interpreter
	ParameterList    *ast.ParameterList
	Type             *sema.FunctionType
	Activation       *VariableActivation
	BeforeStatements []ast.Statement
	PreConditions    ast.Conditions
	Statements       []ast.Statement
	PostConditions   ast.Conditions
}

InterpretedFunctionValue

func (*InterpretedFunctionValue) Accept added in v0.12.0

func (f *InterpretedFunctionValue) Accept(interpreter *Interpreter, visitor Visitor)

func (*InterpretedFunctionValue) ConformsToDynamicType added in v0.15.0

func (f *InterpretedFunctionValue) ConformsToDynamicType(_ *Interpreter, _ DynamicType, _ TypeConformanceResults) bool

func (*InterpretedFunctionValue) Copy

func (f *InterpretedFunctionValue) Copy() Value

func (*InterpretedFunctionValue) DynamicType

func (*InterpretedFunctionValue) GetOwner

func (*InterpretedFunctionValue) IsModified added in v0.3.0

func (*InterpretedFunctionValue) IsModified() bool

func (*InterpretedFunctionValue) IsStorable added in v0.16.0

func (*InterpretedFunctionValue) IsStorable() bool

func (*InterpretedFunctionValue) IsValue

func (*InterpretedFunctionValue) IsValue()

func (*InterpretedFunctionValue) RecursiveString added in v0.17.0

func (f *InterpretedFunctionValue) RecursiveString(_ SeenReferences) string

func (*InterpretedFunctionValue) SetModified added in v0.3.0

func (*InterpretedFunctionValue) SetModified(_ bool)

func (*InterpretedFunctionValue) SetOwner

func (*InterpretedFunctionValue) SetOwner(_ *common.Address)

func (*InterpretedFunctionValue) StaticType added in v0.12.0

func (f *InterpretedFunctionValue) StaticType() StaticType

func (*InterpretedFunctionValue) String added in v0.2.0

func (f *InterpretedFunctionValue) String() string

func (*InterpretedFunctionValue) Walk added in v0.19.0

func (f *InterpretedFunctionValue) Walk(_ func(Value))

type Interpreter

type Interpreter struct {
	Program           *Program
	Location          common.Location
	PredeclaredValues []ValueDeclaration

	Globals GlobalVariables

	Transactions []*HostFunctionValue

	PublicKeyValidationHandler   PublicKeyValidationHandlerFunc
	SignatureVerificationHandler SignatureVerificationHandlerFunc
	HashHandler                  HashHandlerFunc
	ExitHandler                  ExitHandlerFunc
	// contains filtered or unexported fields
}

func NewInterpreter

func NewInterpreter(program *Program, location common.Location, options ...Option) (*Interpreter, error)

func (*Interpreter) ConvertStaticToSemaType added in v0.7.0

func (interpreter *Interpreter) ConvertStaticToSemaType(staticType StaticType) sema.Type

func (*Interpreter) EnsureLoaded added in v0.16.0

func (interpreter *Interpreter) EnsureLoaded(
	location common.Location,
) *Interpreter

func (*Interpreter) ExpectType added in v0.19.0

func (interpreter *Interpreter) ExpectType(
	value Value,
	expectedType sema.Type,
	getLocationRange func() LocationRange,
)

func (*Interpreter) GetCapabilityFinalTargetStorageKey added in v0.15.0

func (interpreter *Interpreter) GetCapabilityFinalTargetStorageKey(
	address common.Address,
	path PathValue,
	wantedBorrowType *sema.ReferenceType,
	getLocationRange func() LocationRange,
) (
	finalStorageKey string,
	authorized bool,
	err error,
)

func (*Interpreter) GetContractComposite added in v0.16.0

func (interpreter *Interpreter) GetContractComposite(contractLocation common.AddressLocation) (*CompositeValue, error)

GetContractComposite gets the composite value of the contract at the address location.

func (*Interpreter) Interpret

func (interpreter *Interpreter) Interpret() (err error)

func (*Interpreter) Invoke

func (interpreter *Interpreter) Invoke(functionName string, arguments ...Value) (value Value, err error)

Invoke invokes a global function with the given arguments

func (*Interpreter) InvokeFunction added in v0.16.0

func (interpreter *Interpreter) InvokeFunction(function FunctionValue, invocation Invocation) (value Value, err error)

InvokeFunction invokes a function value with the given invocation

func (*Interpreter) InvokeFunctionValue

func (interpreter *Interpreter) InvokeFunctionValue(
	function FunctionValue,
	arguments []Value,
	argumentTypes []sema.Type,
	parameterTypes []sema.Type,
	invocationPosition ast.HasPosition,
) (
	value Value,
	err error,
)

func (*Interpreter) InvokeTransaction

func (interpreter *Interpreter) InvokeTransaction(index int, arguments ...Value) (err error)

func (*Interpreter) IsSubType

func (interpreter *Interpreter) IsSubType(subType DynamicType, superType sema.Type) bool

func (*Interpreter) NewSubInterpreter added in v0.13.0

func (interpreter *Interpreter) NewSubInterpreter(
	program *Program,
	location common.Location,
	options ...Option,
) (
	*Interpreter,
	error,
)

func (*Interpreter) ReadStored added in v0.15.0

func (interpreter *Interpreter) ReadStored(storageAddress common.Address, key string, deferred bool) OptionalValue

func (*Interpreter) RecoverErrors added in v0.17.0

func (interpreter *Interpreter) RecoverErrors(onError func(error))

func (*Interpreter) SetAccountHandler added in v0.15.0

func (interpreter *Interpreter) SetAccountHandler(function AccountHandlerFunc)

SetAccountHandler sets the function that is used to handle accounts.

func (*Interpreter) SetAllInterpreters

func (interpreter *Interpreter) SetAllInterpreters(allInterpreters map[common.LocationID]*Interpreter)

SetAllInterpreters sets the given map of interpreters as the map of all interpreters.

func (*Interpreter) SetContractValueHandler

func (interpreter *Interpreter) SetContractValueHandler(function ContractValueHandlerFunc)

SetContractValueHandler sets the function that is used to handle imports of values

func (*Interpreter) SetExitHandler added in v0.17.0

func (interpreter *Interpreter) SetExitHandler(function ExitHandlerFunc)

SetExitHandler sets the function that is used to handle end of execution.

func (*Interpreter) SetHashHandler added in v0.18.0

func (interpreter *Interpreter) SetHashHandler(function HashHandlerFunc)

SetHashHandler sets the function that is used to hash.

func (*Interpreter) SetImportLocationHandler added in v0.5.0

func (interpreter *Interpreter) SetImportLocationHandler(function ImportLocationHandlerFunc)

SetImportLocationHandler sets the function that is used to handle imports of locations.

func (*Interpreter) SetInjectedCompositeFieldsHandler

func (interpreter *Interpreter) SetInjectedCompositeFieldsHandler(function InjectedCompositeFieldsHandlerFunc)

SetInjectedCompositeFieldsHandler sets the function that is used to initialize new composite values' fields

func (*Interpreter) SetOnEventEmittedHandler

func (interpreter *Interpreter) SetOnEventEmittedHandler(function OnEventEmittedFunc)

SetOnEventEmittedHandler sets the function that is triggered when an event is emitted by the program.

func (*Interpreter) SetOnFunctionInvocationHandler added in v0.2.0

func (interpreter *Interpreter) SetOnFunctionInvocationHandler(function OnFunctionInvocationFunc)

SetOnFunctionInvocationHandler sets the function that is triggered when a loop iteration is about to be executed.

func (*Interpreter) SetOnLoopIterationHandler added in v0.2.0

func (interpreter *Interpreter) SetOnLoopIterationHandler(function OnLoopIterationFunc)

SetOnLoopIterationHandler sets the function that is triggered when a loop iteration is about to be executed.

func (*Interpreter) SetOnStatementHandler

func (interpreter *Interpreter) SetOnStatementHandler(function OnStatementFunc)

SetOnStatementHandler sets the function that is triggered when a statement is about to be executed.

func (*Interpreter) SetPublicKeyValidationHandler added in v0.16.0

func (interpreter *Interpreter) SetPublicKeyValidationHandler(function PublicKeyValidationHandlerFunc)

SetPublicKeyValidationHandler sets the function that is used to handle public key validation.

func (*Interpreter) SetSignatureVerificationHandler added in v0.18.0

func (interpreter *Interpreter) SetSignatureVerificationHandler(function SignatureVerificationHandlerFunc)

SetSignatureVerificationHandler sets the function that is used to handle signature validation.

func (*Interpreter) SetStorageExistenceHandler

func (interpreter *Interpreter) SetStorageExistenceHandler(function StorageExistenceHandlerFunc)

SetStorageExistenceHandler sets the function that is used when a storage key is checked for existence.

func (*Interpreter) SetStorageReadHandler

func (interpreter *Interpreter) SetStorageReadHandler(function StorageReadHandlerFunc)

SetStorageReadHandler sets the function that is used when a stored value is read.

func (*Interpreter) SetStorageWriteHandler

func (interpreter *Interpreter) SetStorageWriteHandler(function StorageWriteHandlerFunc)

SetStorageWriteHandler sets the function that is used when a stored value is written.

func (*Interpreter) SetUUIDHandler

func (interpreter *Interpreter) SetUUIDHandler(function UUIDHandlerFunc)

SetUUIDHandler sets the function that is used to handle the generation of UUIDs.

func (*Interpreter) VisitArrayExpression

func (interpreter *Interpreter) VisitArrayExpression(expression *ast.ArrayExpression) ast.Repr

func (*Interpreter) VisitAssignmentStatement

func (interpreter *Interpreter) VisitAssignmentStatement(assignment *ast.AssignmentStatement) ast.Repr

func (*Interpreter) VisitBinaryExpression

func (interpreter *Interpreter) VisitBinaryExpression(expression *ast.BinaryExpression) ast.Repr

func (*Interpreter) VisitBlock

func (interpreter *Interpreter) VisitBlock(block *ast.Block) ast.Repr

func (*Interpreter) VisitBoolExpression

func (interpreter *Interpreter) VisitBoolExpression(expression *ast.BoolExpression) ast.Repr

func (*Interpreter) VisitBreakStatement

func (interpreter *Interpreter) VisitBreakStatement(_ *ast.BreakStatement) ast.Repr

func (*Interpreter) VisitCastingExpression

func (interpreter *Interpreter) VisitCastingExpression(expression *ast.CastingExpression) ast.Repr

func (*Interpreter) VisitCompositeDeclaration

func (interpreter *Interpreter) VisitCompositeDeclaration(declaration *ast.CompositeDeclaration) ast.Repr

NOTE: only called for top-level composite declarations

func (*Interpreter) VisitConditionalExpression

func (interpreter *Interpreter) VisitConditionalExpression(expression *ast.ConditionalExpression) ast.Repr

func (*Interpreter) VisitContinueStatement

func (interpreter *Interpreter) VisitContinueStatement(_ *ast.ContinueStatement) ast.Repr

func (*Interpreter) VisitCreateExpression

func (interpreter *Interpreter) VisitCreateExpression(expression *ast.CreateExpression) ast.Repr

func (*Interpreter) VisitDestroyExpression

func (interpreter *Interpreter) VisitDestroyExpression(expression *ast.DestroyExpression) ast.Repr

func (*Interpreter) VisitDictionaryExpression

func (interpreter *Interpreter) VisitDictionaryExpression(expression *ast.DictionaryExpression) ast.Repr

func (*Interpreter) VisitEmitStatement

func (interpreter *Interpreter) VisitEmitStatement(statement *ast.EmitStatement) ast.Repr

func (*Interpreter) VisitEnumCaseDeclaration added in v0.10.0

func (interpreter *Interpreter) VisitEnumCaseDeclaration(_ *ast.EnumCaseDeclaration) ast.Repr

func (*Interpreter) VisitExpressionStatement

func (interpreter *Interpreter) VisitExpressionStatement(statement *ast.ExpressionStatement) ast.Repr

func (*Interpreter) VisitFieldDeclaration

func (interpreter *Interpreter) VisitFieldDeclaration(_ *ast.FieldDeclaration) ast.Repr

func (*Interpreter) VisitFixedPointExpression

func (interpreter *Interpreter) VisitFixedPointExpression(expression *ast.FixedPointExpression) ast.Repr

func (*Interpreter) VisitForStatement

func (interpreter *Interpreter) VisitForStatement(statement *ast.ForStatement) ast.Repr

func (*Interpreter) VisitForceExpression

func (interpreter *Interpreter) VisitForceExpression(expression *ast.ForceExpression) ast.Repr

func (*Interpreter) VisitFunctionBlock

func (interpreter *Interpreter) VisitFunctionBlock(_ *ast.FunctionBlock) ast.Repr

func (*Interpreter) VisitFunctionDeclaration

func (interpreter *Interpreter) VisitFunctionDeclaration(declaration *ast.FunctionDeclaration) ast.Repr

func (*Interpreter) VisitFunctionExpression

func (interpreter *Interpreter) VisitFunctionExpression(expression *ast.FunctionExpression) ast.Repr

func (*Interpreter) VisitIdentifierExpression

func (interpreter *Interpreter) VisitIdentifierExpression(expression *ast.IdentifierExpression) ast.Repr

func (*Interpreter) VisitIfStatement

func (interpreter *Interpreter) VisitIfStatement(statement *ast.IfStatement) ast.Repr

func (*Interpreter) VisitImportDeclaration

func (interpreter *Interpreter) VisitImportDeclaration(declaration *ast.ImportDeclaration) ast.Repr

func (*Interpreter) VisitIndexExpression

func (interpreter *Interpreter) VisitIndexExpression(expression *ast.IndexExpression) ast.Repr

func (*Interpreter) VisitIntegerExpression

func (interpreter *Interpreter) VisitIntegerExpression(expression *ast.IntegerExpression) ast.Repr

func (*Interpreter) VisitInterfaceDeclaration

func (interpreter *Interpreter) VisitInterfaceDeclaration(declaration *ast.InterfaceDeclaration) ast.Repr

NOTE: only called for top-level interface declarations

func (*Interpreter) VisitInvocationExpression

func (interpreter *Interpreter) VisitInvocationExpression(invocationExpression *ast.InvocationExpression) ast.Repr

func (*Interpreter) VisitMemberExpression

func (interpreter *Interpreter) VisitMemberExpression(expression *ast.MemberExpression) ast.Repr

func (*Interpreter) VisitNilExpression

func (interpreter *Interpreter) VisitNilExpression(_ *ast.NilExpression) ast.Repr

func (*Interpreter) VisitPathExpression

func (interpreter *Interpreter) VisitPathExpression(expression *ast.PathExpression) ast.Repr

func (*Interpreter) VisitPragmaDeclaration added in v0.7.0

func (interpreter *Interpreter) VisitPragmaDeclaration(_ *ast.PragmaDeclaration) ast.Repr

func (*Interpreter) VisitProgram

func (interpreter *Interpreter) VisitProgram(program *ast.Program) ast.Repr

func (*Interpreter) VisitReferenceExpression

func (interpreter *Interpreter) VisitReferenceExpression(referenceExpression *ast.ReferenceExpression) ast.Repr

func (*Interpreter) VisitReturnStatement

func (interpreter *Interpreter) VisitReturnStatement(statement *ast.ReturnStatement) ast.Repr

func (*Interpreter) VisitStringExpression

func (interpreter *Interpreter) VisitStringExpression(expression *ast.StringExpression) ast.Repr

func (*Interpreter) VisitSwapStatement

func (interpreter *Interpreter) VisitSwapStatement(swap *ast.SwapStatement) ast.Repr

func (*Interpreter) VisitSwitchStatement added in v0.10.0

func (interpreter *Interpreter) VisitSwitchStatement(switchStatement *ast.SwitchStatement) ast.Repr

func (*Interpreter) VisitTransactionDeclaration

func (interpreter *Interpreter) VisitTransactionDeclaration(declaration *ast.TransactionDeclaration) ast.Repr

func (*Interpreter) VisitUnaryExpression

func (interpreter *Interpreter) VisitUnaryExpression(expression *ast.UnaryExpression) ast.Repr

func (*Interpreter) VisitVariableDeclaration

func (interpreter *Interpreter) VisitVariableDeclaration(declaration *ast.VariableDeclaration) ast.Repr

VisitVariableDeclaration first visits the declaration's value, then declares the variable with the name bound to the value

func (*Interpreter) VisitWhileStatement

func (interpreter *Interpreter) VisitWhileStatement(statement *ast.WhileStatement) ast.Repr

type InterpreterImport added in v0.13.0

type InterpreterImport struct {
	Interpreter *Interpreter
}

type InvalidPathDomainError

type InvalidPathDomainError struct {
	ActualDomain    common.PathDomain
	ExpectedDomains []common.PathDomain
	LocationRange
}

InvalidPathDomainError

func (InvalidPathDomainError) Error

func (e InvalidPathDomainError) Error() string

func (InvalidPathDomainError) SecondaryError

func (e InvalidPathDomainError) SecondaryError() string

type Invocation

type Invocation struct {
	Self               *CompositeValue
	ReceiverType       sema.Type
	Arguments          []Value
	ArgumentTypes      []sema.Type
	TypeParameterTypes *sema.TypeParameterTypeOrderedMap
	GetLocationRange   func() LocationRange
	Interpreter        *Interpreter
}

Invocation

type InvocationArgumentTypeError added in v0.14.5

type InvocationArgumentTypeError struct {
	Index         int
	ParameterType sema.Type
	LocationRange
}

InvocationArgumentTypeError

func (InvocationArgumentTypeError) Error added in v0.14.5

type InvocationReceiverTypeError added in v0.19.0

type InvocationReceiverTypeError struct {
	SelfType     sema.Type
	ReceiverType sema.Type
	LocationRange
}

InvocationReceiverTypeError

func (InvocationReceiverTypeError) Error added in v0.19.0

type LinkValue

type LinkValue struct {
	TargetPath PathValue
	Type       StaticType
}

func (LinkValue) Accept added in v0.12.0

func (v LinkValue) Accept(interpreter *Interpreter, visitor Visitor)

func (LinkValue) ConformsToDynamicType added in v0.15.0

func (v LinkValue) ConformsToDynamicType(_ *Interpreter, _ DynamicType, _ TypeConformanceResults) bool

func (LinkValue) Copy

func (v LinkValue) Copy() Value

func (LinkValue) Destroy

func (v LinkValue) Destroy(_ *Interpreter, _ func() LocationRange)

func (LinkValue) DynamicType

func (LinkValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (LinkValue) Equal added in v0.15.0

func (v LinkValue) Equal(other Value, interpreter *Interpreter, loadDeferred bool) bool

func (LinkValue) GetOwner

func (LinkValue) GetOwner() *common.Address

func (LinkValue) IsModified added in v0.3.0

func (LinkValue) IsModified() bool

func (LinkValue) IsStorable added in v0.16.0

func (LinkValue) IsStorable() bool

func (LinkValue) IsValue

func (LinkValue) IsValue()

func (LinkValue) RecursiveString added in v0.17.0

func (v LinkValue) RecursiveString(seenReferences SeenReferences) string

func (LinkValue) SetModified added in v0.3.0

func (LinkValue) SetModified(_ bool)

func (LinkValue) SetOwner

func (LinkValue) SetOwner(_ *common.Address)

func (LinkValue) StaticType added in v0.12.0

func (LinkValue) StaticType() StaticType

func (LinkValue) String

func (v LinkValue) String() string

func (LinkValue) Walk added in v0.19.0

func (v LinkValue) Walk(walkChild func(Value))

type LocationPosition

type LocationPosition struct {
	Location common.Location
	Position ast.Position
}

LocationPosition defines a position in the source of the import tree. The Location defines the script within the import tree, the Position defines the row/colum within the source of that script.

type LocationRange

type LocationRange struct {
	Location common.Location
	ast.Range
}

LocationRange defines a range in the source of the import tree. The Position defines the script within the import tree, the Range defines the start/end position within the source of that script.

func ReturnEmptyLocationRange added in v0.14.0

func ReturnEmptyLocationRange() LocationRange

func (LocationRange) ImportLocation

func (r LocationRange) ImportLocation() common.Location

type MemberAccessibleValue

type MemberAccessibleValue interface {
	Value
	GetMember(interpreter *Interpreter, getLocationRange func() LocationRange, name string) Value
	SetMember(interpreter *Interpreter, getLocationRange func() LocationRange, name string, value Value)
}

type MetaTypeDynamicType added in v0.4.0

type MetaTypeDynamicType struct{}

func (MetaTypeDynamicType) IsDynamicType added in v0.4.0

func (MetaTypeDynamicType) IsDynamicType()

func (MetaTypeDynamicType) IsImportable added in v0.18.0

func (MetaTypeDynamicType) IsImportable() bool

type MissingMemberValueError added in v0.15.0

type MissingMemberValueError struct {
	Name string
	LocationRange
}

func (MissingMemberValueError) Error added in v0.15.0

func (e MissingMemberValueError) Error() string

type NilDynamicType

type NilDynamicType struct{}

func (NilDynamicType) IsDynamicType

func (NilDynamicType) IsDynamicType()

func (NilDynamicType) IsImportable added in v0.18.0

func (NilDynamicType) IsImportable() bool

type NilValue

type NilValue struct{}

func (NilValue) Accept added in v0.12.0

func (v NilValue) Accept(interpreter *Interpreter, visitor Visitor)

func (NilValue) ConformsToDynamicType added in v0.15.0

func (v NilValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (NilValue) Copy

func (v NilValue) Copy() Value

func (NilValue) Destroy

func (v NilValue) Destroy(_ *Interpreter, _ func() LocationRange)

func (NilValue) DynamicType

func (NilValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (NilValue) Equal added in v0.15.0

func (v NilValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (NilValue) GetMember added in v0.9.0

func (v NilValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (NilValue) GetOwner

func (NilValue) GetOwner() *common.Address

func (NilValue) IsModified added in v0.3.0

func (NilValue) IsModified() bool

func (NilValue) IsStorable added in v0.16.0

func (NilValue) IsStorable() bool

func (NilValue) IsValue

func (NilValue) IsValue()

func (NilValue) RecursiveString added in v0.17.0

func (v NilValue) RecursiveString(_ SeenReferences) string

func (NilValue) SetMember added in v0.9.0

func (NilValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (NilValue) SetModified added in v0.3.0

func (NilValue) SetModified(_ bool)

func (NilValue) SetOwner

func (NilValue) SetOwner(_ *common.Address)

func (NilValue) StaticType added in v0.12.0

func (NilValue) StaticType() StaticType

func (NilValue) String

func (NilValue) String() string

func (NilValue) Walk added in v0.19.0

func (NilValue) Walk(_ func(Value))

type NotDeclaredError

type NotDeclaredError struct {
	ExpectedKind common.DeclarationKind
	Name         string
}

func (NotDeclaredError) Error

func (e NotDeclaredError) Error() string

func (NotDeclaredError) SecondaryError

func (e NotDeclaredError) SecondaryError() string

type NotInvokableError

type NotInvokableError struct {
	Value Value
}

func (NotInvokableError) Error

func (e NotInvokableError) Error() string

type NumberDynamicType

type NumberDynamicType struct {
	StaticType sema.Type
}

func (NumberDynamicType) IsDynamicType

func (NumberDynamicType) IsDynamicType()

func (NumberDynamicType) IsImportable added in v0.18.0

func (NumberDynamicType) IsImportable() bool

type NumberValue

type NumberValue interface {
	EquatableValue
	ToInt() int
	Negate() NumberValue
	Plus(other NumberValue) NumberValue
	SaturatingPlus(other NumberValue) NumberValue
	Minus(other NumberValue) NumberValue
	SaturatingMinus(other NumberValue) NumberValue
	Mod(other NumberValue) NumberValue
	Mul(other NumberValue) NumberValue
	SaturatingMul(other NumberValue) NumberValue
	Div(other NumberValue) NumberValue
	SaturatingDiv(other NumberValue) NumberValue
	Less(other NumberValue) BoolValue
	LessEqual(other NumberValue) BoolValue
	Greater(other NumberValue) BoolValue
	GreaterEqual(other NumberValue) BoolValue
	ToBigEndianBytes() []byte
}

NumberValue

type OnEventEmittedFunc

type OnEventEmittedFunc func(
	inter *Interpreter,
	event *CompositeValue,
	eventType *sema.CompositeType,
) error

OnEventEmittedFunc is a function that is triggered when an event is emitted by the program.

type OnFunctionInvocationFunc added in v0.2.0

type OnFunctionInvocationFunc func(
	inter *Interpreter,
	line int,
)

OnFunctionInvocationFunc is a function that is triggered when a function is about to be invoked.

type OnLoopIterationFunc added in v0.2.0

type OnLoopIterationFunc func(
	inter *Interpreter,
	line int,
)

OnLoopIterationFunc is a function that is triggered when a loop iteration is about to be executed.

type OnStatementFunc

type OnStatementFunc func(
	inter *Interpreter,
	statement ast.Statement,
)

OnStatementFunc is a function that is triggered when a statement is about to be executed.

type Option

type Option func(*Interpreter) error

func WithAccountHandlerFunc added in v0.15.0

func WithAccountHandlerFunc(handler AccountHandlerFunc) Option

WithAccountHandlerFunc returns an interpreter option which sets the given function as the function that is used to handle public accounts.

func WithAllInterpreters

func WithAllInterpreters(allInterpreters map[common.LocationID]*Interpreter) Option

WithAllInterpreters returns an interpreter option which sets the given map of interpreters as the map of all interpreters.

func WithContractValueHandler

func WithContractValueHandler(handler ContractValueHandlerFunc) Option

WithContractValueHandler returns an interpreter option which sets the given function as the function that is used to handle imports of values.

func WithExitHandler added in v0.17.0

func WithExitHandler(handler ExitHandlerFunc) Option

WithExitHandler returns an interpreter option which sets the given function as the function that is used when execution is complete.

func WithHashHandler added in v0.18.0

func WithHashHandler(handler HashHandlerFunc) Option

WithHashHandler returns an interpreter option which sets the given function as the function that is used to hash.

func WithImportLocationHandler added in v0.5.0

func WithImportLocationHandler(handler ImportLocationHandlerFunc) Option

WithImportLocationHandler returns an interpreter option which sets the given function as the function that is used to handle the imports of locations.

func WithInjectedCompositeFieldsHandler

func WithInjectedCompositeFieldsHandler(handler InjectedCompositeFieldsHandlerFunc) Option

WithInjectedCompositeFieldsHandler returns an interpreter option which sets the given function as the function that is used to initialize new composite values' fields

func WithOnEventEmittedHandler

func WithOnEventEmittedHandler(handler OnEventEmittedFunc) Option

WithOnEventEmittedHandler returns an interpreter option which sets the given function as the event handler.

func WithOnFunctionInvocationHandler added in v0.2.0

func WithOnFunctionInvocationHandler(handler OnFunctionInvocationFunc) Option

WithOnLoopIterationHandler returns an interpreter option which sets the given function as the loop iteration handler.

func WithOnLoopIterationHandler added in v0.2.0

func WithOnLoopIterationHandler(handler OnLoopIterationFunc) Option

WithOnLoopIterationHandler returns an interpreter option which sets the given function as the loop iteration handler.

func WithOnStatementHandler

func WithOnStatementHandler(handler OnStatementFunc) Option

WithOnStatementHandler returns an interpreter option which sets the given function as the statement handler.

func WithPredeclaredValues added in v0.12.0

func WithPredeclaredValues(predeclaredValues []ValueDeclaration) Option

WithPredeclaredValues returns an interpreter option which declares the given the predeclared values.

func WithPublicKeyValidationHandler added in v0.16.0

func WithPublicKeyValidationHandler(handler PublicKeyValidationHandlerFunc) Option

WithPublicKeyValidationHandler returns an interpreter option which sets the given function as the function that is used to handle public key validation.

func WithSignatureVerificationHandler added in v0.18.0

func WithSignatureVerificationHandler(handler SignatureVerificationHandlerFunc) Option

WithSignatureVerificationHandler returns an interpreter option which sets the given function as the function that is used to handle signature validation.

func WithStorageExistenceHandler

func WithStorageExistenceHandler(handler StorageExistenceHandlerFunc) Option

WithStorageExistenceHandler returns an interpreter option which sets the given function as the function that is used when a storage key is checked for existence.

func WithStorageReadHandler

func WithStorageReadHandler(handler StorageReadHandlerFunc) Option

WithStorageReadHandler returns an interpreter option which sets the given function as the function that is used when a stored value is read.

func WithStorageWriteHandler

func WithStorageWriteHandler(handler StorageWriteHandlerFunc) Option

WithStorageWriteHandler returns an interpreter option which sets the given function as the function that is used when a stored value is written.

func WithUUIDHandler

func WithUUIDHandler(handler UUIDHandlerFunc) Option

WithUUIDHandler returns an interpreter option which sets the given function as the function that is used to generate UUIDs.

type OptionalStaticType

type OptionalStaticType struct {
	Type StaticType
}

func (OptionalStaticType) Equal added in v0.15.0

func (t OptionalStaticType) Equal(other StaticType) bool

func (OptionalStaticType) String

func (t OptionalStaticType) String() string

type OptionalValue

type OptionalValue interface {
	Value
	// contains filtered or unexported methods
}

type OverflowError

type OverflowError struct{}

func (OverflowError) Error

func (e OverflowError) Error() string

type OverwriteError

type OverwriteError struct {
	Address AddressValue
	Path    PathValue
	LocationRange
}

OverwriteError

func (OverwriteError) Error

func (e OverwriteError) Error() string

type PathValue

type PathValue struct {
	Domain     common.PathDomain
	Identifier string
}

func (PathValue) Accept added in v0.12.0

func (v PathValue) Accept(interpreter *Interpreter, visitor Visitor)

func (PathValue) ConformsToDynamicType added in v0.15.0

func (v PathValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (PathValue) Copy

func (v PathValue) Copy() Value

func (PathValue) Destroy

func (v PathValue) Destroy(_ *Interpreter, _ func() LocationRange)

func (PathValue) DynamicType

func (v PathValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (PathValue) Equal added in v0.15.0

func (v PathValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (PathValue) GetOwner

func (PathValue) GetOwner() *common.Address

func (PathValue) IsModified added in v0.3.0

func (PathValue) IsModified() bool

func (PathValue) IsStorable added in v0.16.0

func (PathValue) IsStorable() bool

func (PathValue) IsValue

func (PathValue) IsValue()

func (PathValue) KeyString added in v0.12.0

func (v PathValue) KeyString() string

func (PathValue) RecursiveString added in v0.17.0

func (v PathValue) RecursiveString(_ SeenReferences) string

func (PathValue) SetModified added in v0.3.0

func (PathValue) SetModified(_ bool)

func (PathValue) SetOwner

func (PathValue) SetOwner(_ *common.Address)

func (PathValue) StaticType added in v0.12.0

func (v PathValue) StaticType() StaticType

func (PathValue) String

func (v PathValue) String() string

func (PathValue) Walk added in v0.19.0

func (PathValue) Walk(_ func(Value))

type PositionedError added in v0.12.1

type PositionedError struct {
	Err error
	ast.Range
}

PositionedError wraps an unpositioned error with position info

func (PositionedError) Error added in v0.12.1

func (e PositionedError) Error() string

func (PositionedError) Unwrap added in v0.12.1

func (e PositionedError) Unwrap() error

type PrimitiveStaticType added in v0.2.0

type PrimitiveStaticType uint
const (
	PrimitiveStaticTypeUnknown PrimitiveStaticType = iota
	PrimitiveStaticTypeVoid
	PrimitiveStaticTypeAny
	PrimitiveStaticTypeNever
	PrimitiveStaticTypeAnyStruct
	PrimitiveStaticTypeAnyResource
	PrimitiveStaticTypeBool
	PrimitiveStaticTypeAddress
	PrimitiveStaticTypeString
	PrimitiveStaticTypeCharacter
	PrimitiveStaticTypeMetaType
	PrimitiveStaticTypeBlock

	// Number
	PrimitiveStaticTypeNumber
	PrimitiveStaticTypeSignedNumber

	// Integer
	PrimitiveStaticTypeInteger
	PrimitiveStaticTypeSignedInteger

	// FixedPoint
	PrimitiveStaticTypeFixedPoint
	PrimitiveStaticTypeSignedFixedPoint

	// Int*
	PrimitiveStaticTypeInt
	PrimitiveStaticTypeInt8
	PrimitiveStaticTypeInt16
	PrimitiveStaticTypeInt32
	PrimitiveStaticTypeInt64
	PrimitiveStaticTypeInt128
	PrimitiveStaticTypeInt256

	// UInt*
	PrimitiveStaticTypeUInt
	PrimitiveStaticTypeUInt8
	PrimitiveStaticTypeUInt16
	PrimitiveStaticTypeUInt32
	PrimitiveStaticTypeUInt64
	PrimitiveStaticTypeUInt128
	PrimitiveStaticTypeUInt256

	PrimitiveStaticTypeWord8
	PrimitiveStaticTypeWord16
	PrimitiveStaticTypeWord32
	PrimitiveStaticTypeWord64

	PrimitiveStaticTypeFix64

	PrimitiveStaticTypeUFix64

	PrimitiveStaticTypePath
	PrimitiveStaticTypeCapability
	PrimitiveStaticTypeStoragePath
	PrimitiveStaticTypeCapabilityPath
	PrimitiveStaticTypePublicPath
	PrimitiveStaticTypePrivatePath

	PrimitiveStaticTypeAuthAccount
	PrimitiveStaticTypePublicAccount
	PrimitiveStaticTypeDeployedContract
	PrimitiveStaticTypeAuthAccountContracts
	PrimitiveStaticTypePublicAccountContracts
)

func ConvertSemaToPrimitiveStaticType added in v0.2.0

func ConvertSemaToPrimitiveStaticType(t sema.Type) PrimitiveStaticType

ConvertSemaToPrimitiveStaticType converts a `sema.Type` to a `PrimitiveStaticType`.

Returns `PrimitiveStaticTypeUnknown` if the given type is not a primitive type.

func (PrimitiveStaticType) Equal added in v0.15.0

func (t PrimitiveStaticType) Equal(other StaticType) bool

func (PrimitiveStaticType) SemaType added in v0.2.0

func (i PrimitiveStaticType) SemaType() sema.Type

func (PrimitiveStaticType) String added in v0.2.0

func (i PrimitiveStaticType) String() string

type PrivatePathDynamicType added in v0.11.0

type PrivatePathDynamicType struct{}

func (PrivatePathDynamicType) IsDynamicType added in v0.11.0

func (PrivatePathDynamicType) IsDynamicType()

func (PrivatePathDynamicType) IsImportable added in v0.18.0

func (PrivatePathDynamicType) IsImportable() bool

type Program added in v0.13.0

type Program struct {
	Program     *ast.Program
	Elaboration *sema.Elaboration
}

func ProgramFromChecker added in v0.13.0

func ProgramFromChecker(checker *sema.Checker) *Program

type PublicKeyValidationHandlerFunc added in v0.16.0

type PublicKeyValidationHandlerFunc func(publicKey *CompositeValue) BoolValue

PublicKeyValidationHandlerFunc is a function that validates a given public key.

type PublicPathDynamicType added in v0.11.0

type PublicPathDynamicType struct{}

func (PublicPathDynamicType) IsDynamicType added in v0.11.0

func (PublicPathDynamicType) IsDynamicType()

func (PublicPathDynamicType) IsImportable added in v0.18.0

func (PublicPathDynamicType) IsImportable() bool

type RedeclarationError

type RedeclarationError struct {
	Name string
}

func (RedeclarationError) Error

func (e RedeclarationError) Error() string

type ReferenceDynamicType

type ReferenceDynamicType interface {
	DynamicType

	Authorized() bool
	InnerType() DynamicType
	BorrowedType() sema.Type
	// contains filtered or unexported methods
}

type ReferenceStaticType

type ReferenceStaticType struct {
	Authorized bool
	Type       StaticType
}

func ConvertSemaReferenceTyoeToStaticReferenceType added in v0.19.0

func ConvertSemaReferenceTyoeToStaticReferenceType(t *sema.ReferenceType) ReferenceStaticType

func (ReferenceStaticType) Equal added in v0.15.0

func (t ReferenceStaticType) Equal(other StaticType) bool

func (ReferenceStaticType) String

func (t ReferenceStaticType) String() string

type ResourceConstructionError added in v0.19.0

type ResourceConstructionError struct {
	CompositeType *sema.CompositeType
	LocationRange
}

ResourceConstructionError

func (ResourceConstructionError) Error added in v0.19.0

type RestrictedStaticType

type RestrictedStaticType struct {
	Type         StaticType
	Restrictions []InterfaceStaticType
}

func (*RestrictedStaticType) Equal added in v0.15.0

func (t *RestrictedStaticType) Equal(other StaticType) bool

func (*RestrictedStaticType) String

func (t *RestrictedStaticType) String() string

type SeenReferences added in v0.19.0

type SeenReferences map[*EphemeralReferenceValue]struct{}

SeenReferences is a set of seen references.

NOTE: Do not generalize to map[interpreter.Value], as not all values are Go hashable, i.e. this might lead to run-time panics

type SignatureVerificationHandlerFunc added in v0.18.0

type SignatureVerificationHandlerFunc func(
	signature *ArrayValue,
	signedData *ArrayValue,
	domainSeparationTag *StringValue,
	hashAlgorithm *CompositeValue,
	key *CompositeValue,
) BoolValue

SignatureVerificationHandlerFunc is a function that validates a signature.

type SomeDynamicType

type SomeDynamicType struct {
	InnerType DynamicType
}

func (SomeDynamicType) IsDynamicType

func (SomeDynamicType) IsDynamicType()

func (SomeDynamicType) IsImportable added in v0.18.0

func (t SomeDynamicType) IsImportable() bool

type SomeValue

type SomeValue struct {
	Value Value
	Owner *common.Address
}

func NewSomeValueOwningNonCopying

func NewSomeValueOwningNonCopying(value Value) *SomeValue

func (*SomeValue) Accept added in v0.12.0

func (v *SomeValue) Accept(interpreter *Interpreter, visitor Visitor)

func (SomeValue) ConformsToDynamicType added in v0.15.0

func (v SomeValue) ConformsToDynamicType(
	interpreter *Interpreter,
	dynamicType DynamicType,
	results TypeConformanceResults,
) bool

func (*SomeValue) Copy

func (v *SomeValue) Copy() Value

func (*SomeValue) Destroy

func (v *SomeValue) Destroy(interpreter *Interpreter, getLocationRange func() LocationRange)

func (*SomeValue) DynamicType

func (v *SomeValue) DynamicType(interpreter *Interpreter, seenReferences SeenReferences) DynamicType

func (*SomeValue) Equal added in v0.15.0

func (v *SomeValue) Equal(other Value, interpreter *Interpreter, loadDeferred bool) bool

func (*SomeValue) GetMember added in v0.9.0

func (v *SomeValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (*SomeValue) GetOwner

func (v *SomeValue) GetOwner() *common.Address

func (*SomeValue) IsModified added in v0.3.0

func (v *SomeValue) IsModified() bool

func (*SomeValue) IsStorable added in v0.16.0

func (v *SomeValue) IsStorable() bool

func (*SomeValue) IsValue

func (*SomeValue) IsValue()

func (*SomeValue) RecursiveString added in v0.17.0

func (v *SomeValue) RecursiveString(seenReferences SeenReferences) string

func (*SomeValue) SetMember added in v0.9.0

func (*SomeValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (*SomeValue) SetModified added in v0.3.0

func (v *SomeValue) SetModified(modified bool)

func (*SomeValue) SetOwner

func (v *SomeValue) SetOwner(owner *common.Address)

func (*SomeValue) StaticType added in v0.12.0

func (v *SomeValue) StaticType() StaticType

func (*SomeValue) String

func (v *SomeValue) String() string

func (*SomeValue) Walk added in v0.19.0

func (v *SomeValue) Walk(walkChild func(Value))

type StaticType

type StaticType interface {
	fmt.Stringer

	Equal(other StaticType) bool
	// contains filtered or unexported methods
}

StaticType is a shallow representation of a static type (`sema.Type`) which doesn't contain the full information, but only refers to composite and interface types by ID.

This allows static types to be efficiently serialized and deserialized, for example in the world state.

func ConvertSemaToStaticType

func ConvertSemaToStaticType(t sema.Type) StaticType

type StorageExistenceHandlerFunc

type StorageExistenceHandlerFunc func(
	inter *Interpreter,
	storageAddress common.Address,
	key string,
) bool

StorageExistenceHandlerFunc is a function that handles storage existence checks.

type StoragePathDynamicType added in v0.11.0

type StoragePathDynamicType struct{}

func (StoragePathDynamicType) IsDynamicType added in v0.11.0

func (StoragePathDynamicType) IsDynamicType()

func (StoragePathDynamicType) IsImportable added in v0.18.0

func (StoragePathDynamicType) IsImportable() bool

type StorageReadHandlerFunc

type StorageReadHandlerFunc func(
	inter *Interpreter,
	storageAddress common.Address,
	key string,
	deferred bool,
) OptionalValue

StorageReadHandlerFunc is a function that handles storage reads.

type StorageReferenceDynamicType

type StorageReferenceDynamicType struct {
	// contains filtered or unexported fields
}

func (StorageReferenceDynamicType) Authorized

func (t StorageReferenceDynamicType) Authorized() bool

func (StorageReferenceDynamicType) BorrowedType added in v0.16.0

func (t StorageReferenceDynamicType) BorrowedType() sema.Type

func (StorageReferenceDynamicType) InnerType

func (StorageReferenceDynamicType) IsDynamicType

func (StorageReferenceDynamicType) IsDynamicType()

func (StorageReferenceDynamicType) IsImportable added in v0.18.0

func (StorageReferenceDynamicType) IsImportable() bool

type StorageReferenceValue

type StorageReferenceValue struct {
	Authorized           bool
	TargetStorageAddress common.Address
	TargetKey            string
	BorrowedType         sema.Type
}

func (*StorageReferenceValue) Accept added in v0.12.0

func (v *StorageReferenceValue) Accept(interpreter *Interpreter, visitor Visitor)

func (*StorageReferenceValue) ConformsToDynamicType added in v0.15.0

func (v *StorageReferenceValue) ConformsToDynamicType(
	interpreter *Interpreter,
	dynamicType DynamicType,
	results TypeConformanceResults,
) bool

func (*StorageReferenceValue) Copy

func (v *StorageReferenceValue) Copy() Value

func (*StorageReferenceValue) DynamicType

func (v *StorageReferenceValue) DynamicType(interpreter *Interpreter, seenReferences SeenReferences) DynamicType

func (*StorageReferenceValue) Equal

func (v *StorageReferenceValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (*StorageReferenceValue) Get

func (v *StorageReferenceValue) Get(interpreter *Interpreter, getLocationRange func() LocationRange, key Value) Value

func (*StorageReferenceValue) GetMember

func (v *StorageReferenceValue) GetMember(interpreter *Interpreter, getLocationRange func() LocationRange, name string) Value

func (*StorageReferenceValue) GetOwner

func (v *StorageReferenceValue) GetOwner() *common.Address

func (*StorageReferenceValue) IsModified added in v0.3.0

func (*StorageReferenceValue) IsModified() bool

func (*StorageReferenceValue) IsStorable added in v0.16.0

func (*StorageReferenceValue) IsStorable() bool

func (*StorageReferenceValue) IsValue

func (*StorageReferenceValue) IsValue()

func (*StorageReferenceValue) RecursiveString added in v0.17.0

func (v *StorageReferenceValue) RecursiveString(_ SeenReferences) string

func (*StorageReferenceValue) ReferencedValue added in v0.11.0

func (v *StorageReferenceValue) ReferencedValue(interpreter *Interpreter) *Value

func (*StorageReferenceValue) Set

func (v *StorageReferenceValue) Set(interpreter *Interpreter, getLocationRange func() LocationRange, key Value, value Value)

func (*StorageReferenceValue) SetMember

func (v *StorageReferenceValue) SetMember(interpreter *Interpreter, getLocationRange func() LocationRange, name string, value Value)

func (*StorageReferenceValue) SetModified added in v0.3.0

func (*StorageReferenceValue) SetModified(_ bool)

func (*StorageReferenceValue) SetOwner

func (v *StorageReferenceValue) SetOwner(_ *common.Address)

func (*StorageReferenceValue) StaticType added in v0.12.0

func (v *StorageReferenceValue) StaticType() StaticType

func (*StorageReferenceValue) String added in v0.5.0

func (*StorageReferenceValue) String() string

func (*StorageReferenceValue) Walk added in v0.19.0

func (*StorageReferenceValue) Walk(_ func(Value))

type StorageWriteHandlerFunc

type StorageWriteHandlerFunc func(
	inter *Interpreter,
	storageAddress common.Address,
	key string,
	value OptionalValue,
)

StorageWriteHandlerFunc is a function that handles storage writes.

type StringComputedFieldOrderedMap added in v0.13.5

type StringComputedFieldOrderedMap struct {
	// contains filtered or unexported fields
}

StringComputedFieldOrderedMap

func NewStringComputedFieldOrderedMap added in v0.13.5

func NewStringComputedFieldOrderedMap() *StringComputedFieldOrderedMap

NewStringComputedFieldOrderedMap creates a new StringComputedFieldOrderedMap.

func (*StringComputedFieldOrderedMap) Clear added in v0.14.1

func (om *StringComputedFieldOrderedMap) Clear()

Clear removes all entries from this ordered map.

func (*StringComputedFieldOrderedMap) Delete added in v0.13.5

func (om *StringComputedFieldOrderedMap) Delete(key string) (oldValue ComputedField, present bool)

Delete removes the key-value pair, and returns what `Get` would have returned on that key prior to the call to `Delete`.

func (*StringComputedFieldOrderedMap) Foreach added in v0.13.5

func (om *StringComputedFieldOrderedMap) Foreach(f func(key string, value ComputedField))

Foreach iterates over the entries of the map in the insertion order, and invokes the provided function for each key-value pair.

func (*StringComputedFieldOrderedMap) ForeachWithError added in v0.19.0

func (om *StringComputedFieldOrderedMap) ForeachWithError(f func(key string, value ComputedField) error) error

ForeachWithError iterates over the entries of the map in the insertion order, and invokes the provided function for each key-value pair. If the passed function returns an error, iteration breaks and the error is returned.

func (*StringComputedFieldOrderedMap) Get added in v0.13.5

func (om *StringComputedFieldOrderedMap) Get(key string) (result ComputedField, present bool)

Get returns the value associated with the given key. Returns nil if not found. The second return value indicates if the key is present in the map.

func (*StringComputedFieldOrderedMap) GetPair added in v0.13.5

GetPair returns the key-value pair associated with the given key. Returns nil if not found.

func (*StringComputedFieldOrderedMap) Len added in v0.13.5

Len returns the length of the ordered map.

func (*StringComputedFieldOrderedMap) Newest added in v0.13.5

Newest returns a pointer to the newest pair.

func (*StringComputedFieldOrderedMap) Oldest added in v0.13.5

Oldest returns a pointer to the oldest pair.

func (*StringComputedFieldOrderedMap) Set added in v0.13.5

func (om *StringComputedFieldOrderedMap) Set(key string, value ComputedField) (oldValue ComputedField, present bool)

Set sets the key-value pair, and returns what `Get` would have returned on that key prior to the call to `Set`.

type StringComputedFieldPair added in v0.13.5

type StringComputedFieldPair struct {
	Key   string
	Value ComputedField
	// contains filtered or unexported fields
}

StringComputedFieldPair

func (*StringComputedFieldPair) Next added in v0.13.5

Next returns a pointer to the next pair.

func (*StringComputedFieldPair) Prev added in v0.13.5

Prev returns a pointer to the previous pair.

type StringDynamicType

type StringDynamicType struct{}

func (StringDynamicType) IsDynamicType

func (StringDynamicType) IsDynamicType()

func (StringDynamicType) IsImportable added in v0.18.0

func (StringDynamicType) IsImportable() bool

type StringIndexOutOfBoundsError added in v0.16.0

type StringIndexOutOfBoundsError struct {
	Index  int
	Length int
	LocationRange
}

StringIndexOutOfBoundsError

func (StringIndexOutOfBoundsError) Error added in v0.16.0

type StringValue

type StringValue struct {
	Str string
	// contains filtered or unexported fields
}

func NewStringValue

func NewStringValue(str string) *StringValue

func (*StringValue) Accept added in v0.12.0

func (v *StringValue) Accept(interpreter *Interpreter, visitor Visitor)

func (*StringValue) Concat

func (v *StringValue) Concat(other ConcatenatableValue) Value

func (*StringValue) ConformsToDynamicType added in v0.15.0

func (*StringValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (*StringValue) Copy

func (v *StringValue) Copy() Value

func (*StringValue) DecodeHex added in v0.5.0

func (v *StringValue) DecodeHex() *ArrayValue

DecodeHex hex-decodes this string and returns an array of UInt8 values

func (*StringValue) DynamicType

func (*StringValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (*StringValue) Equal

func (v *StringValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (*StringValue) Get

func (v *StringValue) Get(_ *Interpreter, getLocationRange func() LocationRange, key Value) Value

func (*StringValue) GetMember

func (v *StringValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (*StringValue) GetOwner

func (*StringValue) GetOwner() *common.Address

func (*StringValue) IsModified added in v0.3.0

func (*StringValue) IsModified() bool

func (*StringValue) IsStorable added in v0.16.0

func (*StringValue) IsStorable() bool

func (*StringValue) IsValue

func (*StringValue) IsValue()

func (*StringValue) KeyString

func (v *StringValue) KeyString() string

func (*StringValue) Length added in v0.5.0

func (v *StringValue) Length() int

Length returns the number of characters (grapheme clusters)

func (*StringValue) NormalForm

func (v *StringValue) NormalForm() string

func (*StringValue) RecursiveString added in v0.17.0

func (v *StringValue) RecursiveString(_ SeenReferences) string

func (*StringValue) Set

func (v *StringValue) Set(_ *Interpreter, _ func() LocationRange, _ Value, _ Value)

func (*StringValue) SetMember

func (*StringValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (*StringValue) SetModified added in v0.2.1

func (*StringValue) SetModified(_ bool)

func (*StringValue) SetOwner

func (*StringValue) SetOwner(_ *common.Address)

func (*StringValue) Slice

func (v *StringValue) Slice(from IntValue, to IntValue, getLocationRange func() LocationRange) Value

func (*StringValue) StaticType added in v0.12.0

func (*StringValue) StaticType() StaticType

func (*StringValue) String

func (v *StringValue) String() string

func (*StringValue) Walk added in v0.19.0

func (*StringValue) Walk(_ func(Value))

type StringValueOrderedMap added in v0.13.0

type StringValueOrderedMap struct {
	// contains filtered or unexported fields
}

StringValueOrderedMap

func NewStringValueOrderedMap added in v0.13.0

func NewStringValueOrderedMap() *StringValueOrderedMap

NewStringValueOrderedMap creates a new StringValueOrderedMap.

func (*StringValueOrderedMap) Clear added in v0.14.1

func (om *StringValueOrderedMap) Clear()

Clear removes all entries from this ordered map.

func (*StringValueOrderedMap) Delete added in v0.13.0

func (om *StringValueOrderedMap) Delete(key string) (oldValue Value, present bool)

Delete removes the key-value pair, and returns what `Get` would have returned on that key prior to the call to `Delete`.

func (*StringValueOrderedMap) Foreach added in v0.13.0

func (om *StringValueOrderedMap) Foreach(f func(key string, value Value))

Foreach iterates over the entries of the map in the insertion order, and invokes the provided function for each key-value pair.

func (*StringValueOrderedMap) ForeachWithError added in v0.19.0

func (om *StringValueOrderedMap) ForeachWithError(f func(key string, value Value) error) error

ForeachWithError iterates over the entries of the map in the insertion order, and invokes the provided function for each key-value pair. If the passed function returns an error, iteration breaks and the error is returned.

func (*StringValueOrderedMap) Get added in v0.13.0

func (om *StringValueOrderedMap) Get(key string) (result Value, present bool)

Get returns the value associated with the given key. Returns nil if not found. The second return value indicates if the key is present in the map.

func (*StringValueOrderedMap) GetPair added in v0.13.0

func (om *StringValueOrderedMap) GetPair(key string) *StringValuePair

GetPair returns the key-value pair associated with the given key. Returns nil if not found.

func (*StringValueOrderedMap) Len added in v0.13.0

func (om *StringValueOrderedMap) Len() int

Len returns the length of the ordered map.

func (*StringValueOrderedMap) Newest added in v0.13.0

func (om *StringValueOrderedMap) Newest() *StringValuePair

Newest returns a pointer to the newest pair.

func (*StringValueOrderedMap) Oldest added in v0.13.0

func (om *StringValueOrderedMap) Oldest() *StringValuePair

Oldest returns a pointer to the oldest pair.

func (*StringValueOrderedMap) Set added in v0.13.0

func (om *StringValueOrderedMap) Set(key string, value Value) (oldValue Value, present bool)

Set sets the key-value pair, and returns what `Get` would have returned on that key prior to the call to `Set`.

type StringValuePair added in v0.13.0

type StringValuePair struct {
	Key   string
	Value Value
	// contains filtered or unexported fields
}

StringValuePair

func (*StringValuePair) Next added in v0.13.0

func (p *StringValuePair) Next() *StringValuePair

Next returns a pointer to the next pair.

func (*StringValuePair) Prev added in v0.13.0

func (p *StringValuePair) Prev() *StringValuePair

Prev returns a pointer to the previous pair.

type StringVariableOrderedMap added in v0.13.9

type StringVariableOrderedMap struct {
	// contains filtered or unexported fields
}

StringVariableOrderedMap

func NewStringVariableOrderedMap added in v0.13.9

func NewStringVariableOrderedMap() *StringVariableOrderedMap

NewStringVariableOrderedMap creates a new StringVariableOrderedMap.

func (*StringVariableOrderedMap) Clear added in v0.14.3

func (om *StringVariableOrderedMap) Clear()

Clear removes all entries from this ordered map.

func (*StringVariableOrderedMap) Delete added in v0.13.9

func (om *StringVariableOrderedMap) Delete(key string) (oldValue *Variable, present bool)

Delete removes the key-value pair, and returns what `Get` would have returned on that key prior to the call to `Delete`.

func (*StringVariableOrderedMap) Foreach added in v0.13.9

func (om *StringVariableOrderedMap) Foreach(f func(key string, value *Variable))

Foreach iterates over the entries of the map in the insertion order, and invokes the provided function for each key-value pair.

func (*StringVariableOrderedMap) ForeachWithError added in v0.19.0

func (om *StringVariableOrderedMap) ForeachWithError(f func(key string, value *Variable) error) error

ForeachWithError iterates over the entries of the map in the insertion order, and invokes the provided function for each key-value pair. If the passed function returns an error, iteration breaks and the error is returned.

func (*StringVariableOrderedMap) Get added in v0.13.9

func (om *StringVariableOrderedMap) Get(key string) (result *Variable, present bool)

Get returns the value associated with the given key. Returns nil if not found. The second return value indicates if the key is present in the map.

func (*StringVariableOrderedMap) GetPair added in v0.13.9

GetPair returns the key-value pair associated with the given key. Returns nil if not found.

func (*StringVariableOrderedMap) Len added in v0.13.9

func (om *StringVariableOrderedMap) Len() int

Len returns the length of the ordered map.

func (*StringVariableOrderedMap) Newest added in v0.13.9

Newest returns a pointer to the newest pair.

func (*StringVariableOrderedMap) Oldest added in v0.13.9

Oldest returns a pointer to the oldest pair.

func (*StringVariableOrderedMap) Set added in v0.13.9

func (om *StringVariableOrderedMap) Set(key string, value *Variable) (oldValue *Variable, present bool)

Set sets the key-value pair, and returns what `Get` would have returned on that key prior to the call to `Set`.

type StringVariablePair added in v0.13.9

type StringVariablePair struct {
	Key   string
	Value *Variable
	// contains filtered or unexported fields
}

StringVariablePair

func (*StringVariablePair) Next added in v0.13.9

Next returns a pointer to the next pair.

func (*StringVariablePair) Prev added in v0.13.9

Prev returns a pointer to the previous pair.

type TransactionNotDeclaredError

type TransactionNotDeclaredError struct {
	Index int
}

func (TransactionNotDeclaredError) Error

type TypeCodes added in v0.5.0

type TypeCodes struct {
	CompositeCodes       map[sema.TypeID]CompositeTypeCode
	InterfaceCodes       map[sema.TypeID]WrapperCode
	TypeRequirementCodes map[sema.TypeID]WrapperCode
}

TypeCodes is the value which stores the "prepared" / "callable" "code" of all composite types, interface types, and type requirements.

func (TypeCodes) Merge added in v0.5.0

func (c TypeCodes) Merge(codes TypeCodes)

type TypeConformanceResults added in v0.15.0

type TypeConformanceResults map[typeConformanceResultEntry]bool

type TypeLoadingError added in v0.10.5

type TypeLoadingError struct {
	TypeID common.TypeID
}

TypeLoadingError

func (TypeLoadingError) Error added in v0.10.5

func (e TypeLoadingError) Error() string

type TypeMismatchError

type TypeMismatchError struct {
	ExpectedType sema.Type
	LocationRange
}

TypeMismatchError

func (TypeMismatchError) Error

func (e TypeMismatchError) Error() string

type TypeParameter added in v0.19.0

type TypeParameter struct {
	Name      string
	TypeBound StaticType
	Optional  bool
}

func (TypeParameter) Equal added in v0.19.0

func (p TypeParameter) Equal(other *TypeParameter) bool

func (TypeParameter) String added in v0.19.0

func (p TypeParameter) String() string

type TypeValue added in v0.4.0

type TypeValue struct {
	Type StaticType
}

func (TypeValue) Accept added in v0.12.0

func (v TypeValue) Accept(interpreter *Interpreter, visitor Visitor)

func (TypeValue) ConformsToDynamicType added in v0.15.0

func (v TypeValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (TypeValue) Copy added in v0.4.0

func (v TypeValue) Copy() Value

func (TypeValue) DynamicType added in v0.4.0

func (TypeValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (TypeValue) Equal added in v0.4.0

func (v TypeValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (TypeValue) GetMember added in v0.4.0

func (v TypeValue) GetMember(inter *Interpreter, _ func() LocationRange, name string) Value

func (TypeValue) GetOwner added in v0.4.0

func (TypeValue) GetOwner() *common.Address

func (TypeValue) IsModified added in v0.4.0

func (TypeValue) IsModified() bool

func (TypeValue) IsStorable added in v0.16.0

func (TypeValue) IsStorable() bool

func (TypeValue) IsValue added in v0.4.0

func (TypeValue) IsValue()

func (TypeValue) RecursiveString added in v0.17.0

func (v TypeValue) RecursiveString(_ SeenReferences) string

func (TypeValue) SetMember added in v0.4.0

func (TypeValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (TypeValue) SetModified added in v0.4.0

func (TypeValue) SetModified(_ bool)

func (TypeValue) SetOwner added in v0.4.0

func (TypeValue) SetOwner(_ *common.Address)

func (TypeValue) StaticType added in v0.12.0

func (TypeValue) StaticType() StaticType

func (TypeValue) String added in v0.4.0

func (v TypeValue) String() string

func (TypeValue) Walk added in v0.19.0

func (TypeValue) Walk(_ func(Value))

type UFix64Value

type UFix64Value uint64

UFix64Value

func ConvertUFix64

func ConvertUFix64(value Value) UFix64Value

func NewUFix64ValueWithInteger added in v0.2.0

func NewUFix64ValueWithInteger(integer uint64) UFix64Value

func (UFix64Value) Accept added in v0.12.0

func (v UFix64Value) Accept(interpreter *Interpreter, visitor Visitor)

func (UFix64Value) ConformsToDynamicType added in v0.15.0

func (v UFix64Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (UFix64Value) Copy

func (v UFix64Value) Copy() Value

func (UFix64Value) Div

func (v UFix64Value) Div(other NumberValue) NumberValue

func (UFix64Value) DynamicType

func (UFix64Value) Equal

func (v UFix64Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (UFix64Value) GetMember added in v0.3.0

func (v UFix64Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (UFix64Value) GetOwner

func (UFix64Value) GetOwner() *common.Address

func (UFix64Value) Greater

func (v UFix64Value) Greater(other NumberValue) BoolValue

func (UFix64Value) GreaterEqual

func (v UFix64Value) GreaterEqual(other NumberValue) BoolValue

func (UFix64Value) IsModified added in v0.3.0

func (UFix64Value) IsModified() bool

func (UFix64Value) IsStorable added in v0.16.0

func (UFix64Value) IsStorable() bool

func (UFix64Value) IsValue

func (UFix64Value) IsValue()

func (UFix64Value) KeyString

func (v UFix64Value) KeyString() string

func (UFix64Value) Less

func (v UFix64Value) Less(other NumberValue) BoolValue

func (UFix64Value) LessEqual

func (v UFix64Value) LessEqual(other NumberValue) BoolValue

func (UFix64Value) Minus

func (v UFix64Value) Minus(other NumberValue) NumberValue

func (UFix64Value) Mod

func (v UFix64Value) Mod(other NumberValue) NumberValue

func (UFix64Value) Mul

func (v UFix64Value) Mul(other NumberValue) NumberValue

func (UFix64Value) Negate

func (v UFix64Value) Negate() NumberValue

func (UFix64Value) Plus

func (v UFix64Value) Plus(other NumberValue) NumberValue

func (UFix64Value) RecursiveString added in v0.17.0

func (v UFix64Value) RecursiveString(_ SeenReferences) string

func (UFix64Value) SaturatingDiv added in v0.15.0

func (v UFix64Value) SaturatingDiv(other NumberValue) NumberValue

func (UFix64Value) SaturatingMinus added in v0.15.0

func (v UFix64Value) SaturatingMinus(other NumberValue) NumberValue

func (UFix64Value) SaturatingMul added in v0.15.0

func (v UFix64Value) SaturatingMul(other NumberValue) NumberValue

func (UFix64Value) SaturatingPlus added in v0.15.0

func (v UFix64Value) SaturatingPlus(other NumberValue) NumberValue

func (UFix64Value) SetMember added in v0.3.0

func (UFix64Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (UFix64Value) SetModified added in v0.3.0

func (UFix64Value) SetModified(_ bool)

func (UFix64Value) SetOwner

func (UFix64Value) SetOwner(_ *common.Address)

func (UFix64Value) StaticType added in v0.12.0

func (UFix64Value) StaticType() StaticType

func (UFix64Value) String

func (v UFix64Value) String() string

func (UFix64Value) ToBigEndianBytes added in v0.5.0

func (v UFix64Value) ToBigEndianBytes() []byte

func (UFix64Value) ToInt

func (v UFix64Value) ToInt() int

func (UFix64Value) Walk added in v0.19.0

func (UFix64Value) Walk(_ func(Value))

type UInt128Value

type UInt128Value struct {
	BigInt *big.Int
}

func ConvertUInt128

func ConvertUInt128(value Value) UInt128Value

func NewUInt128ValueFromBigInt

func NewUInt128ValueFromBigInt(value *big.Int) UInt128Value

func NewUInt128ValueFromUint64 added in v0.2.0

func NewUInt128ValueFromUint64(value uint64) UInt128Value

func (UInt128Value) Accept added in v0.12.0

func (v UInt128Value) Accept(interpreter *Interpreter, visitor Visitor)

func (UInt128Value) BitwiseAnd added in v0.2.0

func (v UInt128Value) BitwiseAnd(other IntegerValue) IntegerValue

func (UInt128Value) BitwiseLeftShift added in v0.2.0

func (v UInt128Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (UInt128Value) BitwiseOr added in v0.2.0

func (v UInt128Value) BitwiseOr(other IntegerValue) IntegerValue

func (UInt128Value) BitwiseRightShift added in v0.2.0

func (v UInt128Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (UInt128Value) BitwiseXor added in v0.2.0

func (v UInt128Value) BitwiseXor(other IntegerValue) IntegerValue

func (UInt128Value) ConformsToDynamicType added in v0.15.0

func (v UInt128Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (UInt128Value) Copy

func (v UInt128Value) Copy() Value

func (UInt128Value) Div

func (v UInt128Value) Div(other NumberValue) NumberValue

func (UInt128Value) DynamicType

func (UInt128Value) Equal

func (v UInt128Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (UInt128Value) GetMember added in v0.3.0

func (v UInt128Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (UInt128Value) GetOwner

func (UInt128Value) GetOwner() *common.Address

func (UInt128Value) Greater

func (v UInt128Value) Greater(other NumberValue) BoolValue

func (UInt128Value) GreaterEqual

func (v UInt128Value) GreaterEqual(other NumberValue) BoolValue

func (UInt128Value) IsModified added in v0.3.0

func (UInt128Value) IsModified() bool

func (UInt128Value) IsStorable added in v0.16.0

func (UInt128Value) IsStorable() bool

func (UInt128Value) IsValue

func (v UInt128Value) IsValue()

func (UInt128Value) KeyString

func (v UInt128Value) KeyString() string

func (UInt128Value) Less

func (v UInt128Value) Less(other NumberValue) BoolValue

func (UInt128Value) LessEqual

func (v UInt128Value) LessEqual(other NumberValue) BoolValue

func (UInt128Value) Minus

func (v UInt128Value) Minus(other NumberValue) NumberValue

func (UInt128Value) Mod

func (v UInt128Value) Mod(other NumberValue) NumberValue

func (UInt128Value) Mul

func (v UInt128Value) Mul(other NumberValue) NumberValue

func (UInt128Value) Negate

func (v UInt128Value) Negate() NumberValue

func (UInt128Value) Plus

func (v UInt128Value) Plus(other NumberValue) NumberValue

func (UInt128Value) RecursiveString added in v0.17.0

func (v UInt128Value) RecursiveString(_ SeenReferences) string

func (UInt128Value) SaturatingDiv added in v0.15.0

func (v UInt128Value) SaturatingDiv(other NumberValue) NumberValue

func (UInt128Value) SaturatingMinus added in v0.15.0

func (v UInt128Value) SaturatingMinus(other NumberValue) NumberValue

func (UInt128Value) SaturatingMul added in v0.15.0

func (v UInt128Value) SaturatingMul(other NumberValue) NumberValue

func (UInt128Value) SaturatingPlus added in v0.15.0

func (v UInt128Value) SaturatingPlus(other NumberValue) NumberValue

func (UInt128Value) SetMember added in v0.3.0

func (UInt128Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (UInt128Value) SetModified added in v0.3.0

func (UInt128Value) SetModified(_ bool)

func (UInt128Value) SetOwner

func (UInt128Value) SetOwner(_ *common.Address)

func (UInt128Value) StaticType added in v0.12.0

func (UInt128Value) StaticType() StaticType

func (UInt128Value) String

func (v UInt128Value) String() string

func (UInt128Value) ToBigEndianBytes added in v0.5.0

func (v UInt128Value) ToBigEndianBytes() []byte

func (UInt128Value) ToBigInt

func (v UInt128Value) ToBigInt() *big.Int

func (UInt128Value) ToInt

func (v UInt128Value) ToInt() int

func (UInt128Value) Walk added in v0.19.0

func (UInt128Value) Walk(_ func(Value))

type UInt16Value

type UInt16Value uint16

func ConvertUInt16

func ConvertUInt16(value Value) UInt16Value

func (UInt16Value) Accept added in v0.12.0

func (v UInt16Value) Accept(interpreter *Interpreter, visitor Visitor)

func (UInt16Value) BitwiseAnd added in v0.2.0

func (v UInt16Value) BitwiseAnd(other IntegerValue) IntegerValue

func (UInt16Value) BitwiseLeftShift added in v0.2.0

func (v UInt16Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (UInt16Value) BitwiseOr added in v0.2.0

func (v UInt16Value) BitwiseOr(other IntegerValue) IntegerValue

func (UInt16Value) BitwiseRightShift added in v0.2.0

func (v UInt16Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (UInt16Value) BitwiseXor added in v0.2.0

func (v UInt16Value) BitwiseXor(other IntegerValue) IntegerValue

func (UInt16Value) ConformsToDynamicType added in v0.15.0

func (v UInt16Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (UInt16Value) Copy

func (v UInt16Value) Copy() Value

func (UInt16Value) Div

func (v UInt16Value) Div(other NumberValue) NumberValue

func (UInt16Value) DynamicType

func (UInt16Value) Equal

func (v UInt16Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (UInt16Value) GetMember added in v0.3.0

func (v UInt16Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (UInt16Value) GetOwner

func (UInt16Value) GetOwner() *common.Address

func (UInt16Value) Greater

func (v UInt16Value) Greater(other NumberValue) BoolValue

func (UInt16Value) GreaterEqual

func (v UInt16Value) GreaterEqual(other NumberValue) BoolValue

func (UInt16Value) IsModified added in v0.3.0

func (UInt16Value) IsModified() bool

func (UInt16Value) IsStorable added in v0.16.0

func (UInt16Value) IsStorable() bool

func (UInt16Value) IsValue

func (UInt16Value) IsValue()

func (UInt16Value) KeyString

func (v UInt16Value) KeyString() string

func (UInt16Value) Less

func (v UInt16Value) Less(other NumberValue) BoolValue

func (UInt16Value) LessEqual

func (v UInt16Value) LessEqual(other NumberValue) BoolValue

func (UInt16Value) Minus

func (v UInt16Value) Minus(other NumberValue) NumberValue

func (UInt16Value) Mod

func (v UInt16Value) Mod(other NumberValue) NumberValue

func (UInt16Value) Mul

func (v UInt16Value) Mul(other NumberValue) NumberValue

func (UInt16Value) Negate

func (v UInt16Value) Negate() NumberValue

func (UInt16Value) Plus

func (v UInt16Value) Plus(other NumberValue) NumberValue

func (UInt16Value) RecursiveString added in v0.17.0

func (v UInt16Value) RecursiveString(_ SeenReferences) string

func (UInt16Value) SaturatingDiv added in v0.15.0

func (v UInt16Value) SaturatingDiv(other NumberValue) NumberValue

func (UInt16Value) SaturatingMinus added in v0.15.0

func (v UInt16Value) SaturatingMinus(other NumberValue) NumberValue

func (UInt16Value) SaturatingMul added in v0.15.0

func (v UInt16Value) SaturatingMul(other NumberValue) NumberValue

func (UInt16Value) SaturatingPlus added in v0.15.0

func (v UInt16Value) SaturatingPlus(other NumberValue) NumberValue

func (UInt16Value) SetMember added in v0.3.0

func (UInt16Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (UInt16Value) SetModified added in v0.3.0

func (UInt16Value) SetModified(_ bool)

func (UInt16Value) SetOwner

func (UInt16Value) SetOwner(_ *common.Address)

func (UInt16Value) StaticType added in v0.12.0

func (UInt16Value) StaticType() StaticType

func (UInt16Value) String

func (v UInt16Value) String() string

func (UInt16Value) ToBigEndianBytes added in v0.5.0

func (v UInt16Value) ToBigEndianBytes() []byte

func (UInt16Value) ToInt

func (v UInt16Value) ToInt() int

func (UInt16Value) Walk added in v0.19.0

func (UInt16Value) Walk(_ func(Value))

type UInt256Value

type UInt256Value struct {
	BigInt *big.Int
}

func ConvertUInt256

func ConvertUInt256(value Value) UInt256Value

func NewUInt256ValueFromBigInt

func NewUInt256ValueFromBigInt(value *big.Int) UInt256Value

func NewUInt256ValueFromUint64 added in v0.2.0

func NewUInt256ValueFromUint64(value uint64) UInt256Value

func (UInt256Value) Accept added in v0.12.0

func (v UInt256Value) Accept(interpreter *Interpreter, visitor Visitor)

func (UInt256Value) BitwiseAnd added in v0.2.0

func (v UInt256Value) BitwiseAnd(other IntegerValue) IntegerValue

func (UInt256Value) BitwiseLeftShift added in v0.2.0

func (v UInt256Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (UInt256Value) BitwiseOr added in v0.2.0

func (v UInt256Value) BitwiseOr(other IntegerValue) IntegerValue

func (UInt256Value) BitwiseRightShift added in v0.2.0

func (v UInt256Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (UInt256Value) BitwiseXor added in v0.2.0

func (v UInt256Value) BitwiseXor(other IntegerValue) IntegerValue

func (UInt256Value) ConformsToDynamicType added in v0.15.0

func (v UInt256Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (UInt256Value) Copy

func (v UInt256Value) Copy() Value

func (UInt256Value) Div

func (v UInt256Value) Div(other NumberValue) NumberValue

func (UInt256Value) DynamicType

func (UInt256Value) Equal

func (v UInt256Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (UInt256Value) GetMember added in v0.3.0

func (v UInt256Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (UInt256Value) GetOwner

func (UInt256Value) GetOwner() *common.Address

func (UInt256Value) Greater

func (v UInt256Value) Greater(other NumberValue) BoolValue

func (UInt256Value) GreaterEqual

func (v UInt256Value) GreaterEqual(other NumberValue) BoolValue

func (UInt256Value) IsModified added in v0.3.0

func (UInt256Value) IsModified() bool

func (UInt256Value) IsStorable added in v0.16.0

func (UInt256Value) IsStorable() bool

func (UInt256Value) IsValue

func (v UInt256Value) IsValue()

func (UInt256Value) KeyString

func (v UInt256Value) KeyString() string

func (UInt256Value) Less

func (v UInt256Value) Less(other NumberValue) BoolValue

func (UInt256Value) LessEqual

func (v UInt256Value) LessEqual(other NumberValue) BoolValue

func (UInt256Value) Minus

func (v UInt256Value) Minus(other NumberValue) NumberValue

func (UInt256Value) Mod

func (v UInt256Value) Mod(other NumberValue) NumberValue

func (UInt256Value) Mul

func (v UInt256Value) Mul(other NumberValue) NumberValue

func (UInt256Value) Negate

func (v UInt256Value) Negate() NumberValue

func (UInt256Value) Plus

func (v UInt256Value) Plus(other NumberValue) NumberValue

func (UInt256Value) RecursiveString added in v0.17.0

func (v UInt256Value) RecursiveString(_ SeenReferences) string

func (UInt256Value) SaturatingDiv added in v0.15.0

func (v UInt256Value) SaturatingDiv(other NumberValue) NumberValue

func (UInt256Value) SaturatingMinus added in v0.15.0

func (v UInt256Value) SaturatingMinus(other NumberValue) NumberValue

func (UInt256Value) SaturatingMul added in v0.15.0

func (v UInt256Value) SaturatingMul(other NumberValue) NumberValue

func (UInt256Value) SaturatingPlus added in v0.15.0

func (v UInt256Value) SaturatingPlus(other NumberValue) NumberValue

func (UInt256Value) SetMember added in v0.3.0

func (UInt256Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (UInt256Value) SetModified added in v0.3.0

func (UInt256Value) SetModified(_ bool)

func (UInt256Value) SetOwner

func (UInt256Value) SetOwner(_ *common.Address)

func (UInt256Value) StaticType added in v0.12.0

func (UInt256Value) StaticType() StaticType

func (UInt256Value) String

func (v UInt256Value) String() string

func (UInt256Value) ToBigEndianBytes added in v0.5.0

func (v UInt256Value) ToBigEndianBytes() []byte

func (UInt256Value) ToBigInt

func (v UInt256Value) ToBigInt() *big.Int

func (UInt256Value) ToInt

func (v UInt256Value) ToInt() int

func (UInt256Value) Walk added in v0.19.0

func (UInt256Value) Walk(_ func(Value))

type UInt32Value

type UInt32Value uint32

func ConvertUInt32

func ConvertUInt32(value Value) UInt32Value

func (UInt32Value) Accept added in v0.12.0

func (v UInt32Value) Accept(interpreter *Interpreter, visitor Visitor)

func (UInt32Value) BitwiseAnd added in v0.2.0

func (v UInt32Value) BitwiseAnd(other IntegerValue) IntegerValue

func (UInt32Value) BitwiseLeftShift added in v0.2.0

func (v UInt32Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (UInt32Value) BitwiseOr added in v0.2.0

func (v UInt32Value) BitwiseOr(other IntegerValue) IntegerValue

func (UInt32Value) BitwiseRightShift added in v0.2.0

func (v UInt32Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (UInt32Value) BitwiseXor added in v0.2.0

func (v UInt32Value) BitwiseXor(other IntegerValue) IntegerValue

func (UInt32Value) ConformsToDynamicType added in v0.15.0

func (v UInt32Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (UInt32Value) Copy

func (v UInt32Value) Copy() Value

func (UInt32Value) Div

func (v UInt32Value) Div(other NumberValue) NumberValue

func (UInt32Value) DynamicType

func (UInt32Value) Equal

func (v UInt32Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (UInt32Value) GetMember added in v0.3.0

func (v UInt32Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (UInt32Value) GetOwner

func (UInt32Value) GetOwner() *common.Address

func (UInt32Value) Greater

func (v UInt32Value) Greater(other NumberValue) BoolValue

func (UInt32Value) GreaterEqual

func (v UInt32Value) GreaterEqual(other NumberValue) BoolValue

func (UInt32Value) IsModified added in v0.3.0

func (UInt32Value) IsModified() bool

func (UInt32Value) IsStorable added in v0.16.0

func (UInt32Value) IsStorable() bool

func (UInt32Value) IsValue

func (UInt32Value) IsValue()

func (UInt32Value) KeyString

func (v UInt32Value) KeyString() string

func (UInt32Value) Less

func (v UInt32Value) Less(other NumberValue) BoolValue

func (UInt32Value) LessEqual

func (v UInt32Value) LessEqual(other NumberValue) BoolValue

func (UInt32Value) Minus

func (v UInt32Value) Minus(other NumberValue) NumberValue

func (UInt32Value) Mod

func (v UInt32Value) Mod(other NumberValue) NumberValue

func (UInt32Value) Mul

func (v UInt32Value) Mul(other NumberValue) NumberValue

func (UInt32Value) Negate

func (v UInt32Value) Negate() NumberValue

func (UInt32Value) Plus

func (v UInt32Value) Plus(other NumberValue) NumberValue

func (UInt32Value) RecursiveString added in v0.17.0

func (v UInt32Value) RecursiveString(_ SeenReferences) string

func (UInt32Value) SaturatingDiv added in v0.15.0

func (v UInt32Value) SaturatingDiv(other NumberValue) NumberValue

func (UInt32Value) SaturatingMinus added in v0.15.0

func (v UInt32Value) SaturatingMinus(other NumberValue) NumberValue

func (UInt32Value) SaturatingMul added in v0.15.0

func (v UInt32Value) SaturatingMul(other NumberValue) NumberValue

func (UInt32Value) SaturatingPlus added in v0.15.0

func (v UInt32Value) SaturatingPlus(other NumberValue) NumberValue

func (UInt32Value) SetMember added in v0.3.0

func (UInt32Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (UInt32Value) SetModified added in v0.3.0

func (UInt32Value) SetModified(_ bool)

func (UInt32Value) SetOwner

func (UInt32Value) SetOwner(_ *common.Address)

func (UInt32Value) StaticType added in v0.12.0

func (UInt32Value) StaticType() StaticType

func (UInt32Value) String

func (v UInt32Value) String() string

func (UInt32Value) ToBigEndianBytes added in v0.5.0

func (v UInt32Value) ToBigEndianBytes() []byte

func (UInt32Value) ToInt

func (v UInt32Value) ToInt() int

func (UInt32Value) Walk added in v0.19.0

func (UInt32Value) Walk(_ func(Value))

type UInt64Value

type UInt64Value uint64

func ConvertUInt64

func ConvertUInt64(value Value) UInt64Value

func (UInt64Value) Accept added in v0.12.0

func (v UInt64Value) Accept(interpreter *Interpreter, visitor Visitor)

func (UInt64Value) BitwiseAnd added in v0.2.0

func (v UInt64Value) BitwiseAnd(other IntegerValue) IntegerValue

func (UInt64Value) BitwiseLeftShift added in v0.2.0

func (v UInt64Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (UInt64Value) BitwiseOr added in v0.2.0

func (v UInt64Value) BitwiseOr(other IntegerValue) IntegerValue

func (UInt64Value) BitwiseRightShift added in v0.2.0

func (v UInt64Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (UInt64Value) BitwiseXor added in v0.2.0

func (v UInt64Value) BitwiseXor(other IntegerValue) IntegerValue

func (UInt64Value) ConformsToDynamicType added in v0.15.0

func (v UInt64Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (UInt64Value) Copy

func (v UInt64Value) Copy() Value

func (UInt64Value) Div

func (v UInt64Value) Div(other NumberValue) NumberValue

func (UInt64Value) DynamicType

func (UInt64Value) Equal

func (v UInt64Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (UInt64Value) GetMember added in v0.3.0

func (v UInt64Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (UInt64Value) GetOwner

func (UInt64Value) GetOwner() *common.Address

func (UInt64Value) Greater

func (v UInt64Value) Greater(other NumberValue) BoolValue

func (UInt64Value) GreaterEqual

func (v UInt64Value) GreaterEqual(other NumberValue) BoolValue

func (UInt64Value) IsModified added in v0.3.0

func (UInt64Value) IsModified() bool

func (UInt64Value) IsStorable added in v0.16.0

func (UInt64Value) IsStorable() bool

func (UInt64Value) IsValue

func (UInt64Value) IsValue()

func (UInt64Value) KeyString

func (v UInt64Value) KeyString() string

func (UInt64Value) Less

func (v UInt64Value) Less(other NumberValue) BoolValue

func (UInt64Value) LessEqual

func (v UInt64Value) LessEqual(other NumberValue) BoolValue

func (UInt64Value) Minus

func (v UInt64Value) Minus(other NumberValue) NumberValue

func (UInt64Value) Mod

func (v UInt64Value) Mod(other NumberValue) NumberValue

func (UInt64Value) Mul

func (v UInt64Value) Mul(other NumberValue) NumberValue

func (UInt64Value) Negate

func (v UInt64Value) Negate() NumberValue

func (UInt64Value) Plus

func (v UInt64Value) Plus(other NumberValue) NumberValue

func (UInt64Value) RecursiveString added in v0.17.0

func (v UInt64Value) RecursiveString(_ SeenReferences) string

func (UInt64Value) SaturatingDiv added in v0.15.0

func (v UInt64Value) SaturatingDiv(other NumberValue) NumberValue

func (UInt64Value) SaturatingMinus added in v0.15.0

func (v UInt64Value) SaturatingMinus(other NumberValue) NumberValue

func (UInt64Value) SaturatingMul added in v0.15.0

func (v UInt64Value) SaturatingMul(other NumberValue) NumberValue

func (UInt64Value) SaturatingPlus added in v0.15.0

func (v UInt64Value) SaturatingPlus(other NumberValue) NumberValue

func (UInt64Value) SetMember added in v0.3.0

func (UInt64Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (UInt64Value) SetModified added in v0.3.0

func (UInt64Value) SetModified(_ bool)

func (UInt64Value) SetOwner

func (UInt64Value) SetOwner(_ *common.Address)

func (UInt64Value) StaticType added in v0.12.0

func (UInt64Value) StaticType() StaticType

func (UInt64Value) String

func (v UInt64Value) String() string

func (UInt64Value) ToBigEndianBytes added in v0.5.0

func (v UInt64Value) ToBigEndianBytes() []byte

func (UInt64Value) ToInt

func (v UInt64Value) ToInt() int

func (UInt64Value) Walk added in v0.19.0

func (UInt64Value) Walk(_ func(Value))

type UInt8Value

type UInt8Value uint8

func ConvertUInt8

func ConvertUInt8(value Value) UInt8Value

func (UInt8Value) Accept added in v0.12.0

func (v UInt8Value) Accept(interpreter *Interpreter, visitor Visitor)

func (UInt8Value) BitwiseAnd added in v0.2.0

func (v UInt8Value) BitwiseAnd(other IntegerValue) IntegerValue

func (UInt8Value) BitwiseLeftShift added in v0.2.0

func (v UInt8Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (UInt8Value) BitwiseOr added in v0.2.0

func (v UInt8Value) BitwiseOr(other IntegerValue) IntegerValue

func (UInt8Value) BitwiseRightShift added in v0.2.0

func (v UInt8Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (UInt8Value) BitwiseXor added in v0.2.0

func (v UInt8Value) BitwiseXor(other IntegerValue) IntegerValue

func (UInt8Value) ConformsToDynamicType added in v0.15.0

func (v UInt8Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (UInt8Value) Copy

func (v UInt8Value) Copy() Value

func (UInt8Value) Div

func (v UInt8Value) Div(other NumberValue) NumberValue

func (UInt8Value) DynamicType

func (UInt8Value) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (UInt8Value) Equal

func (v UInt8Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (UInt8Value) GetMember added in v0.3.0

func (v UInt8Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (UInt8Value) GetOwner

func (UInt8Value) GetOwner() *common.Address

func (UInt8Value) Greater

func (v UInt8Value) Greater(other NumberValue) BoolValue

func (UInt8Value) GreaterEqual

func (v UInt8Value) GreaterEqual(other NumberValue) BoolValue

func (UInt8Value) IsModified added in v0.3.0

func (UInt8Value) IsModified() bool

func (UInt8Value) IsStorable added in v0.16.0

func (UInt8Value) IsStorable() bool

func (UInt8Value) IsValue

func (UInt8Value) IsValue()

func (UInt8Value) KeyString

func (v UInt8Value) KeyString() string

func (UInt8Value) Less

func (v UInt8Value) Less(other NumberValue) BoolValue

func (UInt8Value) LessEqual

func (v UInt8Value) LessEqual(other NumberValue) BoolValue

func (UInt8Value) Minus

func (v UInt8Value) Minus(other NumberValue) NumberValue

func (UInt8Value) Mod

func (v UInt8Value) Mod(other NumberValue) NumberValue

func (UInt8Value) Mul

func (v UInt8Value) Mul(other NumberValue) NumberValue

func (UInt8Value) Negate

func (v UInt8Value) Negate() NumberValue

func (UInt8Value) Plus

func (v UInt8Value) Plus(other NumberValue) NumberValue

func (UInt8Value) RecursiveString added in v0.17.0

func (v UInt8Value) RecursiveString(_ SeenReferences) string

func (UInt8Value) SaturatingDiv added in v0.15.0

func (v UInt8Value) SaturatingDiv(other NumberValue) NumberValue

func (UInt8Value) SaturatingMinus added in v0.15.0

func (v UInt8Value) SaturatingMinus(other NumberValue) NumberValue

func (UInt8Value) SaturatingMul added in v0.15.0

func (v UInt8Value) SaturatingMul(other NumberValue) NumberValue

func (UInt8Value) SaturatingPlus added in v0.15.0

func (v UInt8Value) SaturatingPlus(other NumberValue) NumberValue

func (UInt8Value) SetMember added in v0.3.0

func (UInt8Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (UInt8Value) SetModified added in v0.3.0

func (UInt8Value) SetModified(_ bool)

func (UInt8Value) SetOwner

func (UInt8Value) SetOwner(_ *common.Address)

func (UInt8Value) StaticType added in v0.12.0

func (UInt8Value) StaticType() StaticType

func (UInt8Value) String

func (v UInt8Value) String() string

func (UInt8Value) ToBigEndianBytes added in v0.5.0

func (v UInt8Value) ToBigEndianBytes() []byte

func (UInt8Value) ToInt

func (v UInt8Value) ToInt() int

func (UInt8Value) Walk added in v0.19.0

func (UInt8Value) Walk(_ func(Value))

type UIntValue

type UIntValue struct {
	BigInt *big.Int
}

func ConvertUInt

func ConvertUInt(value Value) UIntValue

func NewUIntValueFromBigInt

func NewUIntValueFromBigInt(value *big.Int) UIntValue

func NewUIntValueFromUint64

func NewUIntValueFromUint64(value uint64) UIntValue

func (UIntValue) Accept added in v0.12.0

func (v UIntValue) Accept(interpreter *Interpreter, visitor Visitor)

func (UIntValue) BitwiseAnd added in v0.2.0

func (v UIntValue) BitwiseAnd(other IntegerValue) IntegerValue

func (UIntValue) BitwiseLeftShift added in v0.2.0

func (v UIntValue) BitwiseLeftShift(other IntegerValue) IntegerValue

func (UIntValue) BitwiseOr added in v0.2.0

func (v UIntValue) BitwiseOr(other IntegerValue) IntegerValue

func (UIntValue) BitwiseRightShift added in v0.2.0

func (v UIntValue) BitwiseRightShift(other IntegerValue) IntegerValue

func (UIntValue) BitwiseXor added in v0.2.0

func (v UIntValue) BitwiseXor(other IntegerValue) IntegerValue

func (UIntValue) ConformsToDynamicType added in v0.15.0

func (v UIntValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (UIntValue) Copy

func (v UIntValue) Copy() Value

func (UIntValue) Div

func (v UIntValue) Div(other NumberValue) NumberValue

func (UIntValue) DynamicType

func (UIntValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (UIntValue) Equal

func (v UIntValue) Equal(other Value, _ *Interpreter, _ bool) bool

func (UIntValue) GetMember added in v0.3.0

func (v UIntValue) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (UIntValue) GetOwner

func (UIntValue) GetOwner() *common.Address

func (UIntValue) Greater

func (v UIntValue) Greater(other NumberValue) BoolValue

func (UIntValue) GreaterEqual

func (v UIntValue) GreaterEqual(other NumberValue) BoolValue

func (UIntValue) IsModified added in v0.3.0

func (UIntValue) IsModified() bool

func (UIntValue) IsStorable added in v0.16.0

func (UIntValue) IsStorable() bool

func (UIntValue) IsValue

func (v UIntValue) IsValue()

func (UIntValue) KeyString

func (v UIntValue) KeyString() string

func (UIntValue) Less

func (v UIntValue) Less(other NumberValue) BoolValue

func (UIntValue) LessEqual

func (v UIntValue) LessEqual(other NumberValue) BoolValue

func (UIntValue) Minus

func (v UIntValue) Minus(other NumberValue) NumberValue

func (UIntValue) Mod

func (v UIntValue) Mod(other NumberValue) NumberValue

func (UIntValue) Mul

func (v UIntValue) Mul(other NumberValue) NumberValue

func (UIntValue) Negate

func (v UIntValue) Negate() NumberValue

func (UIntValue) Plus

func (v UIntValue) Plus(other NumberValue) NumberValue

func (UIntValue) RecursiveString added in v0.17.0

func (v UIntValue) RecursiveString(_ SeenReferences) string

func (UIntValue) SaturatingDiv added in v0.15.0

func (v UIntValue) SaturatingDiv(other NumberValue) NumberValue

func (UIntValue) SaturatingMinus added in v0.15.0

func (v UIntValue) SaturatingMinus(other NumberValue) NumberValue

func (UIntValue) SaturatingMul added in v0.15.0

func (v UIntValue) SaturatingMul(other NumberValue) NumberValue

func (UIntValue) SaturatingPlus added in v0.15.0

func (v UIntValue) SaturatingPlus(other NumberValue) NumberValue

func (UIntValue) SetMember added in v0.3.0

func (UIntValue) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (UIntValue) SetModified added in v0.3.0

func (UIntValue) SetModified(_ bool)

func (UIntValue) SetOwner

func (UIntValue) SetOwner(_ *common.Address)

func (UIntValue) StaticType added in v0.12.0

func (UIntValue) StaticType() StaticType

func (UIntValue) String

func (v UIntValue) String() string

func (UIntValue) ToBigEndianBytes added in v0.5.0

func (v UIntValue) ToBigEndianBytes() []byte

func (UIntValue) ToBigInt

func (v UIntValue) ToBigInt() *big.Int

func (UIntValue) ToInt

func (v UIntValue) ToInt() int

func (UIntValue) Walk added in v0.19.0

func (UIntValue) Walk(_ func(Value))

type UUIDHandlerFunc

type UUIDHandlerFunc func() (uint64, error)

UUIDHandlerFunc is a function that handles the generation of UUIDs.

type UUIDUnavailableError added in v0.10.4

type UUIDUnavailableError struct {
	LocationRange
}

UUIDUnavailableError

func (UUIDUnavailableError) Error added in v0.10.4

func (e UUIDUnavailableError) Error() string

type UnderflowError

type UnderflowError struct{}

func (UnderflowError) Error

func (e UnderflowError) Error() string

type UnsupportedTagDecodingError added in v0.19.0

type UnsupportedTagDecodingError struct {
	Path []string
	Tag  uint64
}

func (UnsupportedTagDecodingError) Error added in v0.19.0

type Value

type Value interface {
	// Stringer provides `func String() string`
	// NOTE: important, error messages rely on values to implement String
	fmt.Stringer
	IsValue()
	Accept(interpreter *Interpreter, visitor Visitor)
	Walk(walkChild func(Value))
	DynamicType(interpreter *Interpreter, seenReferences SeenReferences) DynamicType
	Copy() Value
	GetOwner() *common.Address
	SetOwner(address *common.Address)
	IsModified() bool
	SetModified(modified bool)
	StaticType() StaticType
	ConformsToDynamicType(interpreter *Interpreter, dynamicType DynamicType, results TypeConformanceResults) bool
	RecursiveString(seenReferences SeenReferences) string
	IsStorable() bool
}

func DecodeValue added in v0.2.0

func DecodeValue(
	data []byte,
	owner *common.Address,
	path []string,
	version uint16,
	decodeCallback DecodingCallback,
) (
	Value,
	error,
)

DecodeValue returns a value decoded from its CBOR-encoded representation, for the given owner (can be `nil`). It can decode storage format version 4 and later.

The given path is used to identify values in the object graph. For example, path elements are appended for array elements (the index), dictionary values (the key), and composites (the field name).

func DecodeValueV4 added in v0.19.0

func DecodeValueV4(
	data []byte,
	owner *common.Address,
	path []string,
	version uint16,
	decodeCallback DecodingCallback,
) (
	Value,
	error,
)

DecodeValue returns a value decoded from its CBOR-encoded representation, for the given owner (can be `nil`). It can decode storage format version 4 and later.

The given path is used to identify values in the object graph. For example, path elements are appended for array elements (the index), dictionary values (the key), and composites (the field name).

func NewIntValue added in v0.16.0

func NewIntValue(value *big.Int, intSubType sema.Type) Value

NewIntValue creates a Cadence interpreter value of a given subtype. This method assumes the range validations are done prior to calling this method. (i.e: at semantic level)

type ValueDeclaration added in v0.12.0

type ValueDeclaration interface {
	ValueDeclarationName() string
	ValueDeclarationValue() Value
	ValueDeclarationAvailable(common.Location) bool
}

type ValueIndexableValue

type ValueIndexableValue interface {
	Value
	Get(interpreter *Interpreter, getLocationRange func() LocationRange, key Value) Value
	Set(interpreter *Interpreter, getLocationRange func() LocationRange, key Value, value Value)
}

type ValueTransferTypeError added in v0.15.0

type ValueTransferTypeError struct {
	TargetType sema.Type
	LocationRange
}

ValueTransferTypeError

func (ValueTransferTypeError) Error added in v0.15.0

func (e ValueTransferTypeError) Error() string

type ValueWalker added in v0.19.0

type ValueWalker interface {
	WalkValue(value Value) ValueWalker
}

type Variable

type Variable struct {
	// contains filtered or unexported fields
}

func NewVariableWithGetter added in v0.13.9

func NewVariableWithGetter(getter func() Value) *Variable

func NewVariableWithValue added in v0.13.9

func NewVariableWithValue(value Value) *Variable

func (*Variable) GetValue added in v0.13.9

func (v *Variable) GetValue() Value

func (*Variable) SetValue added in v0.13.9

func (v *Variable) SetValue(value Value)

type VariableActivation added in v0.14.0

type VariableActivation struct {
	Depth  int
	Parent *VariableActivation
	// contains filtered or unexported fields
}

A VariableActivation is a map of strings to values. It can be used to represent an active scope in a program, i.e. it can be used as a symbol table during semantic analysis, or as an activation record during interpretation or compilation.

func NewVariableActivation added in v0.14.0

func NewVariableActivation(parent *VariableActivation) *VariableActivation

func (*VariableActivation) Find added in v0.14.0

func (a *VariableActivation) Find(name string) *Variable

Find returns the value for a given name in the activation. It returns nil if no value is found.

func (*VariableActivation) Set added in v0.14.0

func (a *VariableActivation) Set(name string, value *Variable)

Set sets the given name-value pair in the activation.

type VariableActivations added in v0.14.0

type VariableActivations struct {
	// contains filtered or unexported fields
}

Activations is a stack of activation records. Each entry represents a new activation record.

The current / most nested activation record can be found at the top of the stack (see function `Current`).

func (*VariableActivations) Current added in v0.14.0

Current returns the current / most nested activation, which can be found at the top of the stack. It returns nil if there is no active activation.

func (*VariableActivations) CurrentOrNew added in v0.14.0

func (a *VariableActivations) CurrentOrNew() *VariableActivation

CurrentOrNew returns the current activation, or if it does not exists, a new activation

func (*VariableActivations) Depth added in v0.14.0

func (a *VariableActivations) Depth() int

Depth returns the depth (size) of the activation stack.

func (*VariableActivations) Find added in v0.14.0

func (a *VariableActivations) Find(name string) *Variable

Find returns the value for a given key in the current activation. It returns nil if no value is found or if there is no current activation.

func (*VariableActivations) Pop added in v0.14.0

func (a *VariableActivations) Pop()

Pop pops the top-most (current) activation from the top of the activation stack.

func (*VariableActivations) Push added in v0.14.0

func (a *VariableActivations) Push(activation *VariableActivation)

Push pushes the given activation onto the top of the activation stack.

func (*VariableActivations) PushNewWithCurrent added in v0.14.0

func (a *VariableActivations) PushNewWithCurrent()

PushNewWithCurrent pushes a new empty activation to the top of the activation stack. The new activation has the current activation as its parent.

func (*VariableActivations) PushNewWithParent added in v0.14.0

func (a *VariableActivations) PushNewWithParent(parent *VariableActivation) *VariableActivation

PushNewWithParent pushes a new empty activation to the top of the activation stack. The new activation has the given parent as its parent.

func (*VariableActivations) Set added in v0.14.0

func (a *VariableActivations) Set(name string, value *Variable)

Set sets the name-value pair in the current scope.

type VariableSizedStaticType

type VariableSizedStaticType struct {
	Type StaticType
}

func (VariableSizedStaticType) ElementType added in v0.19.0

func (t VariableSizedStaticType) ElementType() StaticType

func (VariableSizedStaticType) Equal added in v0.15.0

func (t VariableSizedStaticType) Equal(other StaticType) bool

func (VariableSizedStaticType) String

func (t VariableSizedStaticType) String() string

type VirtualImport added in v0.5.0

type VirtualImport struct {
	Globals []struct {
		Name  string
		Value Value
	}
	TypeCodes   TypeCodes
	Elaboration *sema.Elaboration
}

type Visitor added in v0.12.0

type Visitor interface {
	VisitValue(interpreter *Interpreter, value Value)
	VisitTypeValue(interpreter *Interpreter, value TypeValue)
	VisitVoidValue(interpreter *Interpreter, value VoidValue)
	VisitBoolValue(interpreter *Interpreter, value BoolValue)
	VisitStringValue(interpreter *Interpreter, value *StringValue)
	VisitArrayValue(interpreter *Interpreter, value *ArrayValue) bool
	VisitIntValue(interpreter *Interpreter, value IntValue)
	VisitInt8Value(interpreter *Interpreter, value Int8Value)
	VisitInt16Value(interpreter *Interpreter, value Int16Value)
	VisitInt32Value(interpreter *Interpreter, value Int32Value)
	VisitInt64Value(interpreter *Interpreter, value Int64Value)
	VisitInt128Value(interpreter *Interpreter, value Int128Value)
	VisitInt256Value(interpreter *Interpreter, value Int256Value)
	VisitUIntValue(interpreter *Interpreter, value UIntValue)
	VisitUInt8Value(interpreter *Interpreter, value UInt8Value)
	VisitUInt16Value(interpreter *Interpreter, value UInt16Value)
	VisitUInt32Value(interpreter *Interpreter, value UInt32Value)
	VisitUInt64Value(interpreter *Interpreter, value UInt64Value)
	VisitUInt128Value(interpreter *Interpreter, value UInt128Value)
	VisitUInt256Value(interpreter *Interpreter, value UInt256Value)
	VisitWord8Value(interpreter *Interpreter, value Word8Value)
	VisitWord16Value(interpreter *Interpreter, value Word16Value)
	VisitWord32Value(interpreter *Interpreter, value Word32Value)
	VisitWord64Value(interpreter *Interpreter, value Word64Value)
	VisitFix64Value(interpreter *Interpreter, value Fix64Value)
	VisitUFix64Value(interpreter *Interpreter, value UFix64Value)
	VisitCompositeValue(interpreter *Interpreter, value *CompositeValue) bool
	VisitDictionaryValue(interpreter *Interpreter, value *DictionaryValue) bool
	VisitNilValue(interpreter *Interpreter, value NilValue)
	VisitSomeValue(interpreter *Interpreter, value *SomeValue) bool
	VisitStorageReferenceValue(interpreter *Interpreter, value *StorageReferenceValue)
	VisitEphemeralReferenceValue(interpreter *Interpreter, value *EphemeralReferenceValue)
	VisitAddressValue(interpreter *Interpreter, value AddressValue)
	VisitPathValue(interpreter *Interpreter, value PathValue)
	VisitCapabilityValue(interpreter *Interpreter, value CapabilityValue)
	VisitLinkValue(interpreter *Interpreter, value LinkValue)
	VisitInterpretedFunctionValue(interpreter *Interpreter, value *InterpretedFunctionValue)
	VisitHostFunctionValue(interpreter *Interpreter, value *HostFunctionValue)
	VisitBoundFunctionValue(interpreter *Interpreter, value BoundFunctionValue)
	VisitDeployedContractValue(interpreter *Interpreter, value DeployedContractValue)
}

type VoidDynamicType

type VoidDynamicType struct{}

func (VoidDynamicType) IsDynamicType

func (VoidDynamicType) IsDynamicType()

func (VoidDynamicType) IsImportable added in v0.18.0

func (VoidDynamicType) IsImportable() bool

type VoidValue

type VoidValue struct{}

func (VoidValue) Accept added in v0.12.0

func (v VoidValue) Accept(interpreter *Interpreter, visitor Visitor)

func (VoidValue) ConformsToDynamicType added in v0.15.0

func (v VoidValue) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (VoidValue) Copy

func (v VoidValue) Copy() Value

func (VoidValue) DynamicType

func (VoidValue) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (VoidValue) GetOwner

func (VoidValue) GetOwner() *common.Address

func (VoidValue) IsModified added in v0.3.0

func (VoidValue) IsModified() bool

func (VoidValue) IsStorable added in v0.16.0

func (VoidValue) IsStorable() bool

func (VoidValue) IsValue

func (VoidValue) IsValue()

func (VoidValue) RecursiveString added in v0.17.0

func (v VoidValue) RecursiveString(_ SeenReferences) string

func (VoidValue) SetModified added in v0.3.0

func (VoidValue) SetModified(_ bool)

func (VoidValue) SetOwner

func (VoidValue) SetOwner(_ *common.Address)

func (VoidValue) StaticType added in v0.12.0

func (VoidValue) StaticType() StaticType

func (VoidValue) String

func (VoidValue) String() string

func (VoidValue) Walk added in v0.19.0

func (VoidValue) Walk(_ func(Value))

type Word16Value

type Word16Value uint16

func ConvertWord16

func ConvertWord16(value Value) Word16Value

func (Word16Value) Accept added in v0.12.0

func (v Word16Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Word16Value) BitwiseAnd added in v0.2.0

func (v Word16Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Word16Value) BitwiseLeftShift added in v0.2.0

func (v Word16Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Word16Value) BitwiseOr added in v0.2.0

func (v Word16Value) BitwiseOr(other IntegerValue) IntegerValue

func (Word16Value) BitwiseRightShift added in v0.2.0

func (v Word16Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Word16Value) BitwiseXor added in v0.2.0

func (v Word16Value) BitwiseXor(other IntegerValue) IntegerValue

func (Word16Value) ConformsToDynamicType added in v0.15.0

func (v Word16Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Word16Value) Copy

func (v Word16Value) Copy() Value

func (Word16Value) Div

func (v Word16Value) Div(other NumberValue) NumberValue

func (Word16Value) DynamicType

func (Word16Value) Equal

func (v Word16Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Word16Value) GetMember added in v0.3.0

func (v Word16Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Word16Value) GetOwner

func (Word16Value) GetOwner() *common.Address

func (Word16Value) Greater

func (v Word16Value) Greater(other NumberValue) BoolValue

func (Word16Value) GreaterEqual

func (v Word16Value) GreaterEqual(other NumberValue) BoolValue

func (Word16Value) IsModified added in v0.3.0

func (Word16Value) IsModified() bool

func (Word16Value) IsStorable added in v0.16.0

func (Word16Value) IsStorable() bool

func (Word16Value) IsValue

func (Word16Value) IsValue()

func (Word16Value) KeyString

func (v Word16Value) KeyString() string

func (Word16Value) Less

func (v Word16Value) Less(other NumberValue) BoolValue

func (Word16Value) LessEqual

func (v Word16Value) LessEqual(other NumberValue) BoolValue

func (Word16Value) Minus

func (v Word16Value) Minus(other NumberValue) NumberValue

func (Word16Value) Mod

func (v Word16Value) Mod(other NumberValue) NumberValue

func (Word16Value) Mul

func (v Word16Value) Mul(other NumberValue) NumberValue

func (Word16Value) Negate

func (v Word16Value) Negate() NumberValue

func (Word16Value) Plus

func (v Word16Value) Plus(other NumberValue) NumberValue

func (Word16Value) RecursiveString added in v0.17.0

func (v Word16Value) RecursiveString(_ SeenReferences) string

func (Word16Value) SaturatingDiv added in v0.15.0

func (v Word16Value) SaturatingDiv(_ NumberValue) NumberValue

func (Word16Value) SaturatingMinus added in v0.15.0

func (v Word16Value) SaturatingMinus(_ NumberValue) NumberValue

func (Word16Value) SaturatingMul added in v0.15.0

func (v Word16Value) SaturatingMul(_ NumberValue) NumberValue

func (Word16Value) SaturatingPlus added in v0.15.0

func (v Word16Value) SaturatingPlus(_ NumberValue) NumberValue

func (Word16Value) SetMember added in v0.3.0

func (Word16Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Word16Value) SetModified added in v0.3.0

func (Word16Value) SetModified(_ bool)

func (Word16Value) SetOwner

func (Word16Value) SetOwner(_ *common.Address)

func (Word16Value) StaticType added in v0.12.0

func (Word16Value) StaticType() StaticType

func (Word16Value) String

func (v Word16Value) String() string

func (Word16Value) ToBigEndianBytes added in v0.5.0

func (v Word16Value) ToBigEndianBytes() []byte

func (Word16Value) ToInt

func (v Word16Value) ToInt() int

func (Word16Value) Walk added in v0.19.0

func (Word16Value) Walk(_ func(Value))

type Word32Value

type Word32Value uint32

func ConvertWord32

func ConvertWord32(value Value) Word32Value

func (Word32Value) Accept added in v0.12.0

func (v Word32Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Word32Value) BitwiseAnd added in v0.2.0

func (v Word32Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Word32Value) BitwiseLeftShift added in v0.2.0

func (v Word32Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Word32Value) BitwiseOr added in v0.2.0

func (v Word32Value) BitwiseOr(other IntegerValue) IntegerValue

func (Word32Value) BitwiseRightShift added in v0.2.0

func (v Word32Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Word32Value) BitwiseXor added in v0.2.0

func (v Word32Value) BitwiseXor(other IntegerValue) IntegerValue

func (Word32Value) ConformsToDynamicType added in v0.15.0

func (v Word32Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Word32Value) Copy

func (v Word32Value) Copy() Value

func (Word32Value) Div

func (v Word32Value) Div(other NumberValue) NumberValue

func (Word32Value) DynamicType

func (Word32Value) Equal

func (v Word32Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Word32Value) GetMember added in v0.3.0

func (v Word32Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Word32Value) GetOwner

func (Word32Value) GetOwner() *common.Address

func (Word32Value) Greater

func (v Word32Value) Greater(other NumberValue) BoolValue

func (Word32Value) GreaterEqual

func (v Word32Value) GreaterEqual(other NumberValue) BoolValue

func (Word32Value) IsModified added in v0.3.0

func (Word32Value) IsModified() bool

func (Word32Value) IsStorable added in v0.16.0

func (Word32Value) IsStorable() bool

func (Word32Value) IsValue

func (Word32Value) IsValue()

func (Word32Value) KeyString

func (v Word32Value) KeyString() string

func (Word32Value) Less

func (v Word32Value) Less(other NumberValue) BoolValue

func (Word32Value) LessEqual

func (v Word32Value) LessEqual(other NumberValue) BoolValue

func (Word32Value) Minus

func (v Word32Value) Minus(other NumberValue) NumberValue

func (Word32Value) Mod

func (v Word32Value) Mod(other NumberValue) NumberValue

func (Word32Value) Mul

func (v Word32Value) Mul(other NumberValue) NumberValue

func (Word32Value) Negate

func (v Word32Value) Negate() NumberValue

func (Word32Value) Plus

func (v Word32Value) Plus(other NumberValue) NumberValue

func (Word32Value) RecursiveString added in v0.17.0

func (v Word32Value) RecursiveString(_ SeenReferences) string

func (Word32Value) SaturatingDiv added in v0.15.0

func (v Word32Value) SaturatingDiv(_ NumberValue) NumberValue

func (Word32Value) SaturatingMinus added in v0.15.0

func (v Word32Value) SaturatingMinus(_ NumberValue) NumberValue

func (Word32Value) SaturatingMul added in v0.15.0

func (v Word32Value) SaturatingMul(_ NumberValue) NumberValue

func (Word32Value) SaturatingPlus added in v0.15.0

func (v Word32Value) SaturatingPlus(_ NumberValue) NumberValue

func (Word32Value) SetMember added in v0.3.0

func (Word32Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Word32Value) SetModified added in v0.3.0

func (Word32Value) SetModified(_ bool)

func (Word32Value) SetOwner

func (Word32Value) SetOwner(_ *common.Address)

func (Word32Value) StaticType added in v0.12.0

func (Word32Value) StaticType() StaticType

func (Word32Value) String

func (v Word32Value) String() string

func (Word32Value) ToBigEndianBytes added in v0.5.0

func (v Word32Value) ToBigEndianBytes() []byte

func (Word32Value) ToInt

func (v Word32Value) ToInt() int

func (Word32Value) Walk added in v0.19.0

func (Word32Value) Walk(_ func(Value))

type Word64Value

type Word64Value uint64

func ConvertWord64

func ConvertWord64(value Value) Word64Value

func (Word64Value) Accept added in v0.12.0

func (v Word64Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Word64Value) BitwiseAnd added in v0.2.0

func (v Word64Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Word64Value) BitwiseLeftShift added in v0.2.0

func (v Word64Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Word64Value) BitwiseOr added in v0.2.0

func (v Word64Value) BitwiseOr(other IntegerValue) IntegerValue

func (Word64Value) BitwiseRightShift added in v0.2.0

func (v Word64Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Word64Value) BitwiseXor added in v0.2.0

func (v Word64Value) BitwiseXor(other IntegerValue) IntegerValue

func (Word64Value) ConformsToDynamicType added in v0.15.0

func (v Word64Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Word64Value) Copy

func (v Word64Value) Copy() Value

func (Word64Value) Div

func (v Word64Value) Div(other NumberValue) NumberValue

func (Word64Value) DynamicType

func (Word64Value) Equal

func (v Word64Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Word64Value) GetMember added in v0.3.0

func (v Word64Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Word64Value) GetOwner

func (Word64Value) GetOwner() *common.Address

func (Word64Value) Greater

func (v Word64Value) Greater(other NumberValue) BoolValue

func (Word64Value) GreaterEqual

func (v Word64Value) GreaterEqual(other NumberValue) BoolValue

func (Word64Value) IsModified added in v0.3.0

func (Word64Value) IsModified() bool

func (Word64Value) IsStorable added in v0.16.0

func (Word64Value) IsStorable() bool

func (Word64Value) IsValue

func (Word64Value) IsValue()

func (Word64Value) KeyString

func (v Word64Value) KeyString() string

func (Word64Value) Less

func (v Word64Value) Less(other NumberValue) BoolValue

func (Word64Value) LessEqual

func (v Word64Value) LessEqual(other NumberValue) BoolValue

func (Word64Value) Minus

func (v Word64Value) Minus(other NumberValue) NumberValue

func (Word64Value) Mod

func (v Word64Value) Mod(other NumberValue) NumberValue

func (Word64Value) Mul

func (v Word64Value) Mul(other NumberValue) NumberValue

func (Word64Value) Negate

func (v Word64Value) Negate() NumberValue

func (Word64Value) Plus

func (v Word64Value) Plus(other NumberValue) NumberValue

func (Word64Value) RecursiveString added in v0.17.0

func (v Word64Value) RecursiveString(_ SeenReferences) string

func (Word64Value) SaturatingDiv added in v0.15.0

func (v Word64Value) SaturatingDiv(_ NumberValue) NumberValue

func (Word64Value) SaturatingMinus added in v0.15.0

func (v Word64Value) SaturatingMinus(_ NumberValue) NumberValue

func (Word64Value) SaturatingMul added in v0.15.0

func (v Word64Value) SaturatingMul(_ NumberValue) NumberValue

func (Word64Value) SaturatingPlus added in v0.15.0

func (v Word64Value) SaturatingPlus(_ NumberValue) NumberValue

func (Word64Value) SetMember added in v0.3.0

func (Word64Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Word64Value) SetModified added in v0.3.0

func (Word64Value) SetModified(_ bool)

func (Word64Value) SetOwner

func (Word64Value) SetOwner(_ *common.Address)

func (Word64Value) StaticType added in v0.12.0

func (Word64Value) StaticType() StaticType

func (Word64Value) String

func (v Word64Value) String() string

func (Word64Value) ToBigEndianBytes added in v0.5.0

func (v Word64Value) ToBigEndianBytes() []byte

func (Word64Value) ToInt

func (v Word64Value) ToInt() int

func (Word64Value) Walk added in v0.19.0

func (Word64Value) Walk(_ func(Value))

type Word8Value

type Word8Value uint8

func ConvertWord8

func ConvertWord8(value Value) Word8Value

func (Word8Value) Accept added in v0.12.0

func (v Word8Value) Accept(interpreter *Interpreter, visitor Visitor)

func (Word8Value) BitwiseAnd added in v0.2.0

func (v Word8Value) BitwiseAnd(other IntegerValue) IntegerValue

func (Word8Value) BitwiseLeftShift added in v0.2.0

func (v Word8Value) BitwiseLeftShift(other IntegerValue) IntegerValue

func (Word8Value) BitwiseOr added in v0.2.0

func (v Word8Value) BitwiseOr(other IntegerValue) IntegerValue

func (Word8Value) BitwiseRightShift added in v0.2.0

func (v Word8Value) BitwiseRightShift(other IntegerValue) IntegerValue

func (Word8Value) BitwiseXor added in v0.2.0

func (v Word8Value) BitwiseXor(other IntegerValue) IntegerValue

func (Word8Value) ConformsToDynamicType added in v0.15.0

func (v Word8Value) ConformsToDynamicType(_ *Interpreter, dynamicType DynamicType, _ TypeConformanceResults) bool

func (Word8Value) Copy

func (v Word8Value) Copy() Value

func (Word8Value) Div

func (v Word8Value) Div(other NumberValue) NumberValue

func (Word8Value) DynamicType

func (Word8Value) DynamicType(_ *Interpreter, _ SeenReferences) DynamicType

func (Word8Value) Equal

func (v Word8Value) Equal(other Value, _ *Interpreter, _ bool) bool

func (Word8Value) GetMember added in v0.3.0

func (v Word8Value) GetMember(_ *Interpreter, _ func() LocationRange, name string) Value

func (Word8Value) GetOwner

func (Word8Value) GetOwner() *common.Address

func (Word8Value) Greater

func (v Word8Value) Greater(other NumberValue) BoolValue

func (Word8Value) GreaterEqual

func (v Word8Value) GreaterEqual(other NumberValue) BoolValue

func (Word8Value) IsModified added in v0.3.0

func (Word8Value) IsModified() bool

func (Word8Value) IsStorable added in v0.16.0

func (Word8Value) IsStorable() bool

func (Word8Value) IsValue

func (Word8Value) IsValue()

func (Word8Value) KeyString

func (v Word8Value) KeyString() string

func (Word8Value) Less

func (v Word8Value) Less(other NumberValue) BoolValue

func (Word8Value) LessEqual

func (v Word8Value) LessEqual(other NumberValue) BoolValue

func (Word8Value) Minus

func (v Word8Value) Minus(other NumberValue) NumberValue

func (Word8Value) Mod

func (v Word8Value) Mod(other NumberValue) NumberValue

func (Word8Value) Mul

func (v Word8Value) Mul(other NumberValue) NumberValue

func (Word8Value) Negate

func (v Word8Value) Negate() NumberValue

func (Word8Value) Plus

func (v Word8Value) Plus(other NumberValue) NumberValue

func (Word8Value) RecursiveString added in v0.17.0

func (v Word8Value) RecursiveString(_ SeenReferences) string

func (Word8Value) SaturatingDiv added in v0.15.0

func (v Word8Value) SaturatingDiv(_ NumberValue) NumberValue

func (Word8Value) SaturatingMinus added in v0.15.0

func (v Word8Value) SaturatingMinus(_ NumberValue) NumberValue

func (Word8Value) SaturatingMul added in v0.15.0

func (v Word8Value) SaturatingMul(_ NumberValue) NumberValue

func (Word8Value) SaturatingPlus added in v0.15.0

func (v Word8Value) SaturatingPlus(_ NumberValue) NumberValue

func (Word8Value) SetMember added in v0.3.0

func (Word8Value) SetMember(_ *Interpreter, _ func() LocationRange, _ string, _ Value)

func (Word8Value) SetModified added in v0.3.0

func (Word8Value) SetModified(_ bool)

func (Word8Value) SetOwner

func (Word8Value) SetOwner(_ *common.Address)

func (Word8Value) StaticType added in v0.12.0

func (Word8Value) StaticType() StaticType

func (Word8Value) String

func (v Word8Value) String() string

func (Word8Value) ToBigEndianBytes added in v0.5.0

func (v Word8Value) ToBigEndianBytes() []byte

func (Word8Value) ToInt

func (v Word8Value) ToInt() int

func (Word8Value) Walk added in v0.19.0

func (Word8Value) Walk(_ func(Value))

type WrapperCode added in v0.5.0

type WrapperCode struct {
	InitializerFunctionWrapper FunctionWrapper
	DestructorFunctionWrapper  FunctionWrapper
	FunctionWrappers           map[string]FunctionWrapper
}

WrapperCode contains the "prepared" / "callable" "code" for inherited types (interfaces and type requirements).

These are "branch" nodes in the call chain, and are function wrappers, i.e. they wrap the functions / function wrappers that inherit them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL