1. Go to this page and download the library: Download kornrunner/ethereum-token library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use kornrunner\Ethereum\Token;
use kornrunner\Ethereum\Transaction;
$token = new Token;
$usdt = new Token\USDT;
$spender = '1a8c8adfbe1c59e8b58cc0d515f07b7225f51c72';
$amount = 100;
$hexAmount = $token->hexAmount($usdt, $amount);
$data = $token->getApproveData($spender, $hexAmount);
// use $data with Transaction as shown above
use kornrunner\Ethereum\Token;
use kornrunner\Ethereum\Transaction;
$token = new Token;
$usdt = new Token\USDT;
$amount = 50;
$hexAmount = $token->hexAmount($usdt, $amount);
$data = $token->getBurnData($hexAmount);
// use $data with Transaction as shown above
use kornrunner\Ethereum\Token;
use kornrunner\Ethereum\Transaction;
$token = new Token;
$usdt = new Token\USDT;
$recipient = '1a8c8adfbe1c59e8b58cc0d515f07b7225f51c72';
$amount = 1000;
$hexAmount = $token->hexAmount($usdt, $amount);
$data = $token->getMintData($recipient, $hexAmount);
// use $data with Transaction as shown above
use kornrunner\Ethereum\Token;
use kornrunner\Ethereum\Transaction;
$token = new Token;
$usdt = new Token\USDT;
$from = 'd9040b8a1f12a40511ac1f7b994a21dd08ceac20';
$to = '1a8c8adfbe1c59e8b58cc0d515f07b7225f51c72';
$amount = 50;
$hexAmount = $token->hexAmount($usdt, $amount);
$data = $token->getTransferFromData($from, $to, $hexAmount);
// use $data with Transaction as shown above
use kornrunner\Ethereum\Token;
$token = new Token;
$address = '1a8c8adfbe1c59e8b58cc0d515f07b7225f51c72';
$data = $token->getBalanceOfData($address);
// 0x70a082310000000000000000000000001a8c8adfbe1c59e8b58cc0d515f07b7225f51c72
use kornrunner\Ethereum\Token;
$token = new Token;
$owner = '1a8c8adfbe1c59e8b58cc0d515f07b7225f51c72';
$spender = 'd9040b8a1f12a40511ac1f7b994a21dd08ceac20';
$data = $token->getAllowanceData($owner, $spender);
// 0x...
use kornrunner\Ethereum\Token;
$token = new Token;
$data = $token->getTotalSupplyData();
// 0x18160ddd
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.