I have follow this SO answer for sending ERC20 tokens from 1 address to another. I am running into an issue where I am receiving an error that my from address
is invalid
Error: Error: WalletMiddleware - Invalid "from" address.
The from address works just fine when I use the web3 function contract.balanceOf
, so I am not sure why it says my address is invalid
Here is my code:
contract.transfer(
'0x002FaCf5B2e8441c7ECb4eb6dCfD9C7b46320c97', //toaddress
web3.toWei(1, "ether"), //send 1 token
{
from:'0xb8fd65fc6919c5b97453eaba6b895144597985b2' //fromaddress
}, function(err, transactionHash)
{
if(!err)
{
console.log(transactionHash);
}
else
{
console.log(err);
}
}
);
getAccounts() ?
Your question does not seem to match with your description, please make the connection between those two points.