lessmore92 / php-erc20 Goto Github PK
View Code? Open in Web Editor NEWThe simple way to interact with Ethereum ERC20 token.
License: MIT License
The simple way to interact with Ethereum ERC20 token.
License: MIT License
I try to use "$token->name()" in a loop. It works most of the time. But sometimes i run into an error "execution reverted".
Any idea how to handle this?
This is an example transaction / address where it happens.
Transaction: https://etherscan.io/tx/0x15bc9ee5c237f381dca60c1be0e8fee470a1491c5fe62b967d9e5cf3d1c698d0
Address: 0x656acfd86be535353f0a08a327368ccf7304e819
Hi Sir. Do You Have ERC721 PHP Library ? If You Have Please sent The Link as soon as possible.
$owner_private = '0x922b775cef0410717c28e0b04c23ffa5a0e2*********';
$owner_address = '0x9118cc4212dCC83dca639de28FC0D47AfdE4C45F';
$token = new Token("0xdac17f958d2ee523a2206206994597c13d831ec7","https://mainnet.infura.io/v3/d5cd9b58d5ca43409486******");
//by this method we allow $myapp_address to send upto 99999 token behalf of $owner_address
$approve_tx = $token->approve($owner_address, "0x4E0E4CbdfBaB08e65F5ECAb25bEAA*******", 9999);
$approve_tx_id = $approve_tx->sign($owner_private)->send();
Hello author, I have a problem!
It keeps prompting insufficient funds for gas
But there is enough ETH in the account
can you help me
$token = new USDT("https://mainnet.infura.io/v3/8038c7c7********");
$owner_address = '0x1d64720e43342bdd0E824e1dadEF';
$myapp_private = '0xbf15a4a052a3b59c1a55988e8a1e35056fbfacf94ce';
$myapp_address = '0x907Dc5716029B907BfFB223f0A*******';
$to_address = '0x907Dc5716029B907BfFB2*******';
$transfer_tx = $token->transferFrom($myapp_address, $owner_address, $to_address, 1);
$transfer_tx_id = $transfer_tx->sign($myapp_private)->send();
How to solve this please?
Uncaught RuntimeException: insufficient funds for gas * price + value
I'm trying to send Ethereum, thanks for the help last time, but I keep getting this error:
"{"success":false,"message":"insufficient funds for gas * price + value"}"
The message is the reason for failure. I have $1.01 worth of ETH, I know it's small but I wanted to send half of that to my other wallet to see if the transfer send() method completes successfully. Maybe the value I input is too big?
The amount is multiplied by the 18th power of 10, I assume because value is in Wei?
Hello, I can't understand the parameters, why is the owner, what's going on with myapp, and there is a to address, I'm very confused please help.
Ask for help on how to set parameters. Use the default gaslimits (50000) and real-time gas (76044395808) to prompt me TX fee (XX ether) exceeds the configured cap (1.00 ether)
$token = new \Lessmore92\Ethereum\Token($contractAddress, "https://mainnet.infura.io/v3/id");
try {
$transfer_tx = $token->transferFrom($contractAddress, $from, $to, '0.0001', 'default', '700000');
dump($transfer_tx);
$transfer_tx_id = $transfer_tx->sign($privateKey)->send();
var_dump($transfer_tx_id);
}catch (Exception $exception) {
var_dump($exception->getMessage());
}
The above code gets the HASH of the transaction, 0x278610b300c70d6a61283d08020618cf24abe1fbc3e8f1ff56eb88c58bf739e6
Is this a successful transaction?
But the HASH of the transaction cannot query the data on the website
https://eth.tokenview.com/cn/tx/0x278610b300c70d6a61283d08020618cf24abe1fbc3e8f1ff56eb88c58bf739e6
Is this something I'm using wrong here?
Is it possible to use this library to initialize a transaction in ETH without passing a specific token or contract address?
insufficient funds for gas * price + value
owner_address 12 usdt
myapp_address is 0.08eth
It would be nice to add a function to check the amount of approved tokens for an address for a particular contract.
$tokeData = new Token('0xb01d449c7a740c1f29a39b46aebf4b16f9877981', $node);
$tokeData->name()
mb_substr(): Argument #2 ($start) must be of type int, float given
Looks like there is an issue with name of this token
$token = new \Lessmore92\Ethereum\Token($contractAddress, "https://mainnet.infura.io/v3/id");
try {
$transfer_tx = $token->transferFrom($contractAddress, $from, $to, '0.0001', 'default', '700000');
dump($transfer_tx);
$transfer_tx_id = $transfer_tx->sign($privateKey)->send();
var_dump($transfer_tx_id);
}catch (Exception $exception) {
var_dump($exception->getMessage());
}
The above code gets the HASH of the transaction, 0x278610b300c70d6a61283d08020618cf24abe1fbc3e8f1ff56eb88c58bf739e6
Is this a successful transaction?
But the HASH of the transaction cannot query the data on the website
https://eth.tokenview.com/cn/tx/0x278610b300c70d6a61283d08020618cf24abe1fbc3e8f1ff56eb88c58bf739e6
Is this something I'm using wrong here?
@lessmore92 Hello mate, you state that by
//by this method we allow $myapp_address to send upto 99999 token behalf of $owner_address
$approve_tx = $token->approve($owner_address, $myapp_address, 99999);
$approve_tx_id = $approve_tx->sign($owner_private)
->send()
$owner_address allows $myapp_address to send some USDT amount to any address without $owner_address having anything but USDT in his wallet.
Well how is this possible to work while for approve() to work you have to send a transaction which needs gas (ETH)?
I tried with account only having token inside and got
message: "insufficient funds for transfer"
code: -32000
Here is a TX on etherscan showing the exact approve() method called that costs $31 😃
hello Sir , While Running This Code Im Getting Below Error. Can You Help Me With This.
PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 3: (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in C:\Users\hp\OneDrive\Desktop\testLibrarySdk\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:201
Stack trace:
#0 C:\Users\hp\OneDrive\Desktop\testLibrarySdk\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(155): GuzzleHttp\Handler\CurlFactory::createRejection()
#1 C:\Users\hp\OneDrive\Desktop\testLibrarySdk\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php(105): GuzzleHttp\Handler\CurlFactory::finishError()
#2 C:\Users\hp\OneDrive\Desktop\testLibrarySdk\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php(43): GuzzleHttp\Handler\CurlFactory::finish()
#3 C:\Users\hp\OneDrive\Desktop\testLibrarySdk\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(28): GuzzleHttp\Handler\CurlHandler->__invoke()
#4 C:\Users\hp\OneDrive\Desktop\testLibrarySdk\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php(51): GuzzleHttp\Handler\Proxy::GuzzleHttp\Handler{closure}()
#5 C:\Users\hp\OneDrive\Desktop\tes in C:\Users\hp\OneDrive\Desktop\testLibrarySdk\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 201
PS C:\Users\hp\OneDrive\Desktop\testLibrarySdk\src\test>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.