neo-go icon indicating copy to clipboard operation
neo-go copied to clipboard

Mention token amount limits in balance readers

Open cthulhu-rider opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

some tokens are limited in quantity. For example, NEO <= 100KK according to docs. This limit is missing in https://pkg.go.dev/github.com/nspcc-dev/neo-go/pkg/rpcclient/neo (in particular https://pkg.go.dev/github.com/nspcc-dev/[email protected]/pkg/rpcclient/neptoken#Base.BalanceOf). This complicates code checks and optimization like using fixed bitsize math instead of big integers if possible

Describe the solution you'd like

mention limits in BalanceOf methods' docs

Describe alternatives you've considered

do not touch

Additional context

* inspired by https://github.com/nspcc-dev/neofs-node/pull/2683#discussion_r1430019625

cthulhu-rider avatar Dec 18 '23 12:12 cthulhu-rider

Technically, you have NEP-17 totalSupply to get it and that's the standard NEP-17 way. At the same time it's well-known for NEO and won't change.

roman-khimov avatar Dec 18 '23 13:12 roman-khimov

@roman-khimov, i thought about checking limits against totalSupply but this seems an overhead to me when it returns static value like for NEO

cthulhu-rider avatar Dec 18 '23 14:12 cthulhu-rider