Skip to content

uint64 for lamports or token input amount will overflow #314

@0xZex

Description

@0xZex

I found that in the instruction packages for computebudget, token, and system, the type for amounts is uint64. We know that the maximum value for uint64 is 2**64-1, which is 18446744073709551615. According to Solana's precision of 9, it supports a maximum of 18.4 billion.

In Go, if a value exceeds the range, it won't throw an error; instead, it automatically truncates the high bits and retains only the low 64 bits.

Is there any plan to introduce the math/big package?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions