Real simple question, actually... I have this contract :


I'm trying to send tokens around some accounts, but they keep failing. I cannot figure out if i'm using the wrong addresses or if the amount is wrong.

How do I go about debugging this? (I use Web3, nodejs )


Try using the transfer() function directly, not transferFrom().

transferFrom() should be used when there are tokens approved for your account.

| improve this answer | |
  • Thanks, this indeed was the problem. What is a use-case for TransferFrom though? – nizzle Mar 15 '18 at 11:41
  • 1
    transferFrom() is used when somebody else approved an allowance for you and you spend their tokens. But the tokens are always in their posession. They can approve multiple accounts to spend their tokens. – Daniel Luca CleanUnicorn Mar 15 '18 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.