SC CODE: // Copyright 2024. Civilware. All rights reserved.
// TELA Decentralized Web Standard (TELA-INDEX-1)
Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "Full Tank 3D")
31 STORE("descrHdr", "Full Tank 3D is the next evolution of the Full Tank game, bringing the action into full three-dimensional terrain. Dual-axis controller recommended.")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "fulltank3d.tela")
40 STORE("DOC1", "98d5505aca1809d6eb96b914ab409d3e05b12d1b25e969c56cce5a6a09fc7cc9")
41 STORE("DOC2", "8d02c88dae2d112f07d95ae854ddf7febc98077fcc836ef3842aa593a8a86aeb")
42 STORE("DOC3", "af2632f7f913a1738dd73b4add304f1aeba1aefd9e104bde04cc438d8ac775d8")
43 STORE("DOC4", "87c7b48eb3c1fba0e0480c4a43fe51449dea007b5f5eb55d491d46da4c1248a4")
44 STORE("DOC5", "b1321cc63db239bed9d3f8c66fd85db6c47e0e6cb5c061e5623be63f2cce3789")
1000 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("telaVersion", "1.0.0") // TELA SC version
60 STORE("commit", 0) // The initial commit
70 STORE(0, HEX(TXID())) // SCID commit hash
80 STORE("hash", HEX(TXID()))
85 STORE("likes", 0)
90 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
Function UpdateCode(code String) Uint64
10 IF LOAD("owner") == "anon" THEN GOTO 20
15 IF code == "" THEN GOTO 20
16 IF LOAD("owner") == address() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 STORE("commit", LOAD("commit")+1) // New commit
50 STORE(LOAD("commit"), HEX(TXID())) // New hash
60 STORE("hash", HEX(TXID()))
100 RETURN 0
End Function
|
| SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'// Copyright 2024. Civilware. All rights reserved.
// TELA Decentralized Web Standard (TELA-INDEX-1)
Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "Full Tank 3D")
31 STORE("descrHdr", "Full Tank 3D is the next evolution of the Full Tank game, bringing the action into full three-dimensional terrain. Dual-axis controller recommended.")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "fulltank3d.tela")
40 STORE("DOC1", "98d5505aca1809d6eb96b914ab409d3e05b12d1b25e969c56cce5a6a09fc7cc9")
41 STORE("DOC2", "8d02c88dae2d112f07d95ae854ddf7febc98077fcc836ef3842aa593a8a86aeb")
42 STORE("DOC3", "af2632f7f913a1738dd73b4add304f1aeba1aefd9e104bde04cc438d8ac775d8")
43 STORE("DOC4", "87c7b48eb3c1fba0e0480c4a43fe51449dea007b5f5eb55d491d46da4c1248a4")
44 STORE("DOC5", "b1321cc63db239bed9d3f8c66fd85db6c47e0e6cb5c061e5623be63f2cce3789")
1000 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("telaVersion", "1.0.0") // TELA SC version
60 STORE("commit", 0) // The initial commit
70 STORE(0, HEX(TXID())) // SCID commit hash
80 STORE("hash", HEX(TXID()))
85 STORE("likes", 0)
90 STORE("dislikes", 0)
100 RETURN 0
End Function
Function address() String
10 DIM s as String
20 LET s = SIGNER()
30 IF IS_ADDRESS_VALID(s) THEN GOTO 50
40 RETURN "anon"
50 RETURN ADDRESS_STRING(s)
End Function
Function Rate(r Uint64) Uint64
10 DIM addr as String
15 LET addr = address()
16 IF r < 100 && EXISTS(addr) == 0 && addr != "anon" THEN GOTO 30
20 RETURN 1
30 STORE(addr, ""+r+"_"+BLOCK_HEIGHT())
40 IF r < 50 THEN GOTO 70
50 STORE("likes", LOAD("likes")+1)
60 RETURN 0
70 STORE("dislikes", LOAD("dislikes")+1)
100 RETURN 0
End Function
Function UpdateCode(code String) Uint64
10 IF LOAD("owner") == "anon" THEN GOTO 20
15 IF code == "" THEN GOTO 20
16 IF LOAD("owner") == address() THEN GOTO 30
20 RETURN 1
30 UPDATE_SC_CODE(code)
40 STORE("commit", LOAD("commit")+1) // New commit
50 STORE(LOAD("commit"), HEX(TXID())) // New hash
60 STORE("hash", HEX(TXID()))
100 RETURN 0
End Function
'] |