assert.gno
0.40 Kb · 13 lines
1package common
2
3import "chain/runtime/unsafe"
4
5// AssertIsNotHandleNativeCoin validates that no native coins were sent with the transaction.
6// Panics with errNotHandleNativeCoin if any native coins were sent.
7//
8// Use this when a function should only work with GRC20 tokens and not accept native coins.
9func AssertIsNotHandleNativeCoin() {
10 if len(unsafe.OriginSend()) > 0 {
11 panic(errNotHandleNativeCoin)
12 }
13}