i am trying to send USDT using the ERC20 address . But not able to do. Can anyone please guide me how to do ..Here is the steps Step 1: use Web3\Contract; $contractAddress = 'ERC-20 contract deployed address' $contract = new Contract('http://localhost:8545', $abi); $contractInstance = $contract->at($contractAddress);

Step 2:

$amount = 100, $receiver = 'Receiver addresss'

Step 3:

$contractInstance->call(transfer, [$amount, $receiver], $callback);

1 Answer 1


I'm happy to be able to help you as I fixed this a few days ago.

const sendERC20Transaction = async (receiver, amount) => {
    var Tx     = require('ethereumjs-tx')
    const Web3 = require('web3')
    const web3 = new Web3('https://mainnet.infura.io/v3/your-project-id')
    web3.eth.accounts.wallet.add('privateKey of fromwallet');
    var contractAbi =[];
    var tokenAddress = '0xdAC17F958D2ee523a2206206994597C13D831ec7'//Tether token(USDT)
    var fromAddress = '0x3df...'
    var tokenInst = new web3.eth.Contract(contractAbi,tokenAddress);
    tokenInst.methods.transfer(receiver, amounts).send({from: fromAddress, gas: 100000},function (error, result){ //get callback from function which is your transaction key
        } else{
            web3.eth.getBalance(fromAddress, (err,bal) => { alert('Your account has ' + web3.utils.fromWei(bal, 'ether') + ', Insufficient funds for gas * price + value on your wallet')});
//Finally, you can check if usdt tranaction success through this code.

Have a nice day!

  • You are using the API from mainnet.infura.io/v3/your-project-id ..I installed the Ethereum node on my Server. I am able to generate address there ..Able to send transaction from there.. Is it possible to to do with it?? Sep 25, 2021 at 11:20
  • This isn't php though. Jul 1, 2022 at 7:51
  • This is not web3.php. This is for web3.js Dec 26, 2023 at 19:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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