@@ -85,34 +85,34 @@ function initializeConference() {
85
85
Conference ( { from : accounts , gas : 3141592 } ) . then (
86
86
function ( conf ) {
87
87
console . log ( conf ) ;
88
- contractInstance = conf ;
89
- $ ( "#confAddress" ) . html ( contractInstance . address ) ;
88
+ Conference = conf ;
89
+ $ ( "#confAddress" ) . html ( Conference . address ) ;
90
90
checkValues ( ) ;
91
91
} ) ;
92
92
}
93
93
94
94
// Check Values
95
95
function checkValues ( ) {
96
- contractInstance . quota . call ( ) . then (
96
+ Conference . quota . call ( ) . then (
97
97
function ( quota ) {
98
98
$ ( "input#confQuota" ) . val ( quota ) ;
99
- return contractInstance . organizer . call ( ) ;
99
+ return Conference . organizer . call ( ) ;
100
100
} ) . then (
101
101
function ( organizer ) {
102
102
$ ( "input#confOrganizer" ) . val ( organizer ) ;
103
- return contractInstance . numRegistrants . call ( ) ;
103
+ return Conference . numRegistrants . call ( ) ;
104
104
} ) . then (
105
105
function ( num ) {
106
106
$ ( "#numRegistrants" ) . html ( num . toNumber ( ) ) ;
107
- return contractInstance . organizer . call ( ) ;
107
+ return Conference . organizer . call ( ) ;
108
108
} ) ;
109
109
}
110
110
111
111
// Change Quota
112
112
function changeQuota ( val ) {
113
- contractInstance . changeQuota ( val , { from : accounts } ) . then (
113
+ Conference . changeQuota ( val , { from : accounts } ) . then (
114
114
function ( ) {
115
- return contractInstance . quota . call ( ) ;
115
+ return Conference . quota . call ( ) ;
116
116
} ) . then (
117
117
function ( quota ) {
118
118
if ( quota == val ) {
@@ -128,13 +128,13 @@ function changeQuota(val) {
128
128
// buyTicket
129
129
function buyTicket ( buyerAddress , ticketPrice ) {
130
130
131
- contractInstance . buyTicket ( { from : buyerAddress , value : ticketPrice } ) . then (
131
+ Conference . buyTicket ( { from : buyerAddress , value : ticketPrice } ) . then (
132
132
function ( ) {
133
- return contractInstance . numRegistrants . call ( ) ;
133
+ return Conference . numRegistrants . call ( ) ;
134
134
} ) . then (
135
135
function ( num ) {
136
136
$ ( "#numRegistrants" ) . html ( num . toNumber ( ) ) ;
137
- return contractInstance . registrantsPaid . call ( buyerAddress ) ;
137
+ return Conference . registrantsPaid . call ( buyerAddress ) ;
138
138
} ) . then (
139
139
function ( valuePaid ) {
140
140
var msgResult ;
@@ -152,19 +152,19 @@ function refundTicket(buyerAddress, ticketPrice) {
152
152
153
153
var msgResult ;
154
154
155
- contractInstance . registrantsPaid . call ( buyerAddress ) . then (
155
+ Conference . registrantsPaid . call ( buyerAddress ) . then (
156
156
function ( result ) {
157
157
if ( result . toNumber ( ) == 0 ) {
158
158
$ ( "#refundTicketResult" ) . html ( "Buyer is not registered - no refund!" ) ;
159
159
} else {
160
- contractInstance . refundTicket ( buyerAddress ,
160
+ Conference . refundTicket ( buyerAddress ,
161
161
ticketPrice , { from : accounts [ 0 ] } ) . then (
162
162
function ( ) {
163
- return contractInstance . numRegistrants . call ( ) ;
163
+ return Conference . numRegistrants . call ( ) ;
164
164
} ) . then (
165
165
function ( num ) {
166
166
$ ( "#numRegistrants" ) . html ( num . toNumber ( ) ) ;
167
- return contractInstance . registrantsPaid . call ( buyerAddress ) ;
167
+ return Conference . registrantsPaid . call ( buyerAddress ) ;
168
168
} ) . then (
169
169
function ( valuePaid ) {
170
170
if ( valuePaid . toNumber ( ) == 0 ) {
@@ -178,7 +178,7 @@ function refundTicket(buyerAddress, ticketPrice) {
178
178
} ) ;
179
179
}
180
180
function getEthBalance ( ) {
181
- contractInstance . getEthBalanceOf ( web3 . eth . accounts [ 0 ] , ( ( error , result ) => {
181
+ Conference . getEthBalanceOf ( web3 . eth . accounts [ 0 ] , ( ( error , result ) => {
182
182
if ( ! error ) {
183
183
balance = result ;
184
184
$ ( '#balance' ) . text ( "BALANCE: " + web3 . fromWei ( result , 'ether' ) + " ETH" ) ;
0 commit comments