WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 5ae215d

Browse files
committed
feat: Add the scanner page
1 parent 90ce95d commit 5ae215d

File tree

4 files changed

+161
-1
lines changed

4 files changed

+161
-1
lines changed

docusaurus.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ const config: Config = {
102102
label: 'Misti',
103103
to: '/tools/misti',
104104
},
105+
{
106+
label: 'Scanner',
107+
to: '/tools/scanner',
108+
},
105109
],
106110
},
107111
{

src/pages/index.tsx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ const HomePage: React.FC = () => {
294294
marginRight: '0.5em'
295295
}}
296296
/>
297-
Misti - TON Static Analyzer
297+
Misti
298298
</h3>
299299
<p>
300300
Static analyzer that finds security vulnerabilities, TON-specific pitfalls,
@@ -304,6 +304,33 @@ const HomePage: React.FC = () => {
304304
</p>
305305
</div>
306306
</div>
307+
<div className="row" style={{ marginTop: '0rem' }}>
308+
<div className="col col--12">
309+
<h3>
310+
<img
311+
src="/img/scan.svg"
312+
alt="Scanner"
313+
style={{
314+
height: '1em',
315+
verticalAlign: 'middle',
316+
marginRight: '0.5em'
317+
}}
318+
/>
319+
Scanner
320+
</h3>
321+
<p>
322+
Web-interface to the demo version of mass-scan that runs code analysis over contracts publicly available on{' '}
323+
<a href="https://verifier.ton.org" target="_blank" rel="noopener noreferrer" className={styles.inlineLink}>
324+
verifier.ton.org
325+
</a> and{' '}
326+
<a href="https://github.com" target="_blank" rel="noopener noreferrer" className={styles.inlineLink}>
327+
GitHub
328+
</a>. Only a couple of these contracts are displayed - manually verified projects that
329+
don't contain any vulnerabilities. <a href="/tools/scanner" className={styles.inlineLink}>
330+
Try the scanner...</a>
331+
</p>
332+
</div>
333+
</div>
307334
</section>
308335
</div>
309336
</div>

src/pages/tools/scanner.tsx

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import React, { useState } from 'react';
2+
import Layout from '@theme/Layout';
3+
import Head from '@docusaurus/Head';
4+
5+
const ScannerPage: React.FC = () => {
6+
const [isLoading, setIsLoading] = useState(true);
7+
8+
const loadingMessages = [
9+
"we're running this on a Raspberry Pi in someone's basement",
10+
"our infrastructure budget is approximately $3.50",
11+
"running on hopes, dreams, and a single DigitalOcean droplet",
12+
"our server is literally a toaster with WiFi",
13+
"our datacenter is just a laptop under someone's desk",
14+
"hosted on a refurbished calculator from the 90s",
15+
"powered by the collective sighs of our unpaid developers"
16+
];
17+
18+
const randomMessage = loadingMessages[Math.floor(Math.random() * loadingMessages.length)];
19+
20+
return (
21+
<Layout>
22+
<Head>
23+
<title>Scanner - TON Security</title>
24+
<meta name="description" content="TON Smart Contract Scanner" />
25+
</Head>
26+
<div style={{
27+
padding: 0,
28+
margin: 0,
29+
height: 'calc(100vh - 60px)', // Account for navbar height
30+
width: '100%',
31+
position: 'relative'
32+
}}>
33+
{isLoading && (
34+
<div style={{
35+
position: 'absolute',
36+
top: 0,
37+
left: 0,
38+
right: 0,
39+
bottom: 0,
40+
display: 'flex',
41+
alignItems: 'center',
42+
justifyContent: 'center',
43+
backgroundColor: 'var(--ifm-background-color)',
44+
zIndex: 10
45+
}}>
46+
<div style={{
47+
textAlign: 'center',
48+
color: 'var(--ifm-color-emphasis-700)'
49+
}}>
50+
<div style={{
51+
width: '40px',
52+
height: '40px',
53+
border: '4px solid var(--ifm-color-emphasis-300)',
54+
borderTop: '4px solid var(--ifm-color-primary)',
55+
borderRadius: '50%',
56+
animation: 'spin 1s linear infinite',
57+
margin: '0 auto 20px auto'
58+
}} />
59+
<div style={{ fontSize: '1.2rem' }}>
60+
Loading scanner...
61+
</div>
62+
<div style={{ fontSize: '0.9rem', marginTop: '8px' }}>
63+
Keep patience: {randomMessage}
64+
</div>
65+
<style>{`
66+
@keyframes spin {
67+
0% { transform: rotate(0deg); }
68+
100% { transform: rotate(360deg); }
69+
}
70+
`}</style>
71+
</div>
72+
</div>
73+
)}
74+
<iframe
75+
src="https://scan.nowarp.io"
76+
style={{
77+
width: '100%',
78+
height: '100%',
79+
border: 'none'
80+
}}
81+
title="TON Contract Scanner"
82+
allow="clipboard-read; clipboard-write"
83+
onLoad={() => setIsLoading(false)}
84+
/>
85+
</div>
86+
</Layout>
87+
);
88+
};
89+
90+
export default ScannerPage;

static/img/scan.svg

Lines changed: 39 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)