permaweb / aos

An operating system for AO: The hyper parallel computer
https://ao.g8way.io
Other
69 stars 48 forks source link

bug(token blueprint): large token supplies generate error #354

Open hitwill opened 3 days ago

hitwill commented 3 days ago

a bint error is generated for large token supplies:

{
  "Messages": [],
  "Assignments": [],
  "Spawns": [],
  "Output": "",
  "GasUsed": 0,
  "Error": "[string \".handlers\"]:345: [string \".bint\"]:787: value cannot be represented by a bint"
}

This is when eval is run, for example, for 100_000_000 token supply.

See this process for a test error: https://www.ao.link/#/message/kiatehaCRc-78D6ZU_QoYi1l0QClrwoWlWq1jf4xAfc

twilson63 commented 1 day ago

if planning to use large initial supply numbers maybe wrap supply in bint before calc

Balances = Balances or { [ao.id] = utils.toBalanceValue(bint(10000) * 10 ^ Denomination) }
TotalSupply = TotalSupply or utils.toBalanceValue(bint(10000) * 10 ^ Denomination)