You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 11, 2025. It is now read-only.
* token-2022: Add scaled amount extension
#### Problem
The interest-bearing extension is useful for tokens that accrue in value
constantly, but many "rebasing" tokens on other blockchains employ a
different method of updating the number of tokens in accounts.
Rather than setting a rate and allowing the number to change
automatically over time, they set a scaling factor for the tokens by
hand.
#### Summary of changes
Add a new `ScaledUiAmount` extension to token-2022 for doing just that.
This is essentially a simplified version of the interest-bearing
extension, where someone just sets a scaling value into the mint
directly. The scale has no impact on the operation of the token, just on
the output of `amount_to_ui_amount` and `ui_amount_to_amount`.
* Add timestamp, rename to "multiplier"
* Update token/program-2022/src/extension/scaled_ui_amount/mod.rs
Co-authored-by: samkim-crypto <[email protected]>
* Address feedback
---------
Co-authored-by: samkim-crypto <[email protected]>
0 commit comments