AVM icon indicating copy to clipboard operation
AVM copied to clipboard

(!) BigInteger should specify range explicitly

Open fulldecent opened this issue 6 years ago • 2 comments

BigIntegers are limited in the AVM ABI at:

https://github.com/aionnetwork/AVM/blob/master/org.aion.avm.userlib/src/org/aion/avm/userlib/abi/ABIStreamingEncoder.java#L480

a) This limitation is not specified in documentation. https://github.com/aionnetwork/docs/issues/64 b) The actual limits of the BigIntegers should be mentioned in code for clarity. I think it will be [-2^255, 2^255 - 1]. But the exact number is useful to document.

fulldecent avatar Aug 12 '19 22:08 fulldecent

Requesting assistance @jeff-aion

fulldecent avatar Aug 24 '19 03:08 fulldecent

Experiments done here https://github.com/fulldecent/aion-aip040/commit/53b77b9f37fd18046db83cf6efa95c101c93e771

Found that BigInteger can exceed 2^255 but not when encoding to ABI.

fulldecent avatar Aug 24 '19 03:08 fulldecent