SC CODE: Function InitializePrivate() Uint64
10 IF init() == 0 THEN GOTO 30
20 RETURN 1
30 STORE("nameHdr", "index.html")
31 STORE("descrHdr", "Moco's blog html!")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "blog.moco.tela")
34 STORE("docType", "TELA-HTML-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "5d4c24ad0e05849ac97ebbb77e10b5da6bbd67902112ac808245ac2f9d009fe")
37 STORE("fileCheckS", "1ea1a84048322b70db14e0d9e77d9c47c3ce6d6d06346dad19231ba8b13e30e2")
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
/*
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>✍️</text></svg>">
<title>Moco's Blog</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="background-gradient"></div>
<header>
<h1>Welcome to my decentralized Blog!</h1>
<nav>
<ul>
<li><a href="#about">About</a></li>
<li><a href="#posts">Posts</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section id="about" class="content-block">
<h2>About Me</h2>
<p>
Welcome to my blog, where I dive deep into the decentralized future. I'm Marco, a
dev sticking his nose in the endless possibilities of blockchain technology.
</p>
</section>
<section id="posts" class="content-block">
<h2>Latest (and probably only) post<strike>s</strike></h2>
<article class="post-card">
<h3>Launching My First Decentralized Webpage on Tela - 25/08/24</h3>
<p>
Today has been a good one. It's 1:47 a.m. as I'm writing this, and I was
about to go to sleep when, 18 minutes past midnight, the irresponsible team
at Civilware released one of the most groundbreaking pieces of tech I've had the pleasure
to witness come to life.
</p>
<p>
Earlier today—yesterday (?)—, The Foundation guys presented a demo, and I haven't
been able to think about anything else. I'll be playing with this until I
manage to deploy this webpage, and if you are reading this, it means that I, eventually,
succeeded.
</p>
<p>
Sadly, this will most likely be the first and last entry of this blog because I haven't
figured out yet how to make updatable websites using Tela; this is a 2-hour-old technology,
after all. It will probably involve reading from an updatable smart contract, but I'll leave
it to the smart guys from the future to figure that out.
</p>
<p>
Today's insomnia is sponsored by the chads at Civilware, but I'd say this will all be worth it.
</p>
<p>
Moco
</p>
</article>
</section>
<section id="contact" class="content-block">
<h2>Let's Connect</h2>
<p>Reach out to me at my Dero ID <code>@marco</code></p>
</section>
</main>
<footer>
<p> Powered by TELA and DERO.</p>
</footer>
</body>
</html>
*/ |
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", "index.html")
31 STORE("descrHdr", "Moco's blog html!")
32 STORE("iconURLHdr", "")
33 STORE("dURL", "blog.moco.tela")
34 STORE("docType", "TELA-HTML-1")
35 STORE("subDir", "")
36 STORE("fileCheckC", "5d4c24ad0e05849ac97ebbb77e10b5da6bbd67902112ac808245ac2f9d009fe")
37 STORE("fileCheckS", "1ea1a84048322b70db14e0d9e77d9c47c3ce6d6d06346dad19231ba8b13e30e2")
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
/*
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>✍️</text></svg>">
<title>Moco's Blog</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="background-gradient"></div>
<header>
<h1>Welcome to my decentralized Blog!</h1>
<nav>
<ul>
<li><a href="#about">About</a></li>
<li><a href="#posts">Posts</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</header>
<main>
<section id="about" class="content-block">
<h2>About Me</h2>
<p>
Welcome to my blog, where I dive deep into the decentralized future. I'm Marco, a
dev sticking his nose in the endless possibilities of blockchain technology.
</p>
</section>
<section id="posts" class="content-block">
<h2>Latest (and probably only) post<strike>s</strike></h2>
<article class="post-card">
<h3>Launching My First Decentralized Webpage on Tela - 25/08/24</h3>
<p>
Today has been a good one. It's 1:47 a.m. as I'm writing this, and I was
about to go to sleep when, 18 minutes past midnight, the irresponsible team
at Civilware released one of the most groundbreaking pieces of tech I've had the pleasure
to witness come to life.
</p>
<p>
Earlier today—yesterday (?)—, The Foundation guys presented a demo, and I haven't
been able to think about anything else. I'll be playing with this until I
manage to deploy this webpage, and if you are reading this, it means that I, eventually,
succeeded.
</p>
<p>
Sadly, this will most likely be the first and last entry of this blog because I haven't
figured out yet how to make updatable websites using Tela; this is a 2-hour-old technology,
after all. It will probably involve reading from an updatable smart contract, but I'll leave
it to the smart guys from the future to figure that out.
</p>
<p>
Today's insomnia is sponsored by the chads at Civilware, but I'd say this will all be worth it.
</p>
<p>
Moco
</p>
</article>
</section>
<section id="contact" class="content-block">
<h2>Let's Connect</h2>
<p>Reach out to me at my Dero ID <code>@marco</code></p>
</section>
</main>
<footer>
<p> Powered by TELA and DERO.</p>
</footer>
</body>
</html>
*/'] |