Skip to content

Commit fa2d09d

Browse files
committed
cleanup
1 parent 580661c commit fa2d09d

File tree

2 files changed

+57
-4
lines changed

2 files changed

+57
-4
lines changed

amisforum/live/conference/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ var ticketIsValid = true;
5858

5959

6060
setInterval(function() {
61-
total = quota - numRegistrants;
6261
setSafeLowGasPrice();
6362
}, 1000);
6463

amisforum/live/conference/conference.js

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,60 @@
1-
contract('Conference', function(accounts) {
2-
console.log(accounts);
3-
var owner_account = accounts;
1+
metamaskIsInstalled();
2+
3+
console.log(web3.isConnected());
4+
5+
abi = JSON.parse('[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"registrantsPaid","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"organizer","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"}],"name":"refundTicket","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newquota","type":"uint256"}],"name":"changeQuota","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"quota","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numRegistrants","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"buyTicket","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_to","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Refund","type":"event"}]');
6+
var Conference = web3.eth.contract(abi);
7+
var contractAddress = '0x7fe180e63198e50057c3f2817d058e8904c650e3';
8+
var contractInstance = Conference.at(contractAddress);
9+
10+
var etherscanTxUrl = "https://etherscan.io/tx/0x57d9096861063b468194362d08cf7bffca656ea62db3c4cdaa558c124f2311db";
11+
var etherscanUrl = "https://etherscan.io/address/0x7fe180e63198e50057c3f2817d058e8904c650e3#code";
12+
13+
14+
web3.version.getNetwork((err, netId) => {
15+
switch (netId) {
16+
case "1":
17+
$('#network').text("");
18+
contractAddress = '0x7fe180e63198e50057c3f2817d058e8904c650e3';
19+
break;
20+
case "2":
21+
alert('This is the deprecated Morden test network.');
22+
break;
23+
case "3":
24+
$('#network').text("ROPSTEN TEST NETWORK");
25+
contractAddress = '0xec4e3a1ad06a2ebdc462eaf6bf361404676a441f';
26+
contractInstance = Conference.at(contractAddress);
27+
etherscanTxUrl = "https://ropsten.etherscan.io/tx/0x88799ff0c66cb9e95df05f968c3a8bce86bd50c1774ba29d6eadea7138f5fa79";
28+
etherscanUrl = "https://ropsten.etherscan.io/address/0xec4e3a1ad06a2ebdc462eaf6bf361404676a441f#code";
29+
break;
30+
case "4":
31+
$('#network').text("RINKEBY TEST NETWORK");
32+
alert('This contract does not exist on the Rinkeby test network. Please switch to the Main or Ropsten network')
33+
break;
34+
case "42":
35+
$('#network').text("KOVAN TEST NETWORK");
36+
contractAddress = '0x6328426be01834de85ec0c10e3e940e629290bb1';
37+
contractInstance = Conference.at(contractAddress);
38+
etherscanTxUrl = "https://kovan.etherscan.io/tx/";
39+
etherscanUrl = "https://kovan.etherscan.io/address/#code";
40+
//TODO ADD contractAddress = kovan address
41+
https://kovan.etherscan.io/address/0x6328426be01834de85ec0c10e3e940e629290bb1
42+
break;
43+
default:
44+
$('#network').text("NETWORK: UNKNOWN");
45+
//TODO ADD contractAddress = undefined
46+
}
47+
})
48+
49+
var ticket_abi = ticket_abi = JSON.parse('[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"registrantsPaid","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"organizer","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"recipient","type":"address"},{"name":"amount","type":"uint256"}],"name":"refundTicket","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"destroy","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"newquota","type":"uint256"}],"name":"changeQuota","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"quota","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"numRegistrants","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"buyTicket","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_to","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"Refund","type":"event"}]');
50+
var ticket = web3.eth.contract(ticket_abi);
51+
52+
53+
54+
55+
// contract('Conference', function(accounts) {
56+
// console.log(accounts);
57+
// var owner_account = accounts;
458
// var sender_account = accounts[1];
559

660

0 commit comments

Comments
 (0)