vm

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 28 Imported by: 5

Documentation

Index

Constants

View Source
const (
	GasQuickStep   uint64 = 2
	GasFastestStep uint64 = 3
	GasFastStep    uint64 = 5
	GasMidStep     uint64 = 8
	GasSlowStep    uint64 = 10
	GasExtStep     uint64 = 20

	GasReturn       uint64 = 0
	GasStop         uint64 = 0
	GasContractByte uint64 = 200
)
View Source
const (
	GasLimitBoundDivisor uint64 = 1024    // The bound divisor of the gas limit, used in update calculations.
	MinGasLimit          uint64 = 5000    // Minimum the gas limit may ever be.
	GenesisGasLimit      uint64 = 4712388 // Gas limit of the Genesis block.

	MaximumExtraDataSize  uint64 = 32    // Maximum size extra data may be after Genesis.
	ExpByteGas            uint64 = 10    // Times ceil(log256(exponent)) for the EXP instruction.
	SloadGas              uint64 = 50    // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added.
	CallValueTransferGas  uint64 = 9000  // Paid for CALL when the value transfer is non-zero.
	CallNewAccountGas     uint64 = 25000 // Paid for CALL when the destination address didn't exist prior.
	TxGas                 uint64 = 21000 // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions.
	TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions.
	TxDataZeroGas         uint64 = 4     // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions.
	QuadCoeffDiv          uint64 = 512   // Divisor for the quadratic particle of the memory cost equation.
	SstoreSetGas          uint64 = 5000  // Once per SLOAD operation.
	LogDataGas            uint64 = 8     // Per byte in a LOG* operation's data.
	CallStipend           uint64 = 2300  // Free gas given at beginning of call.

	Sha3Gas          uint64 = 30    // Once per SHA3 operation.
	Sha3WordGas      uint64 = 6     // Once per word of the SHA3 operation's data.
	SstoreResetGas   uint64 = 5000  // Once per SSTORE operation if the zeroness changes from zero.
	SstoreClearGas   uint64 = 5000  // Once per SSTORE operation if the zeroness doesn't change.
	SstoreRefundGas  uint64 = 15000 // Once per SSTORE operation if the zeroness changes to zero.
	JumpdestGas      uint64 = 1     // Refunded gas, once per SSTORE operation if the zeroness changes to zero.
	EpochDuration    uint64 = 30000 // Duration between proof-of-work epochs.
	CallGas          uint64 = 40    // Once per CALL operation & message call transaction.
	CreateDataGas    uint64 = 200   //
	CallCreateDepth  uint64 = 1024  // Maximum depth of call/create stack.
	ExpGas           uint64 = 10    // Once per EXP instruction
	LogGas           uint64 = 375   // Per LOG* operation.
	CopyGas          uint64 = 3     //
	StackLimit       uint64 = 1024  // Maximum size of VM stack allowed.
	TierStepGas      uint64 = 0     // Once per operation, for a selection of them.
	LogTopicGas      uint64 = 375   // Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas.
	CreateGas        uint64 = 32000 // Once per CREATE operation & contract-creation transaction.
	SuicideRefundGas uint64 = 24000 // Refunded following a suicide operation.
	MemoryGas        uint64 = 3     // Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL.
	TxDataNonZeroGas uint64 = 68    // Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions.

	MaxCodeSize = 1024 * 1024 // Maximum bytecode to permit for a wasm contract 1M

	PrintWordGas uint64 = 1
	MemWordGas   uint64 = 1
	IssueGas     uint64 = 4000
	HashSetGas   uint64 = 96
	AddrSetGas   uint64 = 60
	JsonGas      uint64 = 500

	EcrecoverGas            uint64 = 3000   // Elliptic curve sender recovery gas price
	Sha256BaseGas           uint64 = 60     // Base price for a SHA256 operation
	Sha256PerWordGas        uint64 = 12     // Per-word price for a SHA256 operation
	Ripemd160BaseGas        uint64 = 600    // Base price for a RIPEMD160 operation
	Ripemd160PerWordGas     uint64 = 120    // Per-word price for a RIPEMD160 operation
	IdentityBaseGas         uint64 = 15     // Base price for a data copy operation
	IdentityPerWordGas      uint64 = 3      // Per-work price for a data copy operation
	ModExpQuadCoeffDiv      uint64 = 20     // Divisor for the quadratic particle of the big int modular exponentiation
	Bn256AddGas             uint64 = 500    // Gas needed for an elliptic curve addition
	Bn256ScalarMulGas       uint64 = 40000  // Gas needed for an elliptic curve scalar multiplication
	Bn256PairingBaseGas     uint64 = 100000 // Base price for an elliptic curve pairing check
	Bn256PairingPerPointGas uint64 = 80000  // Per-point price for an elliptic curve pairing check
)
View Source
const (
	/*
		 For c/c++:
			 char * thunderchain_main(char *action, char *arg);

	*/
	APPEntry = "thunderchain_main"
)
View Source
const TCVM_AOTS_ENABLE = "TCVM_AOTS_ENABLE"

Env Variable

View Source
const TCVM_AOTS_KEEP_CSOURCE = "TCVM_AOTS_KEEP_CSOURCE"
View Source
const TCVM_AOTS_ROOT = "TCVM_AOTS_ROOT"

Variables

View Source
var (
	ErrNoAppEntry = fmt.Errorf("no AppEntry(%s)", APPEntry)
	ErrAppInput   = fmt.Errorf("invalid app input")
	WasmBytes     = []byte{0x00, 0x61, 0x73, 0x6d}
)
View Source
var (
	ErrOverFrame  = errors.New("engine: recursive overflow")
	ErrEmptyFrame = errors.New("engine: empty frame")
	ErrInitEngine = errors.New("engine: init failed")

	ErrMemoryGet          = errors.New("memory get* failed")
	ErrMemorySet          = errors.New("memory set* failed")
	ErrGasOverflow        = errors.New("gas overflow (uint64)")
	ErrContractAbort      = errors.New("contract abort")
	ErrInvalidApiArgs     = errors.New("invalid api args")
	ErrBalanceNotEnough   = errors.New("insufficient balance in api")
	ErrContractNotPayable = errors.New("contract not payable")
	ErrInvalidEnvArgs     = errors.New("invalid env args")
	ErrMallocMemory       = errors.New("malloc() failed in api")

	ErrCallDepth                = errors.New("vm: max call depth exceeded")
	ErrContractNoCode           = errors.New("vm: contract no code")
	ErrCodeStoreOutOfGas        = errors.New("vm: contract creation code storage out of gas")
	ErrExecutionReverted        = errors.New("vm: execution reverted")
	ErrMaxCodeSizeExceeded      = errors.New("vm: max code size exceeded")
	ErrInsufficientBalance      = errors.New("vm: insufficient balance in transfer")
	ErrContractAddressCollision = errors.New("vm: contract address collision")
	ErrReturnDataOutOfBounds    = errors.New("vm: return data out of bounds")
	ErrTraceLimitReached        = errors.New("vm: the number of logs reached the specified limit")
	ErrWriteProtection          = errors.New("vm: write protection")
	ErrContractRequire          = errors.New("vm: contract require fail")
	ErrContractAssert           = errors.New("vm: contract assert fail")
	ErrOutOfGas                 = errors.New("vm: out of gas")
	ErrExecutionExit            = errors.New("vm: execution exit")
)
View Source
var (
	DifficultyBoundDivisor = big.NewInt(2048)       // The bound divisor of the difficulty, used in the update calculations.
	GenesisDifficulty      = big.NewInt(131072)     // Difficulty of the Genesis block.
	MinimumDifficulty      = big.NewInt(131072)     // The minimum that the difficulty may ever be.
	DurationLimit          = big.NewInt(13)         // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.
	TsVersion1Sec          = big.NewInt(1541289540) //2018-11-03 23:59:00 UTC
	TsVersion2Sec          = big.NewInt(1543536000) //2018-11-30 00:00:00 UTC
	SignParam              = big.NewInt(30261)

	TargetGasLimit = GenesisGasLimit // The artificial target
)
View Source
var (
	AppCache *sync.Map
)
View Source
var GasTableEIP158 = GasTable{
	ExtcodeSize: 700,
	ExtcodeCopy: 700,
	ExpByte:     50,
	Balance:     400,
	SLoad:       200,
	Calls:       700,
	Suicide:     5000,

	CreateBySuicide: 25000,
}
View Source
var THUNDERCHAINID = SignParam.Int64()

const THUNDERCHAINID = 30261

Functions

func DeleteNative added in v0.3.6

func DeleteNative(app *APP)

DeleteNative --

func GasBlockHash

func GasBlockHash(eng *Engine, index int64, args []uint64) (uint64, error)

func GasCheckSign

func GasCheckSign(eng *Engine, index int64, args []uint64) (uint64, error)

func GasContractStorageGet

func GasContractStorageGet(eng *Engine, index int64, args []uint64) (uint64, error)

func GasContractStoragePureGet added in v0.2.1

func GasContractStoragePureGet(eng *Engine, index int64, args []uint64) (uint64, error)

func GasEcrecover

func GasEcrecover(eng *Engine, index int64, args []uint64) (uint64, error)

func GasGetBalance

func GasGetBalance(eng *Engine, index int64, args []uint64) (uint64, error)

func GasGetCoinbase

func GasGetCoinbase(eng *Engine, index int64, args []uint64) (uint64, error)

func GasGetGasLimit

func GasGetGasLimit(eng *Engine, index int64, args []uint64) (uint64, error)

func GasGetNumber

func GasGetNumber(eng *Engine, index int64, args []uint64) (uint64, error)

func GasGetTimestamp

func GasGetTimestamp(eng *Engine, index int64, args []uint64) (uint64, error)

func GasGetTxGasPrice

func GasGetTxGasPrice(eng *Engine, index int64, args []uint64) (uint64, error)

func GasGetTxOrigin

func GasGetTxOrigin(eng *Engine, index int64, args []uint64) (uint64, error)

func GasIssue

func GasIssue(eng *Engine, index int64, args []uint64) (uint64, error)

func GasNotify

func GasNotify(eng *Engine, index int64, args []uint64) (uint64, error)

func GasNow

func GasNow(eng *Engine, index int64, args []uint64) (uint64, error)

func GasSelfDestruct

func GasSelfDestruct(eng *Engine, index int64, args []uint64) (uint64, error)

func GasStorageDel

func GasStorageDel(eng *Engine, index int64, args []uint64) (uint64, error)

func GasStorageGet

func GasStorageGet(eng *Engine, index int64, args []uint64) (uint64, error)

func GasStoragePureGet

func GasStoragePureGet(eng *Engine, index int64, args []uint64) (uint64, error)

func GasStoragePureSetBytes

func GasStoragePureSetBytes(eng *Engine, index int64, args []uint64) (uint64, error)

func GasStoragePureSetString

func GasStoragePureSetString(eng *Engine, index int64, args []uint64) (uint64, error)

func GasStorageSet

func GasStorageSet(eng *Engine, index int64, args []uint64) (uint64, error)

func GasStorageSetBytes

func GasStorageSetBytes(eng *Engine, index int64, args []uint64) (uint64, error)

func GasTokenAddress

func GasTokenAddress(eng *Engine, index int64, args []uint64) (uint64, error)

func GasTokenBalance

func GasTokenBalance(eng *Engine, index int64, args []uint64) (uint64, error)

func GasTransfer

func GasTransfer(eng *Engine, index int64, args []uint64) (uint64, error)

func GasTransferToken

func GasTransferToken(eng *Engine, index int64, args []uint64) (uint64, error)

func GoExit added in v0.3.6

func GoExit(cvm *C.vm_t, cstatus C.int32_t)

GoExit --

func GoFunc added in v0.3.6

func GoFunc(cvm *C.vm_t, cname *C.char, cArgn C.int32_t, cArgs *C.uint64_t) uint64

GoFunc --

func GoGrowMemory added in v0.3.6

func GoGrowMemory(cvm *C.vm_t, pages C.int32_t)

GoGrowMemory --

func GoPanic added in v0.3.6

func GoPanic(cvm *C.vm_t, cmsg *C.char)

GoPanic --

func GoRevert added in v0.3.6

func GoRevert(cvm *C.vm_t, cmsg *C.char)

GoRevert --

func IsWasmContract

func IsWasmContract(code []byte) bool

IsWasmContract check contract's id

func MakeGasLog

func MakeGasLog(n uint64) gasFunc

func ParseInitArgsAndCode

func ParseInitArgsAndCode(data []byte) ([]byte, []byte, error)

func ParseInput

func ParseInput(rinput []byte) (string, string, error)

func RefreshApp added in v0.3.6

func RefreshApp(app *APP)

RefreshApp --

func RemoveCache added in v0.3.6

func RemoveCache(name string)

func SafeAdd

func SafeAdd(x, y uint64) (uint64, bool)

safeAdd returns the result and whether overflow occurred.

func SafeMul

func SafeMul(x, y uint64) (uint64, bool)

safeMul returns multiplication result and whether overflow occurred.

func StopAots added in v0.3.6

func StopAots()

StopAots --

func ToWordSize

func ToWordSize(size uint64) uint64

toWordSize returns the ceiled word size required for memory expansion.

func TrimBuffToString

func TrimBuffToString(bytes []byte) string

trim the '\00' byte

Types

type APP

type APP struct {
	Name      string
	Debug     bool
	Module    *wasm.Module
	VM        *exec.VM
	VmProcess *exec.Process
	Eng       *Engine
	IsPreRun  bool
	EntryFunc string
	// contains filtered or unexported fields
}

func NewApp

func NewApp(name string, code []byte, eng *Engine, debug bool, logger log.Logger) (*APP, error)

NewApp new wasm app module

func (*APP) Clone

func (app *APP) Clone(eng *Engine) *APP

Clone just copy

func (*APP) Close added in v0.3.6

func (app *APP) Close()

Close --

func (*APP) GetEntryFunction

func (app *APP) GetEntryFunction() int64

GetEntryFunction Get Function Index for APPEntry

func (*APP) GetExportFunction

func (app *APP) GetExportFunction(fnName string) int64

GetExportFunction Get Function Index of specific fnName

func (*APP) GetStartFunction

func (app *APP) GetStartFunction() int64

GetStartFunction Get Function Index of Start function.

func (*APP) Printf added in v0.3.6

func (app *APP) Printf(f string, args ...interface{})

Printf --

func (*APP) Run

func (app *APP) Run(action, args string) (uint64, error)

Run execute AppEntry Function the input format should be "action | args"

func (*APP) RunF

func (app *APP) RunF(fnIndex int64, args ...uint64) (uint64, error)

RunF execute function code based on specific fnInex.

func (*APP) String added in v0.3.6

func (app *APP) String() string

type AccountRef

type AccountRef types.Address

AccountRef implements ContractRef.

Account references are used during EVM initialisation and it's primary use is to fetch addresses. Removing this object proves difficult because of the cached jump destinations which are fetched from the parent contract (i.e. the caller), which is a ContractRef.

func (AccountRef) Address

func (ar AccountRef) Address() types.Address

Address casts AccountRef to a Address

type AotService added in v0.3.6

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

AotService --

func NewAotService added in v0.3.6

func NewAotService(path string, keepSrouce bool) *AotService

NewAotService --

type Args

type Args struct {
	Params []Param `json:"Params"`
}

type Contract

type Contract struct {
	// CallerAddress is the result of the caller which initialised this
	// contract. However when the "call method" is delegated this value
	// needs to be initialised to that of the caller's caller.
	CallerAddress types.Address

	Self ContractRef

	Code     []byte
	CodeHash types.Hash
	CodeAddr *types.Address
	Input    []byte

	Gas uint64

	DelegateCall bool
	CreateCall   bool
	// contains filtered or unexported fields
}

Contract represents an ethereum contract in the state database. It contains the the contract code, calling arguments. Contract implements ContractRef

func NewContract

func NewContract(caller []byte, object []byte, value *big.Int, gas uint64) *Contract

NewContract returns a new contract environment for the execution of EVM.

func NewContractInner

func NewContractInner(caller ContractRef, object ContractRef, value *big.Int, gas uint64) *Contract

NewContract returns a new contract environment for the execution of call-contract.

func (*Contract) Address

func (c *Contract) Address() types.Address

Address returns the contracts address

func (*Contract) AsDelegate

func (c *Contract) AsDelegate() *Contract

AsDelegate sets the contract to be a delegate call and returns the current contract (for chaining calls)

func (*Contract) Caller

func (c *Contract) Caller() types.Address

Caller returns the caller of the contract.

Caller will recursively call caller when the contract is a delegate call, including that of caller's caller.

func (*Contract) SetCallCode

func (c *Contract) SetCallCode(addr []byte, hash []byte, code []byte)

SetCallCode sets the code of the contract and address of the backing data object

func (*Contract) SetCode

func (c *Contract) SetCode(hash types.Hash, code []byte)

SetCode sets the code to the contract

func (*Contract) UseGas

func (c *Contract) UseGas(gas uint64) (ok bool)

UseGas attempts the use gas and subtracts it and returns true on success

func (*Contract) Value

func (c *Contract) Value() *big.Int

Value returns the contracts value (sent to it from it's caller)

type ContractInfo added in v0.3.6

type ContractInfo struct {
	Type string   `json:"t"`
	Path string   `json:"p"`
	MD5  [16]byte `json:"md5"`
	Err  string   `json:"e"`
}

ContractInfo --

type ContractRef

type ContractRef interface {
	Address() types.Address
}

ContractRef is a reference to the contract's backing object

type Engine

type Engine struct {
	State      StateDB
	AppCache   *sync.Map
	Env        *EnvTable
	AppFrames  []*APP
	FrameIndex int

	Contract *Contract
	Ctx      interface{}
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(c *Contract, gas uint64, db StateDB, logger log.Logger) *Engine

func (*Engine) AddFee added in v0.3.4

func (e *Engine) AddFee(fee uint64)

func (*Engine) AppByName

func (eng *Engine) AppByName(name string) *APP

func (*Engine) CalFee added in v0.3.4

func (e *Engine) CalFee(realCost uint64, currentFee uint64)

func (*Engine) Caller

func (eng *Engine) Caller() []byte

Caller implement Backend

func (*Engine) EnvTable

func (eng *Engine) EnvTable() *EnvTable

func (*Engine) Gas

func (eng *Engine) Gas() uint64

func (*Engine) GasUsed

func (eng *Engine) GasUsed() uint64

func (*Engine) GetFee added in v0.3.4

func (e *Engine) GetFee() uint64

func (*Engine) IsTracing

func (eng *Engine) IsTracing() bool

IsTracing implement Backend

func (*Engine) Logger

func (eng *Engine) Logger() log.Logger

func (*Engine) NewApp

func (eng *Engine) NewApp(name string, code []byte, debug bool) (*APP, error)

func (*Engine) PopAppFrame

func (eng *Engine) PopAppFrame() (*APP, int)

func (*Engine) PushAppFrame

func (eng *Engine) PushAppFrame(app *APP) (int, error)

func (*Engine) RemoveCache added in v0.3.6

func (eng *Engine) RemoveCache(name string)

func (*Engine) Run

func (eng *Engine) Run(app *APP, input []byte) (uint64, error)

func (*Engine) RunningAppFrame

func (eng *Engine) RunningAppFrame() (*APP, int)

func (*Engine) SetFee added in v0.3.4

func (e *Engine) SetFee(fee uint64)

func (*Engine) SetTrace

func (eng *Engine) SetTrace(isTrace bool)

func (*Engine) Trace

func (eng *Engine) Trace(msg string, v ...interface{})

Trace implement Backend

func (*Engine) UseGas

func (eng *Engine) UseGas(cost uint64) bool

UseGas implement Backend

type EnvFunc

type EnvFunc interface {
	Call(index int64, ops interface{}, args []uint64) (uint64, error)
	Gas(index int64, ops interface{}, args []uint64) (uint64, error)
}

type EnvTable

type EnvTable struct {
	Exports wasm.SectionExports
	Module  wasm.Module
	// contains filtered or unexported fields
}

EnvTable stand for env's info which we will register for wasm module before it run.

func NewEnvTable

func NewEnvTable() *EnvTable

NewEnvTable new EnvTable

func (*EnvTable) GetFuncByName

func (env *EnvTable) GetFuncByName(name string) EnvFunc

GetFuncByName Get env function by name

func (*EnvTable) RegisterFunc

func (env *EnvTable) RegisterFunc(name string, fn EnvFunc)

RegisterFunc Register env function for wasm module

func (*EnvTable) RegisterGlobal

func (env *EnvTable) RegisterGlobal(name string, v interface{})

RegisterGlobal Register env global for wasm module

type Error

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

func (Error) Error

func (e Error) Error() string

type GasTable

type GasTable struct {
	ExtcodeSize uint64
	ExtcodeCopy uint64
	ExpByte     uint64
	Balance     uint64
	SLoad       uint64
	Calls       uint64
	Suicide     uint64

	// CreateBySuicide occurs when the
	// refunded account is one that does
	// not exist. This logic is similar
	// to call. May be left nil. Nil means
	// not charged.
	CreateBySuicide uint64
}

GasTable organizes gas prices for different phases.

type Native added in v0.3.6

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

Native --

func GetNative added in v0.3.6

func GetNative(app *APP) *Native

GetNative --

func NewNative added in v0.3.6

func NewNative(app *APP, file string) (*Native, error)

NewNative --

func (*Native) Printf added in v0.3.6

func (native *Native) Printf(f string, args ...interface{})

Printf --

func (*Native) RunCMain added in v0.3.6

func (native *Native) RunCMain(action, args string) (ret uint64, err error)

RunCMain --

type Param

type Param struct {
	Ptype string `json:"type"`
	Pval  string `json:"value"`
}

type Result

type Result struct {
	Ptype    string `json:"type"`
	Pval     string `json:"value"`
	Psucceed int    `json:"succeed"`
}

type StateDB

type StateDB interface {
	GetContractCode([]byte) []byte
	GetContractInfo([]byte) []byte
	SetContractInfo([]byte, []byte)
}

type TCAbort

type TCAbort struct{}

func (*TCAbort) Call

func (t *TCAbort) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCAbort) Gas

func (t *TCAbort) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCAssert

type TCAssert struct{}

func (*TCAssert) Call

func (t *TCAssert) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCAssert) Gas

func (t *TCAssert) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCAtof32

type TCAtof32 struct{}

func (*TCAtof32) Call

func (t *TCAtof32) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCAtof32) Gas

func (t *TCAtof32) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCAtof64

type TCAtof64 struct{}

func (*TCAtof64) Call

func (t *TCAtof64) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCAtof64) Gas

func (t *TCAtof64) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCAtoi

type TCAtoi struct{}

func (*TCAtoi) Call

func (t *TCAtoi) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCAtoi) Gas

func (t *TCAtoi) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCAtoi64

type TCAtoi64 struct{}

func (*TCAtoi64) Call

func (t *TCAtoi64) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCAtoi64) Gas

func (t *TCAtoi64) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCBigIntAdd

type TCBigIntAdd struct{}

func (*TCBigIntAdd) Call

func (t *TCBigIntAdd) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCBigIntAdd) Gas

func (t *TCBigIntAdd) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCBigIntCmp

type TCBigIntCmp struct{}

func (*TCBigIntCmp) Call

func (t *TCBigIntCmp) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCBigIntCmp) Gas

func (t *TCBigIntCmp) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCBigIntDiv

type TCBigIntDiv struct{}

func (*TCBigIntDiv) Call

func (t *TCBigIntDiv) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCBigIntDiv) Gas

func (t *TCBigIntDiv) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCBigIntMod

type TCBigIntMod struct{}

func (*TCBigIntMod) Call

func (t *TCBigIntMod) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCBigIntMod) Gas

func (t *TCBigIntMod) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCBigIntMul

type TCBigIntMul struct{}

func (*TCBigIntMul) Call

func (t *TCBigIntMul) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCBigIntMul) Gas

func (t *TCBigIntMul) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCBigIntSub

type TCBigIntSub struct{}

func (*TCBigIntSub) Call

func (t *TCBigIntSub) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCBigIntSub) Gas

func (t *TCBigIntSub) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCBigIntToInt64

type TCBigIntToInt64 struct{}

func (*TCBigIntToInt64) Call

func (t *TCBigIntToInt64) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCBigIntToInt64) Gas

func (t *TCBigIntToInt64) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCCallContract

type TCCallContract struct{}

---------------------------------------------

func (*TCCallContract) Call

func (t *TCCallContract) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCCallContract) Gas

func (t *TCCallContract) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCCalloc

type TCCalloc struct{}

func (*TCCalloc) Call

func (t *TCCalloc) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCCalloc) Gas

func (t *TCCalloc) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCDelegateCallContract

type TCDelegateCallContract struct{}

func (*TCDelegateCallContract) Call

func (t *TCDelegateCallContract) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCDelegateCallContract) Gas

func (t *TCDelegateCallContract) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCExit

type TCExit struct{}

func (*TCExit) Call

func (t *TCExit) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCExit) Gas

func (t *TCExit) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCFree

type TCFree struct{}

func (*TCFree) Call

func (t *TCFree) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCFree) Gas

func (t *TCFree) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCGasLeft

type TCGasLeft struct{}

func (*TCGasLeft) Call

func (t *TCGasLeft) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCGasLeft) Gas

func (t *TCGasLeft) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCGetMsgData

type TCGetMsgData struct{}

func (*TCGetMsgData) Call

func (t *TCGetMsgData) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCGetMsgData) Gas

func (t *TCGetMsgData) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCGetMsgGas

type TCGetMsgGas struct{}

func (*TCGetMsgGas) Call

func (t *TCGetMsgGas) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCGetMsgGas) Gas

func (t *TCGetMsgGas) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCGetMsgSender

type TCGetMsgSender struct{}

func (*TCGetMsgSender) Call

func (t *TCGetMsgSender) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCGetMsgSender) Gas

func (t *TCGetMsgSender) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCGetMsgSign

type TCGetMsgSign struct{}

func (*TCGetMsgSign) Call

func (t *TCGetMsgSign) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCGetMsgSign) Gas

func (t *TCGetMsgSign) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCGetSelfAddress

type TCGetSelfAddress struct{}

func (*TCGetSelfAddress) Call

func (t *TCGetSelfAddress) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCGetSelfAddress) Gas

func (t *TCGetSelfAddress) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCI64toa

type TCI64toa struct{}

func (*TCI64toa) Call

func (t *TCI64toa) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCI64toa) Gas

func (t *TCI64toa) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCIsHexAddress

type TCIsHexAddress struct{}

func (*TCIsHexAddress) Call

func (t *TCIsHexAddress) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCIsHexAddress) Gas

func (t *TCIsHexAddress) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCItoa

type TCItoa struct{}

func (*TCItoa) Call

func (t *TCItoa) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCItoa) Gas

func (t *TCItoa) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONGetAddress

type TCJSONGetAddress struct{}

func (*TCJSONGetAddress) Call

func (t *TCJSONGetAddress) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONGetAddress) Gas

func (t *TCJSONGetAddress) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONGetBigInt

type TCJSONGetBigInt struct{}

func (*TCJSONGetBigInt) Call

func (t *TCJSONGetBigInt) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONGetBigInt) Gas

func (t *TCJSONGetBigInt) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONGetDouble

type TCJSONGetDouble struct{}

func (*TCJSONGetDouble) Call

func (t *TCJSONGetDouble) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONGetDouble) Gas

func (t *TCJSONGetDouble) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONGetFloat

type TCJSONGetFloat struct{}

func (*TCJSONGetFloat) Call

func (t *TCJSONGetFloat) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONGetFloat) Gas

func (t *TCJSONGetFloat) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONGetInt

type TCJSONGetInt struct{}

func (*TCJSONGetInt) Call

func (t *TCJSONGetInt) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONGetInt) Gas

func (t *TCJSONGetInt) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONGetInt64

type TCJSONGetInt64 struct{}

func (*TCJSONGetInt64) Call

func (t *TCJSONGetInt64) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONGetInt64) Gas

func (t *TCJSONGetInt64) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONGetObject

type TCJSONGetObject struct{}

func (*TCJSONGetObject) Call

func (t *TCJSONGetObject) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONGetObject) Gas

func (t *TCJSONGetObject) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONGetString

type TCJSONGetString struct{}

func (*TCJSONGetString) Call

func (t *TCJSONGetString) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONGetString) Gas

func (t *TCJSONGetString) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONNewObject

type TCJSONNewObject struct{}

func (*TCJSONNewObject) Call

func (t *TCJSONNewObject) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONNewObject) Gas

func (t *TCJSONNewObject) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONParse

type TCJSONParse struct{}

func (*TCJSONParse) Call

func (t *TCJSONParse) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONParse) Gas

func (t *TCJSONParse) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONPutAddress

type TCJSONPutAddress struct{}

func (*TCJSONPutAddress) Call

func (t *TCJSONPutAddress) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONPutAddress) Gas

func (t *TCJSONPutAddress) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONPutBigInt

type TCJSONPutBigInt struct{}

func (*TCJSONPutBigInt) Call

func (t *TCJSONPutBigInt) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONPutBigInt) Gas

func (t *TCJSONPutBigInt) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONPutDouble

type TCJSONPutDouble struct{}

func (*TCJSONPutDouble) Call

func (t *TCJSONPutDouble) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONPutDouble) Gas

func (t *TCJSONPutDouble) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONPutFloat

type TCJSONPutFloat struct{}

func (*TCJSONPutFloat) Call

func (t *TCJSONPutFloat) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONPutFloat) Gas

func (t *TCJSONPutFloat) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONPutInt

type TCJSONPutInt struct{}

func (*TCJSONPutInt) Call

func (t *TCJSONPutInt) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONPutInt) Gas

func (t *TCJSONPutInt) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONPutInt64

type TCJSONPutInt64 struct{}

func (*TCJSONPutInt64) Call

func (t *TCJSONPutInt64) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONPutInt64) Gas

func (t *TCJSONPutInt64) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONPutObject

type TCJSONPutObject struct{}

func (*TCJSONPutObject) Call

func (t *TCJSONPutObject) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONPutObject) Gas

func (t *TCJSONPutObject) Gas(index int64, ops interface{}, args []uint64) (gas uint64, err error)

type TCJSONPutString

type TCJSONPutString struct{}

func (*TCJSONPutString) Call

func (t *TCJSONPutString) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONPutString) Gas

func (t *TCJSONPutString) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCJSONToString

type TCJSONToString struct{}

func (*TCJSONToString) Call

func (t *TCJSONToString) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCJSONToString) Gas

func (t *TCJSONToString) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCKeccak256

type TCKeccak256 struct{}

func (*TCKeccak256) Call

func (t *TCKeccak256) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCKeccak256) Gas

func (t *TCKeccak256) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCMalloc

type TCMalloc struct{}

func (*TCMalloc) Call

func (t *TCMalloc) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCMalloc) Gas

func (t *TCMalloc) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCMemcmp

type TCMemcmp struct{}

func (*TCMemcmp) Call

func (t *TCMemcmp) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCMemcmp) Gas

func (t *TCMemcmp) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCMemcpy

type TCMemcpy struct{}

func (*TCMemcpy) Call

func (t *TCMemcpy) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCMemcpy) Gas

func (t *TCMemcpy) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCMemmove

type TCMemmove struct{}

func (*TCMemmove) Call

func (t *TCMemmove) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCMemmove) Gas

func (t *TCMemmove) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCMemset

type TCMemset struct{}

func (*TCMemset) Call

func (t *TCMemset) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCMemset) Gas

func (t *TCMemset) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCPayable

type TCPayable struct{}

func (*TCPayable) Call

func (t *TCPayable) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCPayable) Gas

func (t *TCPayable) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCPrints

type TCPrints struct{}

func (*TCPrints) Call

func (t *TCPrints) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCPrints) Gas

func (t *TCPrints) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCPrintsl

type TCPrintsl struct{}

func (*TCPrintsl) Call

func (t *TCPrintsl) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCPrintsl) Gas

func (t *TCPrintsl) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCRealloc

type TCRealloc struct{}

func (*TCRealloc) Call

func (t *TCRealloc) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCRealloc) Gas

func (t *TCRealloc) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCRequire

type TCRequire struct{}

func (*TCRequire) Call

func (t *TCRequire) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCRequire) Gas

func (t *TCRequire) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCRequireWithMsg

type TCRequireWithMsg struct{}

func (*TCRequireWithMsg) Call

func (t *TCRequireWithMsg) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCRequireWithMsg) Gas

func (t *TCRequireWithMsg) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCRevert

type TCRevert struct{}

func (*TCRevert) Call

func (t *TCRevert) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCRevert) Gas

func (t *TCRevert) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCRevertWithMsg

type TCRevertWithMsg struct{}

func (*TCRevertWithMsg) Call

func (t *TCRevertWithMsg) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCRevertWithMsg) Gas

func (t *TCRevertWithMsg) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCRipemd160

type TCRipemd160 struct{}

func (*TCRipemd160) Call

func (t *TCRipemd160) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCRipemd160) Gas

func (t *TCRipemd160) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCSha256

type TCSha256 struct{}

func (*TCSha256) Call

func (t *TCSha256) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCSha256) Gas

func (t *TCSha256) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCStrcmp

type TCStrcmp struct{}

func (*TCStrcmp) Call

func (t *TCStrcmp) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCStrcmp) Gas

func (t *TCStrcmp) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCStrconcat

type TCStrconcat struct{}

func (*TCStrconcat) Call

func (t *TCStrconcat) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCStrconcat) Gas

func (t *TCStrconcat) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCStrcpy

type TCStrcpy struct{}

func (*TCStrcpy) Call

func (t *TCStrcpy) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCStrcpy) Gas

func (t *TCStrcpy) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

type TCStrlen

type TCStrlen struct{}

func (*TCStrlen) Call

func (t *TCStrlen) Call(index int64, ops interface{}, args []uint64) (uint64, error)

func (*TCStrlen) Gas

func (t *TCStrlen) Gas(index int64, ops interface{}, args []uint64) (uint64, error)

Jump to

Keyboard shortcuts

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