Hi, I was wondering what’s the best way to handle uint greater than 256 bit in solidty. I currently need to calculate 2 simple formulas on-chain, but multiplications can easily overflow the 256 bit limit, 512 bit precision should be sufficient.

Is there any reliable library/package for doing this?

I found the following resources for the moment, but still not sure on what’s the best way of doing it:

- https://github.com/gnosis/solidity-arithmetic
- https://github.com/zcoinofficial/solidity-BigNumber
- https://medium.com/wicketh/mathemagic-full-multiply-27650fec525d

Also maybe worth mentioning that end results of the 2 formulas always fits the 256 bit limit.