SC CODE: Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "Ghost Exchange")
31 STORE("descrHdr", "Phantom powered finance")
32 STORE("iconURLHdr", "https://raw.githubusercontent.com/ThreeDotsTech/ghost-interface/refs/heads/main/assets/SVG/happy-ghost.svg")
33 STORE("dURL", "1.2.0.ghost.trading.tela")
34 STORE("mods", "")
40 STORE("DOC1", "fa1d028f8eca081870d7a750e4798737f588ae490403fa7ff5352156808a4fa1")
41 STORE("DOC10", "f2bae526f17b12eec8c6f1d6e0ec34872af3693d7ad3dbb9e858fa63bed64790")
42 STORE("DOC11", "c935db3e0254fe474c2f26acb731aca282ed673f9c54723e82a39f422ba2d1ff")
43 STORE("DOC12", "a408c6bcf6ade50f603d1324467f3313ef9f99a86d8181e0c7be4b8bb55cacde")
44 STORE("DOC13", "baf97b777999c4863064cad69755bcce334c19c24cb971837c6c2082a3c54596")
45 STORE("DOC14", "bdff162a36db4c4155cdb1787f9320f4c252af2bb1e6dc2742cfb1ee3b30b5a9")
46 STORE("DOC15", "e6987f30944b6954d0ab17ed214cab92e381d66f46960d81f900fa01db29acb9")
47 STORE("DOC16", "e8c0fa4a0bb662c6e4ff9883168d0a40564e3ec7f9de2d78217988eaa53b32cf")
48 STORE("DOC17", "a3068c58159194c4476b722fadf61b357f66246495736f42b315b58489367bd2")
49 STORE("DOC18", "e6f56d0adf93cc3a05f9871e355d6404925260bf075a032b524a49e42ad4f8e6")
50 STORE("DOC19", "9e5fc0a8f1ac01083c5aa4497486e466dc48fe976d70c68af32220853db35bbf")
51 STORE("DOC2", "e767117d6d9e902bb9f93816c57aae7a35f03a6d9279291883cbe7765ca6a9a3")
52 STORE("DOC20", "a0e4bf13696b74af7e20b8b2995927f447f346896130f5f26c7cc73acc655fb7")
53 STORE("DOC21", "da07379b98edb50156cff93aaea8941c375ea4aa5ff1f6bbebdf66b70e02a3ba")
54 STORE("DOC22", "82b39ee31027e54fa6e9723bcce3af5f4cab379104bef6f0ac3d7f8ce755ba8e")
55 STORE("DOC23", "f56c1f9f2c18c765eeff0a3145e536d8359c3adee1987ca9d5d289243c333aba")
56 STORE("DOC24", "9a6af61b0e4b55ab1f0715de6c30299a7521ce9726b21f4a47974b91c00a0eb8")
57 STORE("DOC25", "b6b0b002507d32240a4f8dba4d92b95d93934c1c5e5ee01af7e0bf7433bb0db3")
58 STORE("DOC26", "979f22934eca5038ca25e04c55abc55f44321ca6ebb2b6b19566b8bcb0e6e5d8")
59 STORE("DOC27", "c5e12588afda8d6819eb30207c3f7371ac13a0bc5041ec1a73cdb879015ad59d")
60 STORE("DOC28", "c36abdd96e935cc226f7d514c47b6379104105408a01b77b6a78baaa89a550bd")
61 STORE("DOC29", "f0e0ee8e04f9c2023027773b9f49edb03db41fe2a4cdf38078f3c473878209f8")
62 STORE("DOC3", "f856ee6dd15ffb01b002f36294da377810b8f72a42c862dfb12edd6799f3c08c")
63 STORE("DOC30", "f6be337f0f02b3299df56edd9acf157160f63935fecbd618969ca7918725edb6")
64 STORE("DOC31", "be26840cdbad3f6e3ba1df5bab41eea64c0f94f17f2d5b2c11c0a38dcd2abc9e")
65 STORE("DOC32", "835a084b141d9381949904eba0902b8be6d8cfb52c23dc249a172b4b9dc811f8")
66 STORE("DOC33", "b082c1bc0a26e94bd89558b7d0c8182105fcc19c9242ac5bde8fcff4ec175cce")
67 STORE("DOC34", "cb1a0f406f6837c7c83e8e7d0d058bf05cbcfd94d9e509de1128ed096dc508b4")
68 STORE("DOC4", "f6dfdc8a93786217e5be7bf998b2bb9967a12d7bfc18974a6ead5527e135fcfc")
69 STORE("DOC5", "8830ac5ab6181d39dbd6a42a472ca30592a8ba6dbfe78c6b9708a350b58302ee")
70 STORE("DOC6", "a44d1fdc96ebd2d759f5e01dcc930543a78653a53659aa7134737eb5985317a7")
71 STORE("DOC7", "cb0d8562346dce312ed6b46c3551e7e023b0af22a8d2d9a1cfaba56676a9509b")
72 STORE("DOC8", "9325dec7ef3dfe0af9105ffe14aabaf37fc8ac3b6d05c90e66fb7ecc2a5b86c2")
73 STORE("DOC9", "8a039e16eb6a3af1925c2b46e63851676a40093e014d538d662e0565c40cd9af")
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.1.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 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, mods 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()))
70 STORE("mods", mods)
100 RETURN 0
End Function |
SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "Ghost Exchange")
31 STORE("descrHdr", "Phantom powered finance")
32 STORE("iconURLHdr", "https://raw.githubusercontent.com/ThreeDotsTech/ghost-interface/refs/heads/main/assets/SVG/happy-ghost.svg")
33 STORE("dURL", "1.2.0.ghost.trading.tela")
34 STORE("mods", "")
40 STORE("DOC1", "fa1d028f8eca081870d7a750e4798737f588ae490403fa7ff5352156808a4fa1")
41 STORE("DOC10", "f2bae526f17b12eec8c6f1d6e0ec34872af3693d7ad3dbb9e858fa63bed64790")
42 STORE("DOC11", "c935db3e0254fe474c2f26acb731aca282ed673f9c54723e82a39f422ba2d1ff")
43 STORE("DOC12", "a408c6bcf6ade50f603d1324467f3313ef9f99a86d8181e0c7be4b8bb55cacde")
44 STORE("DOC13", "baf97b777999c4863064cad69755bcce334c19c24cb971837c6c2082a3c54596")
45 STORE("DOC14", "bdff162a36db4c4155cdb1787f9320f4c252af2bb1e6dc2742cfb1ee3b30b5a9")
46 STORE("DOC15", "e6987f30944b6954d0ab17ed214cab92e381d66f46960d81f900fa01db29acb9")
47 STORE("DOC16", "e8c0fa4a0bb662c6e4ff9883168d0a40564e3ec7f9de2d78217988eaa53b32cf")
48 STORE("DOC17", "a3068c58159194c4476b722fadf61b357f66246495736f42b315b58489367bd2")
49 STORE("DOC18", "e6f56d0adf93cc3a05f9871e355d6404925260bf075a032b524a49e42ad4f8e6")
50 STORE("DOC19", "9e5fc0a8f1ac01083c5aa4497486e466dc48fe976d70c68af32220853db35bbf")
51 STORE("DOC2", "e767117d6d9e902bb9f93816c57aae7a35f03a6d9279291883cbe7765ca6a9a3")
52 STORE("DOC20", "a0e4bf13696b74af7e20b8b2995927f447f346896130f5f26c7cc73acc655fb7")
53 STORE("DOC21", "da07379b98edb50156cff93aaea8941c375ea4aa5ff1f6bbebdf66b70e02a3ba")
54 STORE("DOC22", "82b39ee31027e54fa6e9723bcce3af5f4cab379104bef6f0ac3d7f8ce755ba8e")
55 STORE("DOC23", "f56c1f9f2c18c765eeff0a3145e536d8359c3adee1987ca9d5d289243c333aba")
56 STORE("DOC24", "9a6af61b0e4b55ab1f0715de6c30299a7521ce9726b21f4a47974b91c00a0eb8")
57 STORE("DOC25", "b6b0b002507d32240a4f8dba4d92b95d93934c1c5e5ee01af7e0bf7433bb0db3")
58 STORE("DOC26", "979f22934eca5038ca25e04c55abc55f44321ca6ebb2b6b19566b8bcb0e6e5d8")
59 STORE("DOC27", "c5e12588afda8d6819eb30207c3f7371ac13a0bc5041ec1a73cdb879015ad59d")
60 STORE("DOC28", "c36abdd96e935cc226f7d514c47b6379104105408a01b77b6a78baaa89a550bd")
61 STORE("DOC29", "f0e0ee8e04f9c2023027773b9f49edb03db41fe2a4cdf38078f3c473878209f8")
62 STORE("DOC3", "f856ee6dd15ffb01b002f36294da377810b8f72a42c862dfb12edd6799f3c08c")
63 STORE("DOC30", "f6be337f0f02b3299df56edd9acf157160f63935fecbd618969ca7918725edb6")
64 STORE("DOC31", "be26840cdbad3f6e3ba1df5bab41eea64c0f94f17f2d5b2c11c0a38dcd2abc9e")
65 STORE("DOC32", "835a084b141d9381949904eba0902b8be6d8cfb52c23dc249a172b4b9dc811f8")
66 STORE("DOC33", "b082c1bc0a26e94bd89558b7d0c8182105fcc19c9242ac5bde8fcff4ec175cce")
67 STORE("DOC34", "cb1a0f406f6837c7c83e8e7d0d058bf05cbcfd94d9e509de1128ed096dc508b4")
68 STORE("DOC4", "f6dfdc8a93786217e5be7bf998b2bb9967a12d7bfc18974a6ead5527e135fcfc")
69 STORE("DOC5", "8830ac5ab6181d39dbd6a42a472ca30592a8ba6dbfe78c6b9708a350b58302ee")
70 STORE("DOC6", "a44d1fdc96ebd2d759f5e01dcc930543a78653a53659aa7134737eb5985317a7")
71 STORE("DOC7", "cb0d8562346dce312ed6b46c3551e7e023b0af22a8d2d9a1cfaba56676a9509b")
72 STORE("DOC8", "9325dec7ef3dfe0af9105ffe14aabaf37fc8ac3b6d05c90e66fb7ecc2a5b86c2")
73 STORE("DOC9", "8a039e16eb6a3af1925c2b46e63851676a40093e014d538d662e0565c40cd9af")
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.1.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 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, mods 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()))
70 STORE("mods", mods)
100 RETURN 0
End Function'] |