SC CODE: // Copyright 2024. Civilware. All rights reserved.
// TELA Decentralized Web Document (TELA-DOC-1)
Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "index.html")
31 STORE("descrHdr", "Index file")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "index.html")
34 STORE("docType", "TELA-HTML-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "442f99f7bc81653a97f037ca1d20a294d1f31fc1aa18944b5b97e199ba7f92")
37 STORE("fileCheckS", "df26467132987b049ed9185c6bdc35e9ec204c8aa01859bcc2d26577de487f8")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 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
/*<html>
<head>
<title>Blasderoids</title>
<style>
html{background:#222}
</style>
</head>
<body>
<svg id="game" viewBox="0 0 800 600" width="800" height="600" style="background:black; display:block; margin:0 auto;">
<defs>
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur stdDeviation="3" result="blur"/>
<feMerge>
<feMergeNode in="blur"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</defs>
<g id="gameScale">
<g id="world">
<g id="ship" fill="none" stroke="white" filter="url(#glow)" stroke-width="2">
<polygon id="shipBody" points="15,0 -10,10 -10,-10" />
<polygon id="shipFlame" fill="orange" opacity="0"></polygon>
</g>
<g id="asteroids"></g>
<g id="bullets"></g>
<g id="particles"></g>
<text id="hudHealth" x="20" y="40" fill="#ddd" font-size="24"></text>
<text id="hudLives" x="20" y="70" fill="#ddd" font-size="24"></text>
<text id="hudLevel" x="20" y="100" fill="#ddd" font-size="24"></text>
<text id="hudGameOver" x="400" y="300" fill="white" font-size="48" text-anchor="middle" filter="url(#glow)"></text>
<text id="hudGameOverExtra" x="400" y="350" fill="white" font-size="36" text-anchor="middle" filter="url(#glow)"></text>
<text id="titleText" x="400" y="300" fill="white" font-size="48" text-anchor="middle" filter="url(#glow)">
PRESS ENTER OR START
</text>
</g>
</g>
</svg>
<script src="game.js"></script>
</body>
</html>*/ |
| SC Arguments: [Name:SC_ACTION Type:uint64 Value:'1' Name:SC_CODE Type:string Value:'// Copyright 2024. Civilware. All rights reserved.
// TELA Decentralized Web Document (TELA-DOC-1)
Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "index.html")
31 STORE("descrHdr", "Index file")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "index.html")
34 STORE("docType", "TELA-HTML-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "442f99f7bc81653a97f037ca1d20a294d1f31fc1aa18944b5b97e199ba7f92")
37 STORE("fileCheckS", "df26467132987b049ed9185c6bdc35e9ec204c8aa01859bcc2d26577de487f8")
100 RETURN 0
End Function
Function init() Uint64
10 IF EXISTS("owner") == 0 THEN GOTO 30
20 RETURN 1
30 STORE("owner", address())
50 STORE("docVersion", "1.0.0")
60 STORE("hash", HEX(TXID()))
70 STORE("likes", 0)
80 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
/*<html>
<head>
<title>Blasderoids</title>
<style>
html{background:#222}
</style>
</head>
<body>
<svg id="game" viewBox="0 0 800 600" width="800" height="600" style="background:black; display:block; margin:0 auto;">
<defs>
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur stdDeviation="3" result="blur"/>
<feMerge>
<feMergeNode in="blur"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</defs>
<g id="gameScale">
<g id="world">
<g id="ship" fill="none" stroke="white" filter="url(#glow)" stroke-width="2">
<polygon id="shipBody" points="15,0 -10,10 -10,-10" />
<polygon id="shipFlame" fill="orange" opacity="0"></polygon>
</g>
<g id="asteroids"></g>
<g id="bullets"></g>
<g id="particles"></g>
<text id="hudHealth" x="20" y="40" fill="#ddd" font-size="24"></text>
<text id="hudLives" x="20" y="70" fill="#ddd" font-size="24"></text>
<text id="hudLevel" x="20" y="100" fill="#ddd" font-size="24"></text>
<text id="hudGameOver" x="400" y="300" fill="white" font-size="48" text-anchor="middle" filter="url(#glow)"></text>
<text id="hudGameOverExtra" x="400" y="350" fill="white" font-size="36" text-anchor="middle" filter="url(#glow)"></text>
<text id="titleText" x="400" y="300" fill="white" font-size="48" text-anchor="middle" filter="url(#glow)">
PRESS ENTER OR START
</text>
</g>
</g>
</svg>
<script src="game.js"></script>
</body>
</html>*/'] |