SC Arguments: [Name:SC_ACTION Type:uint64 Value:'0' Name:SC_ID Type:hash Value:'fc09e4253b8aa9789038ddd5778dc056593cf2ca83699eb47bdf799d1c572594' Name:code Type:string Value:'Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "WebGuy Alhpa")
31 STORE("descrHdr", "Webguy's Alhpa App")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "webguy.alpha.tela")
40 STORE("DOC1", "830086fcfbbba9d8ee5061b71fde4526c0586d58da4f931ef986cc63c8932dc1")
41 STORE("DOC2", "dcb1d5477ffe4f816ac6d012ee665c8067e99ee96bb7de47e26d3cd6aaa818a4")
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")
60 STORE("commit", 0)
70 STORE(0, HEX(TXID()))
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 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)
50 STORE(LOAD("commit"), HEX(TXID()))
60 STORE("hash", HEX(TXID()))
100 RETURN 0
End Function' Name:entrypoint Type:string Value:'UpdateCode'] |