neo-go/pkg/smartcontract/call_flags.go

21 lines
440 B
Go
Raw Normal View History

2020-03-19 15:52:37 +00:00
package smartcontract
// CallFlag represents call flag.
type CallFlag byte
// Default flags.
const (
AllowStates CallFlag = 1 << iota
AllowModifyStates
2020-03-19 15:52:37 +00:00
AllowCall
AllowNotify
ReadOnly = AllowStates | AllowCall | AllowNotify
All = ReadOnly | AllowModifyStates
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
}