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

(!) BigInteger should specify range explicitly #408

Open
fulldecent opened this issue Aug 12, 2019 · 2 comments
Open

(!) BigInteger should specify range explicitly #408

fulldecent opened this issue Aug 12, 2019 · 2 comments

Comments

@fulldecent
Copy link
Contributor

fulldecent commented Aug 12, 2019

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. aionnetwork/aion-docs#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 fulldecent changed the title BigInteger should specify range explicitly (!) BigInteger should specify range explicitly Aug 21, 2019
@fulldecent
Copy link
Contributor Author

Requesting assistance @jeff-aion

@fulldecent
Copy link
Contributor Author

Experiments done here fulldecent/aion-aip040@53b77b9

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

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