solana-program-library/token-swap/program/src
Jon Cinque d336b8b714
stake-pool: Use checked_ceil_div for withdraw calc (#1482)
* stake-pool: Use checked_ceil_div for withdraw calc

When a stake account is totally removed from a stake pool by the
manager, there's a chance that the operation would not take enough of
the manager's pool tokens by 1 due to truncation.

Do a ceiling division instead, and refactor ceiling division into the
math library.

* Use new function name on CLI

* Cargo fmt
2021-03-23 00:33:51 +01:00
..
curve stake-pool: Use checked_ceil_div for withdraw calc (#1482) 2021-03-23 00:33:51 +01:00
constraints.rs token-swap: Refactor for new curves (#930) 2020-12-08 18:22:32 +01:00
entrypoint.rs Drop lifetimes 2020-11-01 20:48:15 -08:00
error.rs token-swap: Add offset curve and math (#935) 2020-12-10 18:31:21 +01:00
instruction.rs Clippy 2021-03-16 18:33:37 -07:00
lib.rs Update rust stable to 1.49 (and add token swap program id) (#1158) 2021-02-04 14:20:15 +01:00
processor.rs token-swap: Add version to state (#985) 2021-02-04 15:22:33 +01:00
state.rs Clippy 2021-03-16 18:33:37 -07:00