stdlib

package
v0.34.0-crescendo-prev... Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

View Source
const ContractName = "EVM"
View Source
const InternalEVMContractName = "InternalEVM"

Variables

View Source
var EVMTransactionBytesCadenceType = cadence.NewVariableSizedArrayType(cadence.UInt8Type)
View Source
var InternalEVMContractType = func() *sema.CompositeType {
	ty := &sema.CompositeType{
		Identifier: InternalEVMContractName,
		Kind:       common.CompositeKindContract,
	}

	ty.Members = sema.MembersAsMap([]*sema.Member{
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeRunFunctionName,
			internalEVMTypeRunFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeCreateCadenceOwnedAccountFunctionName,
			internalEVMTypeCreateCadenceOwnedAccountFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeCallFunctionName,
			internalEVMTypeCallFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeDepositFunctionName,
			internalEVMTypeDepositFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeWithdrawFunctionName,
			internalEVMTypeWithdrawFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeDeployFunctionName,
			internalEVMTypeDeployFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeCastToAttoFLOWFunctionName,
			internalEVMTypeCastToAttoFLOWFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeCastToFLOWFunctionName,
			internalEVMTypeCastToFLOWFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeBalanceFunctionName,
			internalEVMTypeBalanceFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeNonceFunctionName,
			internalEVMTypeNonceFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeCodeFunctionName,
			internalEVMTypeCodeFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeCodeHashFunctionName,
			internalEVMTypeCodeHashFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeEncodeABIFunctionName,
			internalEVMTypeEncodeABIFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeDecodeABIFunctionName,
			internalEVMTypeDecodeABIFunctionType,
			"",
		),
		sema.NewUnmeteredPublicFunctionMember(
			ty,
			internalEVMTypeGetLatestBlockFunctionName,
			internalEVMTypeGetLatestBlockFunctionType,
			"",
		),
	})
	return ty
}()

Functions

func AddressBytesArrayValueToEVMAddress

func AddressBytesArrayValueToEVMAddress(
	inter *interpreter.Interpreter,
	locationRange interpreter.LocationRange,
	addressBytesValue *interpreter.ArrayValue,
) (
	result types.Address,
	err error,
)

func ContractCode

func ContractCode(flowTokenAddress flow.Address) []byte

func EVMAddressToAddressBytesArrayValue

func EVMAddressToAddressBytesArrayValue(
	inter *interpreter.Interpreter,
	address types.Address,
) *interpreter.ArrayValue

func NewBalanceCadenceType

func NewBalanceCadenceType(address common.Address) *cadence.StructType

func NewEVMAddress

func NewEVMAddress(
	inter *interpreter.Interpreter,
	locationRange interpreter.LocationRange,
	location common.AddressLocation,
	address types.Address,
) *interpreter.CompositeValue

func NewEVMAddressCadenceType

func NewEVMAddressCadenceType(address common.Address) *cadence.StructType

func NewEVMBlockCadenceType added in v0.33.30

func NewEVMBlockCadenceType(address common.Address) *cadence.StructType

func NewEVMBlockValue added in v0.33.30

func NewEVMBlockValue(
	handler types.ContractHandler,
	gauge common.MemoryGauge,
	inter *interpreter.Interpreter,
	locationRange interpreter.LocationRange,
	block *types.Block,
) *interpreter.CompositeValue

func NewInternalEVMContractValue

func NewInternalEVMContractValue(
	gauge common.MemoryGauge,
	handler types.ContractHandler,
	location common.AddressLocation,
) *interpreter.SimpleCompositeValue

func NewResultValue added in v0.33.30

func NewResultValue(
	handler types.ContractHandler,
	gauge common.MemoryGauge,
	inter *interpreter.Interpreter,
	locationRange interpreter.LocationRange,
	result *types.ResultSummary,
) *interpreter.CompositeValue

func ResultSummaryFromEVMResultValue added in v0.33.30

func ResultSummaryFromEVMResultValue(val cadence.Value) (*types.ResultSummary, error)

func SetupEnvironment

func SetupEnvironment(env runtime.Environment, handler types.ContractHandler, service flow.Address)

Types

This section is empty.

Jump to

Keyboard shortcuts

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