Documentation
¶
Index ¶
- Constants
- Variables
- func AbortWithMessage(msg string)
- func AlphabetAddress() []byte
- func AppendVersion(data interface{}) []interface{}
- func BurnTransferDetails(txDetails []byte) []byte
- func BytesEqual(a []byte, b []byte) bool
- func CheckAlphabetWitness(caller []byte)
- func CheckOwnerWitness(caller []byte)
- func CheckVersion(from int)
- func CheckWitness(caller []byte)
- func CommitteeAddress() []byte
- func ContainerFeeTransferDetails(cid []byte) []byte
- func FromKnownContract(ctx storage.Context, caller interop.Hash160, key string) bool
- func GetList(ctx storage.Context, key interface{}) [][]byte
- func HasUpdateAccess() bool
- func InitVote(ctx storage.Context)
- func InnerRingInvoker(ir []IRNode) interop.PublicKey
- func InvokeID(args []interface{}, prefix []byte) []byte
- func LockTransferDetails(txDetails []byte) []byte
- func MintTransferDetails(txDetails []byte) []byte
- func Multiaddress(n []interop.PublicKey, committee bool) []byte
- func RemoveVotes(ctx storage.Context, id []byte)
- func SetSerialized(ctx storage.Context, key interface{}, value interface{})
- func UnlockTransferDetails(epoch int) []byte
- func Vote(ctx storage.Context, id, from []byte) int
- func WalletToScriptHash(wallet []byte) []byte
- type Ballot
- 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" )
Variables ¶
var ( // ErrAlphabetWitnessFailed appears when method must be // called by Alphabet but was not. ErrAlphabetWitnessFailed = "alphabet witness check failed" // ErrOwnerWitnessFailed appears when method must be called // by owner of some assets but was not. ErrOwnerWitnessFailed = "owner witness check failed" // ErrWitnessFailed appears when method must be called // using certain public key but was not. ErrWitnessFailed = "witness check failed" )
Functions ¶
func AbortWithMessage ¶ added in v0.13.0
func AbortWithMessage(msg string)
AbortWithMessage calls `runtime.Log` with passed message and calls `ABORT` opcode.
func AlphabetAddress ¶ added in v0.6.0
func AlphabetAddress() []byte
AlphabetAddress returns multi address of alphabet public keys.
func AppendVersion ¶ added in v0.12.2
func AppendVersion(data interface{}) []interface{}
AppendVersion appends current contract version to the list of deploy arguments.
func BurnTransferDetails ¶ added in v0.7.0
func BytesEqual ¶
BytesEqual compares two slice of bytes by wrapping them into strings, which is necessary with new util.Equal interop behaviour, see neo-go#1176.
func CheckAlphabetWitness ¶ added in v0.13.0
func CheckAlphabetWitness(caller []byte)
CheckAlphabetWitness checks witness of the passed caller. Panics with ErrAlphabetWitnessFailed message on fail.
func CheckOwnerWitness ¶ added in v0.13.0
func CheckOwnerWitness(caller []byte)
CheckOwnerWitness checks witness of the passed caller. Panics with ErrOwnerWitnessFailed message on fail.
func CheckVersion ¶ added in v0.12.2
func CheckVersion(from int)
CheckVersion checks that previous version is more than PrevVersion to ensure migrating contract data was done successfully.
func CheckWitness ¶ added in v0.13.0
func CheckWitness(caller []byte)
CheckWitness checks witness of the passed caller. Panics with ErrWitnessFailed message on fail.
func CommitteeAddress ¶ added in v0.11.0
func CommitteeAddress() []byte
CommitteeAddress returns multi address of committee.
func ContainerFeeTransferDetails ¶ added in v0.7.0
func FromKnownContract ¶ added in v0.7.0
func HasUpdateAccess ¶
func HasUpdateAccess() bool
HasUpdateAccess returns true if contract can be updated.
func InnerRingInvoker ¶
InnerRingInvoker returns public key of inner ring node that invoked contract. Work around for environments without notary support.
func InvokeID ¶
InvokeID returns hashed value of prefix and args concatenation. Used to identify different ballots.
func LockTransferDetails ¶ added in v0.7.0
func MintTransferDetails ¶ added in v0.7.0
func Multiaddress ¶ added in v0.6.0
Multiaddress returns default multi signature account address for N keys. If committee set to true, then it is `M = N/2+1` committee account.
func RemoveVotes ¶
RemoveVotes clears ballots of the decision that has been accepted by inner ring nodes.
func SetSerialized ¶
SetSerialized serializes data and puts it into contract storage.
func UnlockTransferDetails ¶ added in v0.7.0
func Vote ¶
Vote adds ballot for the decision with specific 'id' and returns amount on unique voters for that decision.
func WalletToScriptHash ¶ added in v0.7.0
Types ¶
type IRNode ¶
func AlphabetNodes ¶ added in v0.6.0
func AlphabetNodes() []IRNode
AlphabetNodes return list of alphabet nodes from committee in side chain.
func InnerRingNodes ¶ added in v0.6.0
func InnerRingNodes() []IRNode
InnerRingNodes return list of inner ring nodes from state validator role in side chain.
func InnerRingNodesFromNetmap ¶ added in v0.7.0
InnerRingNodesFromNetmap gets list of inner ring through calling "innerRingList" method of smart contract. Work around for environments without notary support.