14 questions
Score of 2
1 answer
94 views
Ethers.js can call fetchMarketItems() fine, but PHP (web3p/web3.php) fails to decode the tuple[] return — how do I read struct[] results?
I have an NFT marketplace contract running on a local Hardhat node. The function below returns an array of structs:
struct MarketItem {
uint256 tokenId;
address payable seller;
address ...
Score of 1
0 answers
147 views
Why do I get "Error sending transaction: unmarshal transaction failed" when using the Web3PHP library?
I'm encountering an issue while trying to send a transaction using the Web3PHP library. Here is the error am getting:
An error occurred: Error sending transaction: unmarshal transaction failed
This ...
Score of 0
1 answer
268 views
Problem in calling an Ethereum contract method using Web3.php
I am using Web3.php to read an ERC20 token balance of a wallet from its contract.
use Web3\Web3;
use Web3\Contract;
use Web3\Utils;
$web3 = new Web3('https://...');
$contractAbi = file_get_contents(&...
Score of 2
1 answer
1768 views
WEB3.PHP Contract Call
I am using this PHP library https://github.com/web3p/web3.php to make the requests to smart contracts on BSC.
$web3 = new Web3('https://bsc-dataseed.binance.org');
$contract = new Contract($web3->...
Score of 1
0 answers
291 views
Get past transactions on a contract using web3.php
I am using web3.php script and need to get minted NFT IDs from a contract.
Solution I think about is to read past contract "transfer" events and get tokenId from its data.
but couldn't find ...
Score of 1
0 answers
1010 views
PHP get estimate GAS using web3 php
I have been stuck for a couple of days while sending money using web3 PHP. Everything is working fine, and others are getting transferred to address successfully. But I am having some issues while ...
Score of 0
0 answers
2520 views
PHP web3 ERC20 token function call
I have a Smart Contract that represent ERC20 token. I already deployed the smart contract on Binance Testnet using HardHat.
I have a deployed Smart Contract address as well.
I have integrated Web3 ...
Score of 2
1 answer
1045 views
trying to store data on external ipfs node via http api , ipfs.infura.io refusing my connection
I'm trying to store data to ipfs via PHP, I use curl to communicate with API , it works fine on my local node, but I want to use an external node from infura.io
but for some reason, ipfs.infura.io is ...
Score of 0
1 answer
1003 views
Connect web3 php to ropsten test network
I successfully connect ganache blockchain to web3 php, this is some source code in laravel controller :
public function DecetralizeID(){
$contractABI = //[{*some abi*}]
$contract = new Contract('http:...
Score of 0
1 answer
150 views
How to get completed, failed, pending status after erc20token transfer
I have a function in node.js to transfer erc20tokens using api like this:
app.post('/sendtokens', async(req, res) =>{
console.log(req.body)
let privateKey = req.body.privateKey;
let ...
Score of 0
0 answers
478 views
First parameter must either be an object or the name of an existing class on Web3 on PHP
I am creating an ERC Token selling website. When a user signs up on the website, there should be generated an eth wallet automatically for that user and to store in db. After that when ever the user ...
Score of 3
2 answers
5634 views
Verifying Ethereum (Web3) signed message in PHP
How can i verify Ethereum signed messase with PHP?
Message is signed using web3.personal.sign function in Web3.js and signature is then sent to server. How can I verify it with PHP?
Are there some ...
Score of 0
1 answer
1000 views
(MAC) PHP Fatal error: Uncaught Error: Class 'Web3\Web3' not found
I'm new to PHP, and I was trying to run
$exampleBase.php from web3.php on mac
but it keeps showing error :
PHP Fatal error: Uncaught Error: Class 'Web3\Web3' not found in /Users/hsnl/Desktop/code/...
Score of 1
1 answer
1631 views
PHP array in callback smart contract web3.php
I try to read out a smart contract with web3.php, which works fine now, but I always only can read out a function, that returns a single value. When I call a function that returns for example a uint8 ...