diff --git a/alphabet/alphabet_contract.go b/alphabet/alphabet_contract.go index 28f8817..01e2d72 100644 --- a/alphabet/alphabet_contract.go +++ b/alphabet/alphabet_contract.go @@ -36,11 +36,11 @@ func init() { ctx = storage.GetContext() } -// OnPayment is a callback for NEP-17 compatible native GAS and NEO contracts. -func OnPayment(from interop.Hash160, amount int, data interface{}) { +// OnNEP17Payment is a callback for NEP-17 compatible native GAS and NEO contracts. +func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { caller := runtime.GetCallingScriptHash() if !common.BytesEqual(caller, []byte(gasHash)) && !common.BytesEqual(caller, []byte(neoHash)) { - panic("onPayment: alphabet contract accepts GAS and NEO only") + panic("onNEP17Payment: alphabet contract accepts GAS and NEO only") } } diff --git a/neofs/neofs_contract.go b/neofs/neofs_contract.go index 3eb9569..4418a22 100644 --- a/neofs/neofs_contract.go +++ b/neofs/neofs_contract.go @@ -187,8 +187,8 @@ func InnerRingCandidateAdd(key []byte) bool { return true } -// OnPayment is a callback for NEP-17 compatible native GAS contract. -func OnPayment(from interop.Hash160, amount int, data interface{}) { +// OnNEP17Payment is a callback for NEP-17 compatible native GAS contract. +func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) { rcv := data.(interop.Hash160) if common.BytesEqual(rcv, []byte(ignoreDepositNotification)) { return @@ -196,7 +196,7 @@ func OnPayment(from interop.Hash160, amount int, data interface{}) { caller := runtime.GetCallingScriptHash() if !common.BytesEqual(caller, []byte(tokenHash)) { - panic("onPayment: only GAS can be accepted for deposit") + panic("onNEP17Payment: only GAS can be accepted for deposit") } switch len(rcv) { @@ -204,10 +204,10 @@ func OnPayment(from interop.Hash160, amount int, data interface{}) { case 0: rcv = from default: - panic("onPayment: invalid data argument, expected Hash160") + panic("onNEP17Payment: invalid data argument, expected Hash160") } - runtime.Log("onPayment: funds have been transferred") + runtime.Log("onNEP17Payment: funds have been transferred") tx := runtime.GetScriptContainer() runtime.Notify("Deposit", from, amount, rcv, tx.Hash)