[#XX] Hello world contract
Created a contract to test neo-go contract init command. It compiles just fine. Signed-off-by: Lebedeva Ekaterina <ekaterina.lebedeva@yadro.com>
This commit is contained in:
parent
562dd4cb9f
commit
099b1cb9f1
5 changed files with 33 additions and 0 deletions
5
FirstContract/go.mod
Normal file
5
FirstContract/go.mod
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
module FirstContract
|
||||||
|
|
||||||
|
go 1.20
|
||||||
|
|
||||||
|
require github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20221202075445-cb5c18dc73eb
|
2
FirstContract/go.sum
Normal file
2
FirstContract/go.sum
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20221202075445-cb5c18dc73eb h1:GFxfkpXEYAbMIr69JpKOsQWeLOaGrd49HNAor8uDW+A=
|
||||||
|
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20221202075445-cb5c18dc73eb/go.mod h1:23bBw0v6pBYcrWs8CBEEDIEDJNbcFoIh8pGGcf2Vv8s=
|
15
FirstContract/main.go
Normal file
15
FirstContract/main.go
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package FirstContract
|
||||||
|
|
||||||
|
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 = "Hello world!"
|
||||||
|
}
|
||||||
|
|
||||||
|
// RuntimeNotify sends runtime notification with "Hello world!" name
|
||||||
|
func RuntimeNotify(args []interface{}) {
|
||||||
|
runtime.Notify(notificationName, args)
|
||||||
|
}
|
BIN
FirstContract/main.nef
Executable file
BIN
FirstContract/main.nef
Executable file
Binary file not shown.
11
FirstContract/neo-go.yml
Normal file
11
FirstContract/neo-go.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
name: FirstContract
|
||||||
|
sourceurl: http://example.com/
|
||||||
|
safemethods: []
|
||||||
|
supportedstandards: []
|
||||||
|
events:
|
||||||
|
- name: Hello world!
|
||||||
|
parameters:
|
||||||
|
- name: args
|
||||||
|
type: Array
|
||||||
|
permissions:
|
||||||
|
- methods: '*'
|
Loading…
Reference in a new issue