compiler

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package runtime provides the execution environment for smart contracts.

Index

Constants

This section is empty.

Variables

View Source
var RestrictedCommentPrefixes []string = []string{
	"go ",
	"+build",
	"-build",
	"go:",
	"// +build",
	"//line",
	"//export",
	"//extern",
	"//cgo",
	"//syscall",
	"//unsafe",
	"//runtime",
	"//internal",
	"//vendor",
}
View Source
var WASM_CONTRACT_TEMPLATE string

Functions

This section is empty.

Types

type FunctionInfo

type FunctionInfo struct {
	Name string
	Args []struct {
		Name string
		Type string
	}
}

FunctionInfo 函数信息

type Maker

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

Maker handles the compilation and validation of smart contracts.

func NewMaker

func NewMaker(config api.ContractConfig) *Maker

NewMaker creates a new contract maker with the given configuration.

func (*Maker) CompileContract

func (m *Maker) CompileContract(code []byte) ([]byte, error)

CompileContract compiles the given contract source code.

func (*Maker) ParseABI

func (m *Maker) ParseABI(code []byte) (map[string]FunctionInfo, error)

ParseABI 解析合约代码获取函数信息

func (*Maker) ValidateContract

func (m *Maker) ValidateContract(code []byte) error

ValidateContract checks if the smart contract code adheres to the restrictions and rules defined for the VM.

Directories

Path Synopsis
WebAssembly 合约通信包装层 为智能合约提供与主机环境通信的标准接口
WebAssembly 合约通信包装层 为智能合约提供与主机环境通信的标准接口

Jump to

Keyboard shortcuts

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