Skip to content

Incorrect Token Value #1

@spmvoss

Description

@spmvoss

When you convert the token value from and to wei, you use the built in functions with the parameter 'ether'. However, if the number of decimals of the token that we are selling is different from that of (W)BNB this will give the incorrect value. You want to obtain the decimals from the token contract and then do something like

balance = raw_balance / math.pow(10, decimals)
raw_balance = balance * math.pow(10, decimals)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions