Hello entry
Focus: one callable hello entry that builds and returns a greeting.
hello.slx
entry hello(name: string) -> string {
let message: string = "Hello, " + name
// Debug print: by default, nodes do not show println output.
println(message)
return message
}How it works
entry hello(name: string) -> stringis the single public function in this example.let message: string = "Hello, " + namebuilds the returned value.println(message)is useful while debugging locally, but default node configuration does not display its output.return messageproduces a typed exit value. On-chain, it is stored in the contract logs.
Last updated on