Documentation
¶
Overview ¶
Package counter implements a simple counter contract example. Each counter is stored in a separate object, allowing multiple counters to exist simultaneously. The user who calls Initialize becomes the owner of the counter object. Only the owner can modify the counter value through Increment or Reset functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetValue ¶
GetValue retrieves the current value of the specified counter. This function can be called by any user.
func Increment ¶
Increment increases the counter value by the specified amount. Only the owner of the counter object can call this function.
func Initialize ¶
Initialize creates a new counter object with the specified initial value. The caller becomes the owner of the counter object. Returns the ObjectID of the created counter.
Types ¶
This section is empty.