5

I was successfully able to send eth with some message here: 0x4ea3d0ae060aeb08f41fb8ff3e468b7e44092a251ccef118b386136fe6427a64 (little tackier though). I did this from MEW, but saw that it is not possible to send input data with a token transfer. I know the token transfer has instructions for the token smart contract in the same input data field. So does that mean we cannot send a message (input data) with a token transfer and it is only possible on ETH transfer? Not familiar enough with web3 to figure this out on my own. Really appreciate if anyone can share their know-how

5

If the token is ERC20 compliant, then no, the normal transfer functions don't have a field for extra data.

As seen in the ERC20 standard here, the two functions for transferring tokens are defined as

    function transfer(address to, uint tokens) public returns (bool success);

and

function transferFrom(address from, address to, uint tokens) public returns (bool success);

neither of which have a field for extra data. However, the standard does not forbid a token from having extra functions, so the particular token contract with which you are dealing may have a transfer function with an extra data field. You'd need to view the contract code to know if this was the case.

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.