-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecurityguard.html
More file actions
91 lines (72 loc) · 3.03 KB
/
securityguard.html
File metadata and controls
91 lines (72 loc) · 3.03 KB
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
<html>
<head>
<title>SecurityGuard</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="stylesheet" href="https://cdn.rawgit.com/Chalarangelo/mini.css/v3.0.0/dist/mini-default.min.css">
<script src="https://momentjs.com/downloads/moment.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
// MetaMask injects the web3 library for us.
window.onload = function() {
if (typeof web3 === 'undefined') {
document.getElementById('meta-mask-required').innerHTML = 'You need <a href="https://metamask.io/">MetaMask</a> browser plugin to run this example'
}
setWedContAddr();
}
// function to send the transaction on button press
function send() {
web3.eth.sendTransaction({
from: web3.eth.coinbase,
to: smartWedContAddr,
value: web3.toWei(document.getElementById("amount").value, 'ether')
}, function(error, result) {
if (!error) {
document.getElementById('response').innerHTML = 'Success: <a href="https://etherscan.io/tx/' + result + '"> View Transaction </a>'
} else {
document.getElementById('response').innerHTML = '<pre>' + error + '</pre>'
}
})
}
function sendCheckIn() {
var contractAddress = "0x30f938fed5de6e06a9a7cd2ac3517131c317b1e7"
var checkInData = "0x183ff085"
web3.eth.sendTransaction({
to: contractAddress,
data: checkInData
},
function(error, result) {
if (!error) {
document.getElementById('response').innerHTML = 'Success: <a href="https://etherscan.io/tx/' + result + '"> View Transaction </a>'
} else {
document.getElementById('response').innerHTML = '<pre>' + error + '</pre>'
}
});
}
</script>
</head>
<!-- <body onload="bodyOnLoad()"> -->
<body>
<header>
<img src="securityguard.png" height="40" width="40" align="top">
<a href="#" class="logo">SecurityGuard</a>
</header>
<!-- guestbook form Section -->
<div id="meta-mask-required">
<div class="card">
<h3>Security Guard Commands:</h3>
<br>
<a href="#" class="button" onclick="sendCheckIn()">Check In Now</a>
</div>
<div id="response"></div>
<br>
<br>
<br>
</div>
<!-- instructions Section -->
<footer>
<p>SecurityGuard is a <a href="https://giveth.io" target="new">Giveth</a> Security Project, Interface by <a href="https://github.com/bowensanders/" target="new">Bowen Sanders</a>.<br>Theme based on <strong>mini.css</strong>, a free CSS template found at <a href="https://minicss.org/docs" rel="nofollow">minicss.org</a>.</p>
</footer>
</body>
</html>