CashScript / cashscript

⚖️ Easily write and interact with Bitcoin Cash smart contracts
https://cashscript.org
MIT License
111 stars 77 forks source link

Documentation Integer handling VM #193

Closed mr-zwets closed 1 month ago

mr-zwets commented 1 month ago

VM numbers are not just hex, they need a very specific encoding for which users should use

binToHex(bigIntToVmNumber(inputs0tokenAmount))

VM numbers can be positive and negative, which some users might not realize?

VM calculations also fail on 64 bit overflow, all of this is important to contract authors but not documented in CashScript currently.

Maybe there should also be a note about negative zero (any special edge cases there?)