bsc-php icon indicating copy to clipboard operation
bsc-php copied to clipboard

Problem transferring usdt bep20

Open amirho3ein-hn opened this issue 11 months ago • 5 comments

`<?php error_reporting(E_ALL);

require 'Fenguoz-bsc-php/autoload.php';

$api = new \Binance\NodeApi('https://bsc-dataseed1.binance.org/'); $bnb = new \Binance\Bnb($api);

$config = [ 'contract_address' => '0x55d398326f99059ff775485246999027b3197955', // USDT BEP20 'decimals' => 8, ]; $bep20 = new \Binance\BEP20($api, $config);

// Transaction transfer (offline signature) $from = '2d24*****630f'; $to = '0x080702F42aeEfF08396E8d2EFCeab8c09a13cdE6'; $amount = 1; $apii = new \Binance\BscscanApi("ZPJP****1E"); $fee = $apii->gasPrice();

$transaction = $bep20->transfer($from, $to, $amount,$fee); var_dump($transaction); `

This is my code to transfer usdt bep20, but the output is false

output => bool(false)

@mitmelon can you help in this regard? @Fenguoz @mitmelon

amirho3ein-hn avatar Jan 03 '25 17:01 amirho3ein-hn

`<?php error_reporting(E_ALL);

require 'Fenguoz-bsc-php/autoload.php';

$api = new \Binance\NodeApi('https://bsc-dataseed1.binance.org/'); $bnb = new \Binance\Bnb($api);

$config = [ 'contract_address' => '0x55d398326f99059ff775485246999027b3197955', // USDT BEP20 'decimals' => 8, ]; $bep20 = new \Binance\BEP20($api, $config);

// Transaction transfer (offline signature) $from = '2d24*****630f'; $to = '0x080702F42aeEfF08396E8d2EFCeab8c09a13cdE6'; $amount = 1; $apii = new \Binance\BscscanApi("ZPJP****1E"); $fee = $apii->gasPrice();

$transaction = $bep20->transfer($from, $to, $amount,$fee); var_dump($transaction); `

This is my code to transfer usdt bep20, but the output is false

output => bool(false)

@mitmelon can you help in this regard? @Fenguoz @mitmelon

The gas fee is th issue... I forgot how I solved it then... But will check it tomorrow.

Meanwhile trying printing out the gas fee to check if it prints...

I think I have a fork of this where it's solved... Let me check...

mitmelon avatar Jan 03 '25 19:01 mitmelon

<?php error_reporting(E_ALL); require 'Fenguoz-bsc-php/autoload.php'; $api = new \Binance\NodeApi('https://bsc-dataseed1.binance.org/'); $bnb = new \Binance\Bnb($api); $config = [ 'contract_address' => '0x55d398326f99059ff775485246999027b3197955', // USDT BEP20 'decimals' => 8, ]; $bep20 = new \Binance\BEP20($api, $config); // Transaction transfer (offline signature) $from = '2d24*****630f'; $to = '0x080702F42aeEfF08396E8d2EFCeab8c09a13cdE6'; $amount = 1; $apii = new \Binance\BscscanApi("ZPJP****1E"); $fee = $apii->gasPrice(); $transaction = $bep20->transfer($from, $to, $amount,$fee); var_dump($transaction); This is my code to transfer usdt bep20, but the output is false output => bool(false) @mitmelon can you help in this regard? @Fenguoz @mitmelon

The gas fee is th issue... I forgot how I solved it then... But will check it tomorrow.

Meanwhile trying printing out the gas fee to check if it prints...

I think I have a fork of this where it's solved... Let me check...

thank you Be sure to let me know the result. Thank you

No, there is no problem with the amount of gas, even I set it manually, but the output is still false

amirho3ein-hn avatar Jan 03 '25 19:01 amirho3ein-hn

<?php error_reporting(E_ALL); require 'Fenguoz-bsc-php/autoload.php'; $api = new \Binance\NodeApi('https://bsc-dataseed1.binance.org/'); $bnb = new \Binance\Bnb($api); $config = [ 'contract_address' => '0x55d398326f99059ff775485246999027b3197955', // USDT BEP20 'decimals' => 8, ]; $bep20 = new \Binance\BEP20($api, $config); // Transaction transfer (offline signature) $from = '2d24*****630f'; $to = '0x080702F42aeEfF08396E8d2EFCeab8c09a13cdE6'; $amount = 1; $apii = new \Binance\BscscanApi("ZPJP****1E"); $fee = $apii->gasPrice(); $transaction = $bep20->transfer($from, $to, $amount,$fee); var_dump($transaction); This is my code to transfer usdt bep20, but the output is false output => bool(false) @mitmelon can you help in this regard? @Fenguoz @mitmelon

The gas fee is th issue... I forgot how I solved it then... But will check it tomorrow. Meanwhile trying printing out the gas fee to check if it prints... I think I have a fork of this where it's solved... Let me check...

thank you Be sure to let me know the result. Thank you

No, there is no problem with the amount of gas, even I set it manually, but the output is still false

Try use the fork here https://github.com/mitmelon/bsc-php and see if it works...

mitmelon avatar Jan 03 '25 20:01 mitmelon

how to use low gas fee?

poejanetwork avatar Jan 11 '25 16:01 poejanetwork

You can try to print the $res result to see the error message

Fenguoz avatar Feb 07 '25 12:02 Fenguoz