Add helloevent

Signed-off-by: Stanislav Bogatyrev <s.bogatyrev@yadro.com>
This commit is contained in:
Stanislav Bogatyrev 2023-11-08 13:46:11 +03:00
parent 230921d7ee
commit 9ce38e6ffa
4 changed files with 32 additions and 0 deletions

5
l3/helloevent/go.mod Normal file
View file

@ -0,0 +1,5 @@
module helloevent
go 1.20
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231108063405-7045d3bd63d9

2
l3/helloevent/go.sum Normal file
View file

@ -0,0 +1,2 @@
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231108063405-7045d3bd63d9 h1:VcjYKiGIn4EuUfibi4QI6lWkAFfg7PTYL8TxMvd+7Ck=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20231108063405-7045d3bd63d9/go.mod h1:J/Mk6+nKeKSW4wygkZQFLQ6SkLOSGX5Ga0RuuuktEag=

View file

@ -0,0 +1,15 @@
package helloevent
import "github.com/nspcc-dev/neo-go/pkg/interop/runtime"
var notificationName string
// init initializes notificationName before calling any other smart-contract method
func init() {
notificationName = "HelloWorld"
}
// RuntimeNotify sends runtime notification with "HelloWorld" name
func RuntimeNotify(args []any) {
runtime.Notify(notificationName, args)
}

View file

@ -0,0 +1,10 @@
name: "helloevent"
sourceurl: https://git.frostfs.info/Web3N3/web3-course
supportedstandards: []
events:
- name: HelloWorld
parameters:
- name: args
type: Array
permissions:
- methods: '*'