core

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package core defines the core interfaces required for smart contracts to interact with the VM system Contract developers only need to understand and use the interfaces in this file to write smart contracts

Index

Constants

This section is empty.

Variables

View Source
var ZeroAddress = Address{}
View Source
var ZeroHash = Hash{}
View Source
var ZeroObjectID = ObjectID{}

Functions

func Assert added in v0.1.1

func Assert(condition any)

func Balance added in v0.1.2

func Balance(addr Address) uint64

func BlockHeight added in v0.1.2

func BlockHeight() uint64

func BlockTime added in v0.1.2

func BlockTime() int64

func Call added in v0.1.2

func Call(contract Address, function string, args ...any) ([]byte, error)

Cross-contract calls

func DeleteObject added in v0.1.2

func DeleteObject(id ObjectID)

func Error added in v0.1.1

func Error(msg string) error

func Log added in v0.1.2

func Log(eventName string, keyValues ...interface{})

Logging and events

func SetContext added in v0.1.2

func SetContext(c types.Context)

Types

type Address

type Address = types.Address

func AddressFromString

func AddressFromString(str string) Address

func ContractAddress added in v0.1.2

func ContractAddress() Address

func Sender added in v0.1.2

func Sender() Address

type Hash

type Hash = types.Hash

func GetHash added in v0.1.1

func GetHash(data []byte) Hash

func HashFromString

func HashFromString(str string) Hash

type Object

type Object = types.Object

func CreateObject added in v0.1.2

func CreateObject() Object

Object storage related - Basic state operations use panic instead of returning error

func GetObject added in v0.1.2

func GetObject(id ObjectID) (Object, error)

func GetObjectWithOwner added in v0.1.2

func GetObjectWithOwner(owner Address) (Object, error)

type ObjectID

type ObjectID = types.ObjectID

func IDFromString

func IDFromString(str string) ObjectID

Jump to

Keyboard shortcuts

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