-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (46 loc) · 1.95 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Debugger for NEAR Protocol Contracts</title>
<meta name="description" content="A web-based tool for debugging contracts written for NEAR Protocol">
<script async type="module" src="./loader.js"></script>
<link rel="stylesheet" type="text/css" href="./neardebug.css">
</head>
<body>
<header>
<h2>
A basic debugger for NEAR Contracts (prototype ver.)
</h2>
<p>
Here you can execute and debug – inside your browser – contracts meant to run on the NEAR
protocol. Use the browser built-in developer tools (often available via
<kbd>Ctrl</kbd>/<kbd>Cmd</kbd> <kbd>Shift</kbd><kbd>I</kbd>): log messages and errors will show
up in the console and you can use the debugger to step through the contract code.
</p>
<p>
The debugging experience will differ between browsers. For instance Chromium supports DWARF
debug info. Contracts built from Rust source will embed such debug info into the
<code>.wasm</code> file, as long as debug info is enabled. This would then allow
debugging Rust code and not the underlying WebAssembly!
</p>
<p>
<code>window.contract</code> in the console will allow you to explore some specifics of the
contract runtime throughout the execution of the contract.
</p>
</header>
<form id="contract_form">
<label for="contract">Contract WASM </label>
<input type="file" name="contract" id="contract" />
<label for="methods">Method </label>
<select id="methods" name="method"></select>
<input type="submit" id="execute" value="Execute!" disabled />
<h3>Context</h3>
<label for="attached_deposit"> Attached Deposit (u128)</label>
<input type="text" name="attached_deposit" id="attached_deposit" placeholder="0" />
<label for="input"> Input (bytes)</label>
<textarea id="input" name="input" placeholder="">{}</textarea>
<h3>State</h3>
</form>
</body>
</html>