Questions tagged [php]

Questions regarding the use of the PHP scripting language with Ethereum.

Filter by
Sorted by
Tagged with
2 votes
1 answer
88 views

Why there is no private key in sending transaction code in Web3.php?

I want to use Web3.php so that I send contract transaction to Ethereum blockchain. I use the following code: $web3 = new Web3('... node address ...'); $contract = new Contract($web3->provider, $...
Alireza Zojaji's user avatar
0 votes
0 answers
13 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&...
thu anh's user avatar
  • 11
0 votes
1 answer
81 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 ...
Falcon Stakepool's user avatar
0 votes
0 answers
23 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', //...
Usman Raza's user avatar
0 votes
0 answers
84 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" => "...
pan's user avatar
  • 1
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!
drei-sys's user avatar
1 vote
0 answers
108 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 & ...
purephp's user avatar
  • 11
1 vote
1 answer
91 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 ...
cryptonub's user avatar
1 vote
1 answer
682 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 ...
Gniax's user avatar
  • 21
0 votes
1 answer
622 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-...
AMHF's user avatar
  • 1
1 vote
0 answers
574 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-...
Joe Brown's user avatar
0 votes
1 answer
272 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 ...
lama's user avatar
  • 1
1 vote
0 answers
538 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' . ...
Vincent's user avatar
  • 123
0 votes
2 answers
847 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" ...
chali's user avatar
  • 1
0 votes
0 answers
90 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 ...
Abinaya Sethuraman's user avatar
2 votes
1 answer
232 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.
leycun's user avatar
  • 133
1 vote
1 answer
898 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: ...
atwellpub's user avatar
  • 121
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.
good_evening's user avatar
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 ...
good_evening's user avatar
0 votes
1 answer
90 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 ?.....
developer base's user avatar
1 vote
1 answer
559 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 ...
developer base's user avatar
4 votes
2 answers
2k 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 ...
Gall Annonim's user avatar
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?
Agilulfo's user avatar
0 votes
0 answers
227 views

eth_sendTransaction gas required exceeds allowance

$result = $client->callMethod('eth_sendTransaction', [array( "from" => $address->address, "to" => "0xac52822dde76b9c4cd701d5f4402acedb2a86cc1", ...
Petr Marek's user avatar
2 votes
0 answers
477 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","...
Gagandeep Singh's user avatar
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( '...
Mohammad Saberi's user avatar
0 votes
1 answer
123 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 ...
Dazzle's user avatar
  • 111
1 vote
1 answer
245 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 ...
Mohammad Saberi's user avatar
0 votes
0 answers
274 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 ...
Barney Chambers's user avatar
1 vote
2 answers
251 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?
artem's user avatar
  • 13
0 votes
1 answer
209 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 ...
Patoshi パトシ's user avatar
1 vote
1 answer
484 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 ...
Sienz Pz's user avatar
2 votes
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 ...
Corey's user avatar
  • 21
1 vote
1 answer
270 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.
Louis's user avatar
  • 1,155
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 ...
user10206110's user avatar
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 ...
Juan Ignacio Pérez Sacristán's user avatar
2 votes
0 answers
87 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
FreeJoyMan's user avatar
0 votes
1 answer
882 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 ...
FreeJoyMan's user avatar
0 votes
1 answer
1k 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? ...
Demeterca Ionuţ-Alexandru's user avatar
0 votes
1 answer
307 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 ...
Ryan D's user avatar
  • 125
0 votes
1 answer
434 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 ...
saeid ezzati's user avatar
2 votes
1 answer
713 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 $...
vincentLg's user avatar
  • 281
1 vote
1 answer
787 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 ...
saeid ezzati's user avatar
1 vote
0 answers
188 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
Louis's user avatar
  • 1,155
3 votes
2 answers
14k 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 ...
optimalresource's user avatar
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?
Kamran Jabbar's user avatar
0 votes
1 answer
427 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, ...
Tom B's user avatar
  • 35
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 ...
Tom B's user avatar
  • 35
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/...
toptrader's user avatar
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 ...
Alan Li's user avatar