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

Fix HEX encoding for very large numbers - issue #268 #291

Open kaiesh opened 2 years ago

kaiesh commented 2 years ago

Very large non-negative numbers are encoded to hex strings in excess of 64 chars - this is due to Two's Complement representation being set to true on these non-negative numbers.

This minor edit ensures that Two's Complement representation on hex conversion is only applied when the number is actually negative.