I'm trying to us a contract in a truffle project. This is part of a migration.js file.
deployer.deploy(token,companyID).then(function(){
var starttime = web3.eth.getBlock(web3.eth.blockNumber).timestamp + 300000000;
var endtime = starttime + 1000000;
GG = token;
return deployer.deploy(tokenICO, token.address, tokenwallet, rate, goal, tokenwallet, starttime, endtime).then(function()
{
console.log("token object: " + token);
GG.approve(tokenICO.address,16000000);
});
});
In this case I want to use the approve function of the token contract but I get the following error:
TypeError: GG.approve is not a function
at (location)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:160:7)
Is there an alternative way of going about this?