Smart Contract
HelloWorld
A.f7913d7a57ba6555.HelloWorld
1// HelloWorld.cdc
2//
3access(all)
4contract HelloWorld {
5
6 // Declare a public (access(all)) field of type String.
7 //
8 // All fields must be initialized in the initializer.
9 access(all)
10 let greeting: String
11
12 // The initializer is required if the contract contains any fields.
13 init() {
14 self.greeting = "Hello, World!"
15 }
16
17 // Public function that returns our friendly greeting!
18 access(all) view
19 fun hello(): String {
20 return self.greeting
21 }
22}