js/etc/wallet/farm.js
// This buys P3C from the crop, but with you as the referrer
This buys P3C from the crop, but with you as the referrer
This buys P3C from the crop but with you as the referrer
function sellFromCrop(amountToSell) {
    farmContract.myCrop.call(function (err, cropAddress) {
        amount = web3.toWei(amountToSell)
        cropAbi.at(cropAddress).sell.sendTransaction(
            amount, {
                from: web3.eth.accounts[0],
                gas: 223287,
                gasPrice: web3.toWei(1, 'gwei')
            },
            function (error, result) { 
                if (!error) {
                    if (typeof gtag !== 'undefined'){gtag('event', 'Wallet', {'event_label': 'Usage', 'event_category': 'SellP3C', 'value': amountToSell});};
                    alertify.success('<h3>' + amountToSell + " WLTH Terjual. Akan segera dikirim ke Dompet sebagai ETC.</h3>")
                    $('#sellAmount').hide();
                } else {
                    console.log(error);
                }
            })
    })
}
function sellFromCrop ( amountToSell ) { farmContract . myCrop . call ( function ( err , cropAddress ) { amount = web3 . toWei ( amountToSell ) cropAbi . at ( cropAddress ) . sell . sendTransaction ( amount , { from : web3 . eth . accounts [ 0 ] , gas : 223287 , gasPrice : web3 . toWei ( 1 , 'gwei' ) } , function ( error , result ) { if ( ! error ) { if ( typeof gtag !== 'undefined' ) { gtag ( 'event' , 'Wallet' , { 'event_label' : 'Usage' , 'event_category' : 'SellP3C' , 'value' : amountToSell } ) ; } ; alertify . success ( '<h3>' + amountToSell + " WLTH Terjual. Akan segera dikirim ke Dompet sebagai ETC.</h3>" ) $ ( '#sellAmount' ) . hide ( ) ; } else { console . log ( error ) ; } } ) } ) }
This buys P3C from the crop, but with you as the referrer
This buys P3C from the crop but with you as the referrer
// you are the referer //get callback from function which is your transaction key // playSound('register');