-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
425 lines (350 loc) · 16.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>savedby Kadena</title>
<link rel="stylesheet" href="styles.css">
<meta name="description" content="Build safe and scalable dapps with Pact">
<meta property="og:title" content="savedbyKadena">
<meta property="og:description" content="Build safe and scalable dapps on Kadena with Pact">
<meta property="og:image" content="https://i.imgur.com/1pVHcuw.jpg">
<meta property="og:locale" content="en_GB">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
<meta property="og:url" content="https://savedby.kadena.network">
<link rel="icon" href="favicon.ico">
<!-- <link rel="apple-touch-icon" href="/apple-touch-icon.png"> -->
<!-- <link rel="manifest" href="/my.webmanifest"> -->
<meta name="theme-color" content="#000">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-RXH8NBKZ4R"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-RXH8NBKZ4R');
</script>
</head>
<body>
<nav>
<span class="darkText">savedby<span
style="font-weight: bolder; color: white; font-size: 1.2rem;">Kadena</span></span>
<a class="infoButton" onclick="display_infoKadena()">What is Kadena?</a>
<a class="infoButton" onclick="display_infoPact()">What is Pact?</a>
<a class="infoButton" onclick="display_link()">Links
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>
</a>
<span id="menuDiv" class="headlinkContainer" style="display: none;">
<a class="headlinkSite" href="https://github.com/kadena-io/pact">
<div>Pact GitHub</div>
<img src="img/github_icon.svg" alt=""></img>
</a>
<a class="headlinkSite" href="https://pactlang.org/beginner/welcome-to-pact/">
<div>Pact Quickstart</div>
<img src="img/github_icon.svg" alt=""></img>
</a>
<a class="headlinkSite" href="https://discord.io/kadena">
<div>Kadena Discord</div>
<img src="img/discord_icon.svg" alt=""></img>
</a>
<a class="headlinkSite" href="https://github.com/kadena-community/saved-by-kadena">
<div>Contribute to this site</div>
<img src="img/github_icon.svg" alt=""></img>
</a>
</span>
</nav>
<div class="panel" id="infoKadena">
<h1>What is Kadena?</h1>
<br>
<span>
Kadena is a smart contract Layer1 much like Ethereum, with the difference that it's the only chain capable of handling all the world's needs while staying scalable, secure and decentralized.
<br><br>
Other blockchains like Solana, ETH2, Avax, etc. try to scale using new consensus models like Proof of Stake (PoS) or by integrating the protocol with off-chain networks and processes (payment channels, side chains). The problem with those approaches is that they degrade the assurance, censorship resistance, and trustless nature of the original PoW design. Traditional Proof of Work (PoW) as demonstrated in the Bitcoin network is a masterstroke of design and the only way to create a truly trustless public network. See PoS has several problems, the biggest are that it's a pay-to-play reputation engine which favors the richest stakers, because staking and PoS is very good for large VCs that want to control what supposed to be a decentralized system. The others being that there is no way to make decentralized state sharding work, something which is needed if you want to scale way past 500k tp/s <br><br>
But don't forget about Pact, the contract language that runs on top off Kadena's stack. It's an unparalleled advancement in safety and security, and is likely the only tech that can move DeFi beyond the products it's developed so far. By allowing smart contracts to really interact with one another on an L1 network that scales, something previously thought impossible we are finally reaching the true potential of cryptocurrencies. The inherent flaws of EVM/Solidity have been exposed through exploits which Pacts security features make impossible and because the code is so easily readable it can be verified by legal departments who aren't programmers.
</span>
</div>
<div class="panel" id="infoPact">
<h1>What is Pact?</h1>
<br>
<span>
Pact is a human-readable smart contract language which was designed from the ground up specifically for the needs of decentralized finance.
<br><br>
It's so easy to read and write that a technical lawyer can reliably program his smart contracts with a little practice just like he could learn to manipulate data in Excel, formal verification which is invaluable when you are dealing with critical systems i.e. those that handle a lot of money or play a key part in infrastructure, Turing incomplete (prohibits recursive function calls, unbounded looping and variable reassignment which eliminates the potential for exploits that have ravaged EVM languages by design), upgradeable contracts whereas Solidity contracts are final and require proxy contracts etc. It's a next gen smart contract language that improves upon Solidity much like Chainweb is a next gen blockchain that improves upon its POW predecessors.
<br><br>
Pact smart contracts can be autonomous/non-upgradable if the devs choose. Remember btw that every major smart contract on ethereum now uses a proxy to rug pull at will. In the end you have to DYOR which means checking contract governance. Autonomous is great, until a bug or hack steals all your coins. Upgradeable is great but you should understand that governance before you buy in. There's no free lunch. With Pact you can always check the governance code yourself - and you should.
<br><br>
Not only is it an unparalleled advancement in safety and security, it's likely the only tech that can move DeFi beyond the products it's developed so far.
</span>
</div>
<div class="headline">
<span class="bigText"><span id="goodCount"></span> out of <span id="totalCount"></span> projects <a target="_blank" href="https://rekt.news/">REKT</a> in the last <span id="timeDelta"></span>.
<br>
<span id="finalAmountDisplay" class="bigText2"></span>
<br>
could have been saved by <a target="_blank" href="https://www.kadena.io/">Kadena</a>.</span>
<span class="bigText1 darkText ">Ask your favorite DeFi project why they're not building on Kadena.</span>
<a href="#projects">
View Projects
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-arrow-down-right">
<line x1="7" y1="7" x2="17" y2="17"></line>
<polyline points="17 7 17 17 7 17"></polyline>
</svg>
</a>
</div>
<table id="projects">
<tr class="tableHeader">
<th class="columnheader">Project</th>
<th class="columnheader">REKT Date</th>
<th class="columnheader">Amount Lost</th>
<th class="columnheader">Analysis</th>
<th class="columnheader remedycol">
<div class="remedy">
Remedy (hover for more info)
</div>
</th>
</tr>
<tbody id="projectTable">
</tbody>
</table>
<h4 class="legendHeadline">Confidence Legend</h4>
<div class="tagExplainerHolder">
<span class="tagExplainer definite">Definite</span>
<span class="darkText">Green represents a remedy that definitely would have prevented the hack with no special
thought or actions required by the developer.</span>
<span class="tagExplainer probable">Probable</span>
<span class="darkText">Yellow represents a remedy that would have very likely prevented the
hack, but does require the use of good coding practices by the
developer..</span>
</div>
<footer>
<div class="alignText">
<img src="img/github_icon.svg" alt=""></img>
<a href="https://github.com/kadena-io/pact">Pact GitHub</a>
</div>
<div class="alignText">
<img src="img/github_icon.svg" alt=""></img>
<a href="https://pactlang.org/beginner/welcome-to-pact/">Pact Quickstart</a>
</div>
<div class="alignText">
<img src="img/discord_icon.svg" alt=""></img>
<a href="https://discord.io/kadena">Kadena Discord</a>
</div>
</footer>
</body>
<script>
var rektList = [];
var finalAmount = 0;
$.ajax({
method: 'GET',
url: 'rekt.json',
success: function (rektList) {
buildTable(rektList)
}
})
const pactDesc = "The Pact language by itself with no special coding practices would have prevented this project from getting rekt.";
const fvDesc = "Formal Verification in Pact would not only uncover scenarios that would leave this project rekt, it also allows auditors to authoritatively prove that said scenarios are covered in any project.";
const spowDesc = "When gas prices are high because of lack of scalability, developers will write less safe code just to decrease transaction fees.";
const chainweaverDesc = "When you put private key material in a place where anyone in the world can see them, no amount of tech can save you.";
function timeSpan(start, end) {
const millis = 1000;
const minutes = 60 * millis;
const hours = 60 * minutes;
const days = 24 * hours;
const weeks = 7 * days;
const months = 30 * days;
const years = 365 * days;
var amount = null;
var units = "";
const delta = end - start;
if ( delta < 2 * months ) {
amount = Math.round(delta / weeks);
units = "weeks";
} else if ( delta < 2 * years ) {
amount = Math.round(delta / months);
units = "months";
} else {
amount = Math.round(delta / years);
units = "years";
}
return amount + " " + units;
}
function buildTable(data) {
var goodCount = 0;
var now = new Date();
var oldest = now;
for (let i = 0; i < data.length; i++) {
if (data[i].remedies) goodCount++;
var d = Date.parse(data[i].date);
if ( d < oldest ) {
oldest = d;
}
}
var good = document.getElementById('goodCount')
good.appendChild(document.createTextNode(goodCount));
var total = document.getElementById('totalCount')
total.appendChild(document.createTextNode(data.length));
var timeStr = timeSpan(oldest, now);
var timeDelta = document.getElementById('timeDelta')
timeDelta.appendChild(document.createTextNode(timeStr));
var table = document.getElementById('projectTable')
for (let i = 0; i < data.length; i++) {
if (!data[i].remedies) { continue; }
const row = document.createElement("tr");
const nameCell = document.createElement("td");
const nameImage = document.createElement("img");
nameImage.src = `img/projects/${data[i].name}.svg`;
const nameValue = document.createTextNode(data[i].name);
const nameLink = document.createElement("a");
nameLink.target = '_blank';
nameLink.href = 'https://rekt.news' + data[i].url;
nameCell.appendChild(nameLink);
nameLink.appendChild(nameImage);
nameLink.appendChild(nameValue);
const dateCell = document.createElement("td");
const dateValue = document.createTextNode(data[i].date);
dateCell.append(dateValue);
const amountCell = document.createElement("td");
const amountValue = document.createTextNode(`$ ${data[i].amount.toLocaleString("en-US")}`);
finalAmount = finalAmount + data[i].amount;
amountCell.appendChild(amountValue);
const remedieAmounts = Array.isArray(data[i].remedies) ? data[i].remedies : [data[i].remedies];
const remediesCell = document.createElement("td");
for (const remediesArr of remedieAmounts) {
const remediesTag = remediesArr[0];
const remediesSpan = document.createElement("span");
const remediesValue = document.createTextNode(remediesTag);
remediesCell.setAttribute("class", "remedycol");
remediesCell.append(remediesSpan);
const remedyConfidence = remediesArr[1];
if ( remedyConfidence == 'Definite' ) {
remediesSpan.setAttribute('class', 'definite');
} else if ( remedyConfidence == 'Probable' ) {
remediesSpan.setAttribute('class', 'probable');
}
remediesSpan.append(remediesValue);
if (remediesTag == "Pact")
var remediedDesc = remediesSpan.setAttribute("title", pactDesc);
else if (remediesTag == "FV")
var remediedDesc = remediesSpan.setAttribute("title", fvDesc);
else if (remediesTag == "ScalablePOW")
var remediedDesc = remediesSpan.setAttribute("title", spowDesc);
else if (remediesTag == "Chainweaver")
var remediedDesc = remediesSpan.setAttribute("title", chainweaverDesc);
}
const analysisCell = document.createElement("td");
if ( data[i].analysis ) {
for ( let j = 0; j < data[i].analysis.length; j++ ) {
const analysisLink = document.createElement("a");
analysisLink.href = data[i].analysis;
analysisLink.target = "_blank";
analysisLink.append(document.createTextNode(j+1));
if ( j > 0 ) analysisCell.append(document.createTextNode(' '));
analysisCell.append(analysisLink);
}
}
row.appendChild(nameCell)
row.appendChild(dateCell);
row.appendChild(amountCell)
row.appendChild(analysisCell);
row.appendChild(remediesCell);
table.appendChild(row);
}
document.getElementById("finalAmountDisplay").innerHTML = "$" + finalAmount.toLocaleString("en-US");
}
</script>
<script>
function display_infoKadena() {
var panel = document.getElementById("infoKadena");
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
panel.style.padding = "0 10vw 0 10vw";
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
panel.style.padding = "2rem 10vw 2rem 10vw";
}
}
function display_infoPact() {
var panel = document.getElementById("infoPact");
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
panel.style.padding = "0 10vw 0 10vw";
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
panel.style.padding = "2rem 10vw 2rem 10vw";
}
}
function display_link() {
var menuD = document.getElementById("menuDiv");
if (menuD.style.display === "none") {
menuD.style.display = "block";
} else {
menuD.style.display = "none";
}
}
var mouse_is_inside = false;
$(document).ready(function()
{
$('.infoButton').hover(function(){
mouse_is_inside=true;
}, function(){
mouse_is_inside=false;
});
$("body").mouseup(function(){
if(! mouse_is_inside) $('.headlinkContainer').hide();
});
});
(function() {
"use strict";
var tooltipDelay = 500;
var timer = null;
document.body.addEventListener("mouseout", function() {
window.clearTimeout(timer);
});
document.body.addEventListener("mousemove", function(e) {
var el = e.target;
if (el != document.body && (el.hasAttribute("title") || el.hasAttribute("data-styletip"))) {
if (el.title) {
el["tt-title"] = el.title;
el["tt-show"] = function(pos) {
var tip = document.createElement("div");
tip.classList.add("style-tip");
if (el.hasAttribute("data-styletip-class")) {
tip.classList.add(el.getAttribute("data-styletip-class"));
}
tip.innerText = el["tt-title"];
tip.style.zIndex = 9e9;
tip.style.pointerEvents = "none";
tip.style.position = "absolute";
tip.style.left = "70%";
tip.style.top = pos.y + "px";
tip.style.margin = "1rem 3rem";
document.body.appendChild(tip);
el["tt-tip"] = tip;
this.addEventListener("mouseout", el["tt-destroy"]);
};
el["tt-destroy"] = function() {
if (el["tt-tip"]) {
document.body.removeChild(el["tt-tip"]);
delete el["tt-tip"];
}
};
el.removeAttribute("title");
el.setAttribute("data-styletip", true);
}
clearTimeout(timer);
timer = window.setTimeout(function() {
el["tt-destroy"]();
el["tt-show"]({
x: e.pageX,
y: e.pageY
});
}, tooltipDelay);
}
});
})();
</script>
</html>