Comments (8)
uint[] is not supported the library yet. I consider to add https://github.com/sc0Vu/rlp but I need to do some Drupal work first.
from ethereum-php.
Without uint[]
I'm getting the exception
Call to a member function convertByAbi() on integer
raised by the function getMethodParams($m, $values) of the file SmartContract.php on line 138
$validAbiType = $val->convertByAbi($expectedType);
This is the new declaration of the function getProductById on the smart contract:
function getProductById(uint id) public view
returns (
uint,
string,
bytes32,
uint,
uint,
bool
) {
...
}
I would like to know if this exception is related to this issue.
Thank you
from ethereum-php.
"Call to a member function convertByAbi() on integer" means that the integer is not a Instance of EthD.
Your calls should look similar to
$contract->getProductById(new EthQ($yourInt))
from ethereum-php.
The call you mentioned gives me again the exception
NOT IN RANGE: 1277465586268147 ... ... ... 887421292544000 > (u)int256
Instead, it works with smart contract functions that returns one value only. For example this is the function on the smart contract side:
function getProductName(uint id) public view returns (string) { ... }
and, in this case, the following call works correctly
$prdName = $instance->getProductName(new EthQ(123));
I didn't get if I don't use properly your library or the feature with multiple values in return is not supported.
from ethereum-php.
Hi,
What syntax should be used for receiving outbound parameters?
function getProductById(uint32 id) public view
returns (
uint,
string,
bytes32,
uint,
uint,
bool
)
To call above function I'm using:
$result = $schemaContract->getProductById(new EthQ($number, ['abi'=>'uint32']));
But 'left' part ($result) is wrong because function getProductById returns many parameters.
Can you help me how above syntax should looks like to get many outbound parameters?
Is it possible with your library or it is not supported yet?
Thx
from ethereum-php.
As far as I understand without actual testing you are returning a list value, which is not supported yet.
You might add your contract and some test to the test contracts.
from ethereum-php.
Let's get some test Data from https://ethereum.stackexchange.com/a/681/852
from ethereum-php.
Should work now, but needs more testing.
https://github.com/digitaldonkey/ethereum-php/tree/dev
from ethereum-php.
Related Issues (20)
- Unable to use address parameter for ERC20 contracts HOT 6
- About php version 7.2 HOT 2
- Class 'Ethereum\DataType\Ethereum' not found HOT 1
- [Question] process log from another contract
- Add bytes32[] return type support
- Unable to connect when $eth->eth_protocolVersion HOT 2
- Support for Diamonds
- Plans for writing to blockchain HOT 1
- How to make encode with uint256[10] in php
- Guzzle Issue HOT 2
- Please provide an example for call sendRawTransaction HOT 1
- Unknown ABI type: tuple[] HOT 4
- Cannot unmarshal hex number with leading zero digits into Go struct field
- How can I call the contract method 'getAmountsOut' with 'address[]' params? HOT 1
- Need Help For ERC-721
- i have a error when i use ethereum-php-eventlistener HOT 2
- When preloading enabled nested package pear/math_biginteger undefined constant error
- 0x1234567890123456789012345678901234567890
- Add support to Hardhat encoded ABI HOT 1
- Create Wallet HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereum-php.