Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decodeParameters($types, $param) decode uint256[] Cannot return decimals #353

Closed
mgx888 opened this issue Apr 25, 2024 · 0 comments
Closed

Comments

@mgx888
Copy link

mgx888 commented Apr 25, 2024

decodeParameters($types, $param) decode uint256[] Cannot return decimals,Only return integers;

$ethabi = new Ethabi($this->abi);
$balance ='0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000001';
$balance = $ethabi->decodeParameter('uint256[]', $balance);
return $balance[1]; // 1
Returned 1,
It should have been 1.8321 Such decimals;

How to handle it???

@mgx888 mgx888 closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant