This code return an error before executing the "sendTransaction" function. I have used a callback but it doesn't work also. Any help please ! here is the code that I have written
var mytoken= MyContract.at(contractAddress);
router.get('/test',function (req, res, next)
{
res.render('test.ejs');
});
//send token
router.post('/test', function(req, res, next) {
var recieverAdd = req.body.to;
var from=req.body.from;
var amount = req.body.amount;
var bool= web3.personal.unlockAccount(web3.eth.accounts[0],"yosra");
mytoken.transfer.sendTransaction(from,recieverAdd,amount, {from:eth.accounts[0],gas:500000},function (error, result)
{
callback(result);
});
});
via takampika
No comments:
Post a Comment