countercontract

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

基于wasm包装层的简单计数器合约示例

Index

Constants

View Source
const (
	CounterKey = "counter_value"
)

计数器合约的状态键

Variables

This section is empty.

Functions

func GetCounter

func GetCounter(ctx core.Context) uint64

获取计数器当前值

func Increment

func Increment(ctx core.Context, value uint64) uint64

增加计数器

func Initialize

func Initialize(ctx core.Context) int32

初始化合约 此函数是大写开头的,因此会被自动导出并在合约部署时调用

func Reset

func Reset(ctx core.Context)

重置计数器值为0

Types

This section is empty.

Jump to

Keyboard shortcuts

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