-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (37 loc) · 960 Bytes
/
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
<!doctype>
<html>
<head>
<script type='text/javascript'>
function get() {
var res = web3.eth.getBalance(web3.eth.accounts[1]);
document.getElementById('balance').innerText = res;
}
function run(winningBet) {
web3.eth.defaultAccount = web3.eth.accounts[3];
var res = contracts['SuperOracle'].contract.run(winningBet);
}
function makeBet(bet) {
web3.eth.defaultAccount = web3.eth.accounts[1];
var res = contracts['SuperOracle'].contract.makeBet(bet, {value: 10});
}
</script>
</head>
<body bgcolor='#E6E6FA'>
<h3>Sample Ratings</h3>
<div>
Run oracle
<button onclick='run(true)'>True</button>
<button onclick='run(false)'>False</button>
</div>
<div>
Make bet:
<input value='True' type='button' id='query' onclick='makeBet(true)' />
<input value='False' type='button' id='query' onclick='makeBet(false)' />
<div id='queryres'></div>
</div>
<div>
<button onclick='get()'>Get balance</button>
<span id="balance"></span>
</div>
</body>
</html>