Documentation ¶
Index ¶
- Constants
- Variables
- func AbortWithMessage(msg string)
- func AlphabetAddress() interop.Hash160
- func AlphabetNodes() []interop.PublicKey
- func AppendVersion(data any) []interface{}
- func BurnTransferDetails(txDetails []byte) []byte
- func BytesEqual(a []byte, b []byte) bool
- func CheckAlphabetWitness()
- func CheckOwnerWitness(caller []byte)
- func CheckVersion(from int)
- func CheckWitness(caller []byte)
- func CommitteeAddress() interop.Hash160
- func ContainerFeeTransferDetails(cid []byte) []byte
- func FromFixedWidth64(x []byte) int
- func HasUpdateAccess() bool
- func InnerRingNodes() []interop.PublicKey
- func LockTransferDetails(txDetails []byte) []byte
- func MintTransferDetails(txDetails []byte) []byte
- func Multiaddress(n []interop.PublicKey, committee bool) interop.Hash160
- func SetSerialized(ctx storage.Context, key any, value interface{})
- func ToFixedWidth64(x int) []byte
- func UnlockTransferDetails(epoch int) []byte
- func WalletToScriptHash(wallet []byte) []byte
- type IRNode
Constants ¶
const ( Version = major*1_000_000 + minor*1_000 + patch PrevVersion = prevMajor*1_000_000 + prevMinor*1_000 + prevPatch // ErrVersionMismatch is thrown by CheckVersion in case of error. ErrVersionMismatch = "previous version mismatch" // ErrAlreadyUpdated is thrown by CheckVersion if current version equals to version contract // is being updated from. ErrAlreadyUpdated = "contract is already of the latest version" )
const LegacyOwnerKey = "contractOwner"
LegacyOwnerKey is storage key used to store contract owner.
Variables ¶
var ( // ErrAlphabetWitnessFailed appears when the method must be // called by the Alphabet but was not. ErrAlphabetWitnessFailed = "alphabet witness check failed" // ErrOwnerWitnessFailed appears when the method must be called // by an owner of some assets but was not. ErrOwnerWitnessFailed = "owner witness check failed" // ErrWitnessFailed appears when the method must be called // using certain public key but was not. ErrWitnessFailed = "witness check failed" )
Functions ¶
func AbortWithMessage ¶
func AbortWithMessage(msg string)
AbortWithMessage calls `runtime.Log` with the passed message and calls `ABORT` opcode.
func AlphabetAddress ¶
AlphabetAddress returns multi address of alphabet public keys.
func AlphabetNodes ¶
AlphabetNodes returns a list of alphabet nodes from committee in the sidechain.
func AppendVersion ¶
func AppendVersion(data any) []interface{}
AppendVersion appends current contract version to the list of deploy arguments.
func BurnTransferDetails ¶
func BytesEqual ¶
BytesEqual compares two slices of bytes by wrapping them into strings, which is necessary with new util.Equals interop behaviour, see neo-go#1176.
func CheckAlphabetWitness ¶
func CheckAlphabetWitness()
CheckAlphabetWitness checks witness of the passed caller. It panics with ErrAlphabetWitnessFailed message on fail.
func CheckOwnerWitness ¶
func CheckOwnerWitness(caller []byte)
CheckOwnerWitness checks witness of the passed caller. It panics with ErrOwnerWitnessFailed message on fail.
func CheckVersion ¶
func CheckVersion(from int)
CheckVersion checks that previous version is more than PrevVersion to ensure migrating contract data was done successfully.
func CheckWitness ¶
func CheckWitness(caller []byte)
CheckWitness checks witness of the passed caller. It panics with ErrWitnessFailed message on fail.
func CommitteeAddress ¶
CommitteeAddress returns multi address of committee.
func FromFixedWidth64 ¶ added in v0.19.0
FromFixedWidth64 is a reverse function for ToFixedWidth64.
func HasUpdateAccess ¶
func HasUpdateAccess() bool
HasUpdateAccess returns true if contract can be updated.
func InnerRingNodes ¶
InnerRingNodes return a list of inner ring nodes from state validator role in the sidechain.
func LockTransferDetails ¶
func MintTransferDetails ¶
func Multiaddress ¶
Multiaddress returns default multisignature account address for N keys. If committee set to true, it is `M = N/2+1` committee account.
func SetSerialized ¶
SetSerialized serializes data and puts it into contract storage.
func ToFixedWidth64 ¶ added in v0.19.0
ToFixedWidth64 converts x to bytes such that numbers <= math.MaxUint64 have constant with of 9.