sdk

package module
v0.0.0-...-e5e96f2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const AddressLen = 20

Variables

View Source
var NilAddress = Address([AddressLen]uint8{0})
View Source
var Zero = U256([4]uint64{0, 0, 0, 0})

Functions

func BlockGasLimit

func BlockGasLimit() uint64

func BlockNumber

func BlockNumber() uint64

func BlockTimestamp

func BlockTimestamp() uint64

func ChainID

func ChainID() uint64

func Create1

func Create1()

TODO

func Create2

func Create2()

func DecodeBool

func DecodeBool(data Bytes) (bool, error)

func DecodeUint64

func DecodeUint64(data Bytes) (uint64, error)

func Encode

func Encode(dst, src []byte) int

Encode encodes src into EncodedLen(len(src)) bytes of dst. As a convenience, it returns the number of bytes written to dst, but this value is always EncodedLen(len(src)). Encode implements hexadecimal encoding.

func EncodedLen

func EncodedLen(n int) int

EncodedLen returns the length of an encoding of n source bytes. Specifically, it returns n * 2.

func Flush

func Flush()

func GasLeft

func GasLeft() uint64

func Init

func Init(argLen uint32)

func InkLeft

func InkLeft() uint64

func InkPrice

func InkPrice() uint32

func Log

func Log(msg string)

func LogAddress

func LogAddress(addr Address, topics uint32)

func LogN

func LogN(msg string, topics uint32)

func LogRawN

func LogRawN(bytes Bytes, topics uint32)

func LogU256

func LogU256(v U256)

func LogUInt32

func LogUInt32(n uint32, topics uint32)

func LogUInt8

func LogUInt8(n uint8, topics uint32)

func ReturnDataSize

func ReturnDataSize() uint32

func Revert

func Revert(bytes Bytes)

func RevertWithString

func RevertWithString(msg string)

func SStore

func SStore(key, value U256)

func SetPure

func SetPure()

func SetReturnAddress

func SetReturnAddress(addr Address)

func SetReturnBytes

func SetReturnBytes(bytes Bytes)

func SetReturnString

func SetReturnString(msg string)

func SetReturnU256

func SetReturnU256(z U256)

func SetReturnUInt64

func SetReturnUInt64(val uint64)

func SetReturnUInt8

func SetReturnUInt8(val uint8)

func SetView

func SetView()

func ToSelector

func ToSelector(in []byte) uint32

func WithCalldata

func WithCalldata(calldata Bytes) func(*callOpt)

func WithGas

func WithGas(gas uint64) func(*callOpt)

func WithMaxGas

func WithMaxGas() func(*callOpt)

func WithValue

func WithValue(v U256) func(*callOpt)

Types

type Address

type Address [AddressLen]uint8

func AddressFromBytes

func AddressFromBytes(bytes Bytes) Address

func BlockCoinbase

func BlockCoinbase() Address

func ContractAddress

func ContractAddress() Address

func DecodeAddress

func DecodeAddress(data Bytes) (Address, error)

func MsgSender

func MsgSender() Address

func TxOrigin

func TxOrigin() Address

func (Address) Balance

func (a Address) Balance() Bytes

func (Address) Bytes

func (a Address) Bytes() Bytes

func (Address) Call

func (a Address) Call(opts ...func(*callOpt)) (Bytes, error)

func (Address) CodeHash

func (a Address) CodeHash() Bytes

func (Address) DelegateCall

func (a Address) DelegateCall(opts ...func(*callOpt)) (Bytes, error)

func (Address) Equals

func (a Address) Equals(b Address) bool

func (Address) StaticCall

func (a Address) StaticCall(opts ...func(*callOpt)) (Bytes, error)

func (Address) String

func (a Address) String() string

type Bytes

type Bytes []uint8

func BlockBaseFee

func BlockBaseFee() Bytes

func Concat

func Concat(items ...Bytes) Bytes

func GetCalldata

func GetCalldata() Bytes

func ReturnData

func ReturnData() Bytes

func (Bytes) String

func (b Bytes) String() string

type EvmError

type EvmError string

func NewEvmError

func NewEvmError(e string) EvmError

func (EvmError) Error

func (e EvmError) Error() string

type String

type String string

func (String) Bytes

func (s String) Bytes() Bytes

type U256

type U256 [4]uint64

func DecodeU256

func DecodeU256(data Bytes) (U256, error)

func FromBytes

func FromBytes(b Bytes) U256

func FromUInt64

func FromUInt64(v uint64) U256

func FromWord

func FromWord(w Word) U256

func GasPrice

func GasPrice() U256

func MsgValue

func MsgValue() U256

func NewU256

func NewU256() U256

func SLoad

func SLoad(key U256) U256

func (U256) Add

func (z U256) Add(x, y *U256) U256

func (U256) Bytes

func (z U256) Bytes() Bytes

func (U256) IsZero

func (z U256) IsZero() bool

func (U256) Word

func (z U256) Word() Word

type Word

type Word [32]uint8

func Keccak256

func Keccak256(data Bytes) Word

func ZeroWord

func ZeroWord() Word

Jump to

Keyboard shortcuts

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