Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

native_coin.gno

0.46 Kb · 19 lines
 1package common
 2
 3import (
 4	"chain/runtime/unsafe"
 5	"errors"
 6)
 7
 8// ValidateNotHandleNativeCoin rejects calls that include native coins in the
 9// transaction's origin send data; it returns nil when no native coin is attached.
10//
11// Returns:
12//   - error: non-nil when the call attempts to send native coins; nil otherwise
13func (c *commonV1) ValidateNotHandleNativeCoin() error {
14	if len(unsafe.OriginSend()) > 0 {
15		return errors.New(errNotHandleNativeCoin)
16	}
17
18	return nil
19}