forked from TrueCloudLab/frostfs-contract
[#105] processing: Add docs
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
726e7995fc
commit
c5ac475d32
2 changed files with 27 additions and 1 deletions
|
@ -18,6 +18,7 @@ const (
|
|||
multiaddrMethod = "alphabetAddress"
|
||||
)
|
||||
|
||||
// OnNEP17Payment is a callback for NEP-17 compatible native GAS contract.
|
||||
func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) {
|
||||
caller := runtime.GetCallingScriptHash()
|
||||
if !common.BytesEqual(caller, []byte(gas.Hash)) {
|
||||
|
@ -50,6 +51,8 @@ func _deploy(data interface{}, isUpdate bool) {
|
|||
runtime.Log("processing contract initialized")
|
||||
}
|
||||
|
||||
// Migrate method updates contract source code and manifest. Can be invoked
|
||||
// only by contract owner.
|
||||
func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
||||
ctx := storage.GetReadOnlyContext()
|
||||
|
||||
|
@ -64,6 +67,8 @@ func Migrate(script []byte, manifest []byte, data interface{}) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// Verify method returns true if transaction contains valid multi signature of
|
||||
// Alphabet nodes of the Inner Ring.
|
||||
func Verify() bool {
|
||||
ctx := storage.GetContext()
|
||||
neofsContractAddr := storage.Get(ctx, neofsContractKey).(interop.Hash160)
|
||||
|
@ -72,6 +77,7 @@ func Verify() bool {
|
|||
return runtime.CheckWitness(multiaddr)
|
||||
}
|
||||
|
||||
// Version returns version of the contract.
|
||||
func Version() int {
|
||||
return version
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue