Questions tagged [php]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
69 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 ...
user avatar
  • 1
0 votes
0 answers
197 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' . ...
user avatar
  • 113
0 votes
0 answers
141 views

I can't connect metamask app to site in metamask internal browser

I am trying to connect metamask app to my site by using the metamask internal browser on mobile device. But after connected to site, metamask wallet connection is not working. it is working well in ...
user avatar
0 votes
1 answer
113 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" ...
user avatar
  • 1
0 votes
0 answers
38 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 ...
user avatar
0 votes
0 answers
23 views

The Ethereum node gives an error and writes off all funds

Colleagues, hello! Help me understand and solve the problem with the ether node. We execute a request in our node with the following code eth.sendTransaction ({from: '...
user avatar
  • 1
0 votes
0 answers
324 views

Simple CoinGecko API Call in PHP

How can i add the symbol tag (replace 0) which coin i want fetch? <?php ini_set('max_execution_time', 300); $url ='https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd';// path to your ...
user avatar
1 vote
1 answer
127 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.
user avatar
  • 58
0 votes
1 answer
504 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: ...
user avatar
  • 101
4 votes
1 answer
836 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.
user avatar
2 votes
1 answer
2k 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 ...
user avatar
0 votes
1 answer
77 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 ?.....
user avatar
1 vote
1 answer
414 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 ...
user avatar
4 votes
2 answers
737 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 ...
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?
user avatar
0 votes
0 answers
113 views

eth_sendTransaction gas required exceeds allowance

$result = $client->callMethod('eth_sendTransaction', [array( "from" => $address->address, "to" => "0xac52822dde76b9c4cd701d5f4402acedb2a86cc1", ...
user avatar
2 votes
0 answers
336 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","...
user avatar
1 vote
1 answer
906 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( '...
user avatar
0 votes
1 answer
90 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 ...
user avatar
  • 111
1 vote
1 answer
189 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 ...
user avatar
0 votes
0 answers
212 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 ...
user avatar
1 vote
2 answers
207 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?
user avatar
  • 13
0 votes
1 answer
168 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 ...
user avatar
1 vote
1 answer
358 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 ...
user avatar
1 vote
1 answer
982 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 ...
user avatar
  • 11
1 vote
1 answer
200 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.
user avatar
  • 975
1 vote
0 answers
960 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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
2 votes
0 answers
66 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
user avatar
0 votes
1 answer
682 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 ...
user avatar
0 votes
1 answer
663 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? ...
user avatar
0 votes
1 answer
204 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 ...
user avatar
  • 125
0 votes
1 answer
280 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 ...
user avatar
2 votes
1 answer
516 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 $...
user avatar
  • 281
1 vote
1 answer
590 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 ...
user avatar
1 vote
0 answers
133 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
user avatar
  • 975
3 votes
2 answers
10k 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 ...
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?
user avatar
0 votes
1 answer
269 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, ...
user avatar
  • 35
3 votes
1 answer
2k 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 ...
user avatar
  • 35
3 votes
1 answer
1k 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/...
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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
1 vote
1 answer
313 views

Dapp fundamental q about listening solidity events

Sol: I created contract with events that are raised when is called some function. Html fo: Those functions are called via web3.js with abi and address - easy. Backend (no js) asp or php: I am not ...
user avatar
  • 13
1 vote
2 answers
6k views

How to transfer ETH between two addresses using geth and json rpc

I have geth running on my server. I am building a php website which act as wallet. Now iam able to create addresses. I need to be able to deposit and withdraw ETH between addresses on same node. I ...
user avatar
  • 167
1 vote
1 answer
5k views

Interact with MetaMask via PHP

I can easily interact with metamask via web3 js like this (JS): web3 = new Web3(web3.currentProvider); Is it possible to interact with metamask via php? For example (PHP): $ethereum = new Ethereum('...
user avatar
2 votes
2 answers
1k views

Why doesn't my verification of a signed message signature work in PHP?

I am attempting to verify a signed message in PHP. To be clear, I am not looking to interface with JSON-RPC or any external service, which I both a) know works and b) successfully verifies the ...
user avatar
0 votes
1 answer
1k views

Automating Listing Addresses and Balances Using PHP

I want to incorporate a javascript in php that list all the accounts and shows balances for those. This is my script for that: <script language="javascript"> function checkAllBalances() { var ...
user avatar
1 vote
1 answer
2k views

Generate Ethereum address in PHP?

I am working on a web application where I need to generate Ethereum addresses in PHP, how do i go about generating a random Ethereum public/private key pair in PHP? thanks.
user avatar
0 votes
1 answer
3k views

Is there a way to read data from smart contract using PHP?

I have a smart contract. All what I need is to make a PHP script that will get some public data from smart contract using it's address. How can I do that? Maybe there is some libraries?
user avatar