web3p / web3.php

A php interface for interacting with the Ethereum blockchain and ecosystem. Native ABI parsing and smart contract interactions.
MIT License
1.16k stars 543 forks source link

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

Closed mgx888 closed 5 months ago

mgx888 commented 5 months ago

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???