Add custom data when using transfer(to,amount) function for USDT

hi, I want to send USDT with custom data, how can I do that?

I deploy en erc20 token ‘HelloWorldToken’ and I send a token to mysql with custom data ‘HelloWorld’,
the url is

the data of this tx is as follow:


just as we all know, a9059cbb is the function id of transfer(address,uint256) and 000000000000000000000000ad61cc6653b62b7c05bd2f593bc49d22fb901a9c is the address, the 0000000000000000000000000000000000000000000000000000000000000400 is the amount,

and I add my custom data of 48656c6c6f576f726c64 (HelloWorld) to the end.

and the tx is ok, the token transfer from A to B.

Is there a EIP abount this on how to add custom data to the end of a token?

1 Like

Hi @vie,

I assume that you should be able to do the same with transfer on the USDT contract.

It has a check for data size but this is to prevent short addresses…

    * @dev Fix for the ERC20 short address attack.
    modifier onlyPayloadSize(uint size) {
        require(!( < size + 4));

    * @dev transfer token for a specified address
    * @param _to The address to transfer to.
    * @param _value The amount to be transferred.
    function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
        uint fee = (_value.mul(basisPointsRate)).div(10000);
        if (fee > maximumFee) {
            fee = maximumFee;
        uint sendAmount = _value.sub(fee);
        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(sendAmount);
        if (fee > 0) {
            balances[owner] = balances[owner].add(fee);
            Transfer(msg.sender, owner, fee);
        Transfer(msg.sender, _to, sendAmount);

Hi @Vie,

Were you able to send custom data?

yes, I send custom data this url

It’s fixed now, thank you.

1 Like