-
Notifications
You must be signed in to change notification settings - Fork 2
/
1_1617978951862.html
65 lines (57 loc) · 1.43 KB
/
1_1617978951862.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>1</title>
<style type="text/css">
button {
background-color: #000;
color: #fff;
border: 0;
font-size: 1em;
}
</style>
</head>
<body>
<button id="s">Set Data</button>
<button id="g">Get Data</button>
<script type="text/javascript">
window.BuidlProviders = {
web3: {
url: "https://rpc.oasiseth.org:8545",
chainId: "69",
gasPrice: "1",
gasLimit: "8000000",
},
es: {
url: "https://devchain.ss.search.secondstate.io"
}
}
</script>
<script type="text/javascript" src="https://buidl.secondstate.io/embed/main.js"></script>
<script type="text/javascript">
/* Don't modify */
var abi = [];
var bytecode = '';
var cAddr = '';
/* Don't modify */
var instance = null;
window.addEventListener('web3Ready', function() {
var contract = web3.ss.contract(abi);
instance = contract.at(cAddr);
});
document.querySelector("#s").addEventListener("click", function() {
var n = window.prompt("Enter the number:");
n && instance.set(n);
});
document.querySelector("#g").addEventListener("click", function() {
instance.get(function(e,d) {
console.log(d.toString());
alert(d.toString());
});
});
</script>
</body>
</html>