Skip to content

GlobalVersions.md: wrong GETORIGINALFWDFEE formula #1878

@pyAndr3w

Description

@pyAndr3w

GlobalVersions.md states that GETORIGINALFWDFEE returns fwd_fee * 2^16 / first_frac, but the actual opcode in crypto/vm/tonops.cpp computes fwd_fee * 2^16 / (2^16 - first_frac)

Please update the changelog so the documented formula matches the real calculation.

* `GETORIGINALFWDFEE` (`fwd_fee is_mc - orig_fwd_fee`) - calculate `fwd_fee * 2^16 / first_frac`. Can be used to get the original `fwd_fee` of the message.

stack.push_int(td::muldiv(fwd_fee, td::make_refint(1 << 16), td::make_refint((1 << 16) - prices.first_frac)));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions