js/etc/pure/pure.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 buyFromCrop(amountToBuy, referrer) {
    amount = web3.toWei(amountToBuy)
    p3cContract.buy.sendTransaction(
        referrer, {
            from: web3.eth.accounts[0],
            value: amount,
            gas: 123287,
            gasPrice: web3.toWei(1, 'gwei')
        },
        function (error, result) { 
            if (!error) {
                alertify.success(amountToBuy + " ETC dikonfirmasi menunggu Blockchain.")
            } else {
                console.log(error);
            }
        }
    )
}
function buyFromCrop ( amountToBuy , referrer ) { amount = web3 . toWei ( amountToBuy ) p3cContract . buy . sendTransaction ( referrer , { from : web3 . eth . accounts [ 0 ] , value : amount , gas : 123287 , gasPrice : web3 . toWei ( 1 , 'gwei' ) } , function ( error , result ) { if ( ! error ) { alertify . success ( amountToBuy + " ETC dikonfirmasi menunggu Blockchain." ) } 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
// your crop is the referrer //get callback from function which is your transaction key