Questions tagged [php]
Questions regarding the use of the PHP scripting language with Ethereum.
72
questions
0
votes
0
answers
12
views
How check token List with php?
Hello I come from Vietnam . I am doing my web3 project with php. I'm having trouble writing a complete check.php code. Can anyone help me?
if (HARDCACHED_API_RESPONSE && (connected == "2&...
0
votes
1
answer
58
views
Is it possible to create an OpenSea collection using their API?
I want to create a collection in OpenSea but using a php backend instead of using their platform.
Is it possible to do this? I have been looking at their API documentation and I haven't been able to ...
0
votes
0
answers
18
views
stdClass Object ( [jsonrpc] => 2.0 [id] => 1 [error] => stdClass Object ( [code] => -32000 [message] => unknown account ) )
Why Am I Getting This Error In
'2.0',
'id' => 1,
'method' => 'eth_sendTransaction',
'params' => array(
array(
'from' => '0x',
//...
0
votes
0
answers
58
views
how can I get a Block hash before sending?
I'm using tron-api for trx transactions. The obtained raw_data is as follows:
[
"visible" => false
"txID" => "...
0
votes
0
answers
5
views
Remote access local mysql server
I'm using Laravel and Hostinger as a web hosting, how will i get or send data to my local database on ubuntu ? Can you suggest any solution on how will i do this ? thank you!
1
vote
0
answers
84
views
how to to create and broadcast a custom token transaction in bsc with php?
i have custom token on bsc. i use some kornrunner class for signing my transaction and broadcast it but i have some problem here. when i send hex to bsc chain, return txid for me but blockHash & ...
1
vote
1
answer
68
views
"Reverse ENS lookup" using php-keccak
I am using kornrunner/php-keccak and I am attempting to do a "reverse lookup" on an ENS name, essentially the same as this question which was never answered. Any thoughts?
Here's my attempt ...
1
vote
1
answer
594
views
Recover public key from signature and address only works with MetaMask provider
I have to implement a login system with a web3modal using WalletConnect & MetaMask.
After many attempts, it seems that all the existing source codes about this on the internet only work with ...
0
votes
1
answer
573
views
e is not a constructor - WalletConnectProvider model not working
Metamask is working perfectly.
BinanceChainWallet is working perfectly.
WalletConnectProvider (model: QR - desktop/mobile wallet support), not working when I click on Wallet-Connect model on the front-...
1
vote
0
answers
507
views
How to call a Smart Contract function using php
I am trying to call a simple function (no parameters) from a Smart Contract currently on the Rinkeby network using php. I have an ubuntu 22.04 server with Apache, I installed composer and the ethereum-...
0
votes
1
answer
258
views
Recover address from signature works only with MetaMask
I try to implement Web3 login to my page. It works with MetaMask, but with other wallets (like LRC, Coinbase or Argent) it doesn't - recovered address differs from the original one.
Ethereum\EcRecover ...
1
vote
0
answers
520
views
How to get the latest block of a contract with web3.php?
I need to get the latest block because 'latest' as toBlock doesn't work. I tried the code below with $toBlock = 'latest'
$this->eth->getLogs([
'fromBlock' => (is_int($fromBlock)) ? '0x' . ...
0
votes
2
answers
741
views
"invalid sender" when sending a signed transaction on bsc on PHP
I'm trying to replicate a script that I have already running in nodejs in php.
On PHP I'm using "web3p/web3.php": "dev-master", "web3p/ethereum-tx": "^0.4.3" ...
0
votes
0
answers
81
views
Is it possible to scan for security vulnerability of Smart Contract in PHP
I am trying to use https://github.com/digitaldonkey/ethereum-php to build an api tool for scanning smart contracts for vulnerbilities.
Ref link: https://ethereum-php.org/dev/
My doubt it is possible ...
2
votes
1
answer
221
views
What are the best tools or ways to interact with a smart contract from a word-press website?
I am currently working on a WordPress website and I want to interact with a deployed smart contract and need help selecting the right tools or ways to interact.
1
vote
1
answer
837
views
How to decode log data from bscscan API using PHP?
I'm pulling fight logs from a BSC contract via bscscan API. The data record, which should be a set 6 different values, looks like this: ...
5
votes
1
answer
2k
views
How can I do abi.encodePacked in Python or PHP?
Just concatenating strings doesn't work.
Keccak::hash(10 . $address, 256) is what I'm doing atm.
3
votes
1
answer
3k
views
How can I sign a message off-chain and verify it in the contract method that it was signed by a specific address?
I have a public / private keys. I release a contract with these keys. I want some user to withdraw a token / ether, so I sign some message like {withdraw: 10, nonce:1} offchain. User uses this signed ...
0
votes
1
answer
89
views
Can we use both centralized and decentralized approach for developing DAPP?
I saw a dapp using Decentralized approach for the buying and selling ERC20 Tokens ..But there's no proof of using the functions defined in smart contract in the web3js library.How is that possible ?.....
1
vote
1
answer
538
views
Why does some of the DAPP uses PHP and how would they do so?
I always wonder how come many DAPPS uses PHP extension at the end of the filename and how did they do so ?? There is slighlty possibility that they are using the Web3PHP library to interact with the ...
4
votes
2
answers
1k
views
Create signed message without JSON RPC node in PHP
I am trying to recreate effect of web3's eth.accounts.sign in PHP and I struggle to find good resources how to do it properly.
I have seen this
(found it thanks to this thread) and based on what I ...
0
votes
0
answers
1k
views
Web3 library to use with Laravel [duplicate]
Is there some library like web3.js or ethers.js but in PHP to use with Laravel?
(Which code is hopefully maintained)
Or is PHP just the strongest choice possible I want to work with web3?
0
votes
0
answers
224
views
eth_sendTransaction gas required exceeds allowance
$result = $client->callMethod('eth_sendTransaction', [array(
"from" => $address->address,
"to" => "0xac52822dde76b9c4cd701d5f4402acedb2a86cc1",
...
2
votes
0
answers
467
views
ethereum-php library SmartContract balanceOf always returns 0
I am trying to check balance of some USDT token using ethereum-php library but it always return 0.
Here is the code,
$contractMeta = json_decode('[{"constant":true,"inputs":[],"name":"name","...
1
vote
1
answer
1k
views
Infura getLogs returns an empty result
I'm writing a crypto based system with PHP on Infura, and now I am coding a script to retrieve logs for a specific address. This is my code:
$ch = curl_init($my_server_url);
$data = array(
'...
0
votes
1
answer
119
views
Automate token distribution?
How can I execute a function on a smart contract from a web-app backend? (Laravel / PHP)
My smart contracts holds X tokens.
In my MySQL database, users are owed X tokens. I have their wallet ...
1
vote
1
answer
243
views
What are the minimum requirements for Geth server only for API calls?
I want to run a platform based on Ethereum and PHP to let our customers to sell/buy Ethereum based currencies online, and we have not any plan to mine the blockchain. In this regard, please help me to ...
0
votes
0
answers
269
views
Geth web3.eth.contract returns null
I understand that the way I'm doing this is a bit backwards, but I cannot install node.js onto our server, and we are using a PHP backend which doesn't have very good Ethereum support.
I am trying to ...
1
vote
2
answers
242
views
Testrpc on ubuntu
I have a .php website on my ubuntu virtual machine. I want to start the testrpc in this machine, so I can interract with my smartcontract with this web interface. Is this possible?
0
votes
1
answer
200
views
Sending ETH or Tokens from the command line to be integrated in a PHP script
I'm relatively new to using ETH on the command line. Do I use Geth or Parity? All I want to do is be able to send some ETH or Tokens from my eth private key. Which way is the best way to do it? I plan ...
1
vote
1
answer
475
views
Initiate transaction from server to smart contract
In my case, i have an API written in PHP which periodically checks the database. If certain condition was met, i need to send an alert message from the API to an account/node in the Ethereum ...
1
vote
1
answer
1k
views
Ethereum Transaction Using cUrl and web3.php, I get a Receipt but the Transaction is not sent to the Network
This has been doing my head in all day, after wading through and managing to get all my values converted to hex I create and sign the ethereum transaction using the web3p/ethereum-tx library from ...
1
vote
1
answer
266
views
My web3.php installation question
How can I install web3.php? Can I use shared hosting to run it or I must use vps, if I use vps I must use root to install web3.php? Thanks.
1
vote
0
answers
1k
views
Unable to locate package php5.6-mbstring [closed]
root@iZwz98r5jfsgx41dfymo6iZ:/usr/local/lib# sudo apt-get install php5.6-mbstring
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package ...
1
vote
1
answer
2k
views
Invalid sender when sending Raw Transaction, signed w/ ethereum-tx on PHP
I am using PHP and ethereum-tx library https://github.com/web3p/ethereum-tx to sign transactions but when trying to send them to the node I got an "invalid sender" error. Besides, exactly the same ...
2
votes
0
answers
85
views
Ethereum js wallet for php
https://github.com/ethereumjs/ethereumjs-wallet
I need this library with the same functions in PHP
Would u give me the link
0
votes
1
answer
876
views
how to pass value to contract via php (no java script)?
I wrote a contract that get a unit and do something
My question :
How to pass a value to this contract function via PHP? (not js,py,MetaMask, ... . just in php)
For example, I use this and install ...
0
votes
1
answer
960
views
How do I check the Ethereum balance and unique transactions count of a Smart Contract over a period of time?
Basically I want to be able to track smart contracts balance and unique transactions over a period of time such as , last 24hours, last hour and so.
What would be the best approach into doing this? ...
0
votes
1
answer
292
views
Unable to Generate Address Endpoint Blockcypher
I am trying to generate an address using Blockcyphers Address Endpoint using cUrl.
- https://api.blockcypher.com/v1/eth/main/addrs?token=eth
But it returns this error - "Endpoint not found. Please ...
0
votes
1
answer
410
views
getting result of a method of smart contract that don't change any state variables
I know in ethereum if a method of smart contract don't change state variables we can see it's result without making any transaction.
now I want to know how can see result of this method ...
2
votes
1
answer
697
views
Recovered Sender Address from Raw Transaction
I'm trying this code example : https://thomasclowes.com/verifying-an-ethereum-signature-on-the-server-php-2/
Expected $recoveredSenderAddress = 0xd5bfc359c3a377bb8afd41db8ffc8d1349718233
Actual $...
1
vote
1
answer
764
views
generating raw trx and sending it to the network shows "invalid sender" error
I'm trying to make an ethereum raw transaction by php and these libraries:
https://github.com/simplito/elliptic-php
https://github.com/kornrunner/php-keccak
https://github.com/web3p/rlp
this is my ...
1
vote
0
answers
184
views
Any easy php script to sign and send transactions maybe run contract also
Thanks I have JavaScript version but not php version especially for sign and send transaction
3
votes
2
answers
13k
views
How to fetch ETH/USD price from the coinmarketcap api
I want to fetch the current ETH-USD price from this api (https://api.coinmarketcap.com/v1/ticker/ethereum/?convert=USD). How do I fetch just the price into a variable in PHP for reuse on my ...
2
votes
0
answers
1k
views
How to transfer tokens from smart contract using PHP?
I want to transfer tokens using PHP script and that script will be executed using cronjob, is there library available to transfer by unlocking account using private key?
0
votes
1
answer
423
views
Ethereum-PHP How to receive outbound parameters from smart contract function
In contract sol file I have function definition:
function product(uint32 _prdId) public view
returns (uint32 prdId, string prdName, address prd, uint closeTime,
uint promoTime,uint8 bonus, ...
3
votes
1
answer
3k
views
Ethereum-PHP Calling contract function with parameter
I'm not the author of Ethereum part but have to connect to using php. Choosen Ethereum-PHP package (https://github.com/digitaldonkey/ethereum-php). Have connection to ethereum and smart contract but ...
4
votes
1
answer
2k
views
Ethereum address genеration and keccаk256
I'm trying to generate eth address on PHP. Having issue with keccak256.
I'm using this class: https://github.com/kornrunner/php-keccak
It works good, I checked many times on https://emn178.github.io/...
0
votes
2
answers
1k
views
How to make an action to send record to my database?
I want all transaction of the tokens send to my database through smart contract.
For example, A send 10Token to B, it will show on blockchain, but I also want a function which smart contract will let ...
2
votes
1
answer
2k
views
Failed RLPx handshake
I am trying to use https://github.com/kesar/ethereum-php on the back-end of my web site.
I followed a tutorial http://iotbl.blogspot.ca/2017/03/setting-up-private-ethereum-testnet.html to set up two ...