neoneo-go/pkg/smartcontract/callflag/call_flags.go

23 lines
464 B
Go
Raw Normal View History

package callflag
2020-03-19 15:52:37 +00:00
// CallFlag represents call flag.
type CallFlag byte
// Default flags.
const (
ReadStates CallFlag = 1 << iota
WriteStates
2020-03-19 15:52:37 +00:00
AllowCall
AllowNotify
States = ReadStates | WriteStates
ReadOnly = ReadStates | AllowCall
All = States | AllowCall | AllowNotify
NoneFlag CallFlag = 0
2020-03-19 15:52:37 +00:00
)
// Has returns true iff all bits set in cf are also set in f.
func (f CallFlag) Has(cf CallFlag) bool {
return f&cf == cf
}