@@ -85,34 +85,34 @@ function initializeConference() {
8585 Conference ( { from : accounts , gas : 3141592 } ) . then (
8686 function ( conf ) {
8787 console . log ( conf ) ;
88- contractInstance = conf ;
89- $ ( "#confAddress" ) . html ( contractInstance . address ) ;
88+ Conference = conf ;
89+ $ ( "#confAddress" ) . html ( Conference . address ) ;
9090 checkValues ( ) ;
9191 } ) ;
9292}
9393
9494// Check Values
9595function checkValues ( ) {
96- contractInstance . quota . call ( ) . then (
96+ Conference . quota . call ( ) . then (
9797 function ( quota ) {
9898 $ ( "input#confQuota" ) . val ( quota ) ;
99- return contractInstance . organizer . call ( ) ;
99+ return Conference . organizer . call ( ) ;
100100 } ) . then (
101101 function ( organizer ) {
102102 $ ( "input#confOrganizer" ) . val ( organizer ) ;
103- return contractInstance . numRegistrants . call ( ) ;
103+ return Conference . numRegistrants . call ( ) ;
104104 } ) . then (
105105 function ( num ) {
106106 $ ( "#numRegistrants" ) . html ( num . toNumber ( ) ) ;
107- return contractInstance . organizer . call ( ) ;
107+ return Conference . organizer . call ( ) ;
108108 } ) ;
109109}
110110
111111// Change Quota
112112function changeQuota ( val ) {
113- contractInstance . changeQuota ( val , { from : accounts } ) . then (
113+ Conference . changeQuota ( val , { from : accounts } ) . then (
114114 function ( ) {
115- return contractInstance . quota . call ( ) ;
115+ return Conference . quota . call ( ) ;
116116 } ) . then (
117117 function ( quota ) {
118118 if ( quota == val ) {
@@ -128,13 +128,13 @@ function changeQuota(val) {
128128// buyTicket
129129function buyTicket ( buyerAddress , ticketPrice ) {
130130
131- contractInstance . buyTicket ( { from : buyerAddress , value : ticketPrice } ) . then (
131+ Conference . buyTicket ( { from : buyerAddress , value : ticketPrice } ) . then (
132132 function ( ) {
133- return contractInstance . numRegistrants . call ( ) ;
133+ return Conference . numRegistrants . call ( ) ;
134134 } ) . then (
135135 function ( num ) {
136136 $ ( "#numRegistrants" ) . html ( num . toNumber ( ) ) ;
137- return contractInstance . registrantsPaid . call ( buyerAddress ) ;
137+ return Conference . registrantsPaid . call ( buyerAddress ) ;
138138 } ) . then (
139139 function ( valuePaid ) {
140140 var msgResult ;
@@ -152,19 +152,19 @@ function refundTicket(buyerAddress, ticketPrice) {
152152
153153 var msgResult ;
154154
155- contractInstance . registrantsPaid . call ( buyerAddress ) . then (
155+ Conference . registrantsPaid . call ( buyerAddress ) . then (
156156 function ( result ) {
157157 if ( result . toNumber ( ) == 0 ) {
158158 $ ( "#refundTicketResult" ) . html ( "Buyer is not registered - no refund!" ) ;
159159 } else {
160- contractInstance . refundTicket ( buyerAddress ,
160+ Conference . refundTicket ( buyerAddress ,
161161 ticketPrice , { from : accounts [ 0 ] } ) . then (
162162 function ( ) {
163- return contractInstance . numRegistrants . call ( ) ;
163+ return Conference . numRegistrants . call ( ) ;
164164 } ) . then (
165165 function ( num ) {
166166 $ ( "#numRegistrants" ) . html ( num . toNumber ( ) ) ;
167- return contractInstance . registrantsPaid . call ( buyerAddress ) ;
167+ return Conference . registrantsPaid . call ( buyerAddress ) ;
168168 } ) . then (
169169 function ( valuePaid ) {
170170 if ( valuePaid . toNumber ( ) == 0 ) {
@@ -178,7 +178,7 @@ function refundTicket(buyerAddress, ticketPrice) {
178178 } ) ;
179179}
180180function getEthBalance ( ) {
181- contractInstance . getEthBalanceOf ( web3 . eth . accounts [ 0 ] , ( ( error , result ) => {
181+ Conference . getEthBalanceOf ( web3 . eth . accounts [ 0 ] , ( ( error , result ) => {
182182 if ( ! error ) {
183183 balance = result ;
184184 $ ( '#balance' ) . text ( "BALANCE: " + web3 . fromWei ( result , 'ether' ) + " ETH" ) ;
0 commit comments