solana-program-library/token-swap/program/src
Jon Cinque 75acddc100
Fix zero fee calculation (#813)
If a swap has a trading fee and a zero owner fee, when calculating the owner
fee to pool token conversion, the simulated trading fee will be non-zero
because we floor the trading fee to 1 token.  If the input to trading
fee calculation is 0, then we will try to do `0 - 1` on an unsigned int,
which causes an underflow error.  The fix is to simply return a 0 fee
for a 0 input.
2020-11-09 19:01:21 +01:00
..
curve Fix zero fee calculation (#813) 2020-11-09 19:01:21 +01:00
constraints.rs Refactor curve.rs (#754) 2020-11-02 14:29:00 +01:00
entrypoint.rs Drop lifetimes 2020-11-01 20:48:15 -08:00
error.rs Token-swap: Add "production mode" hard-coded fee constraints (#731) 2020-10-29 12:52:17 +01:00
instruction.rs Refactor curve.rs (#754) 2020-11-02 14:29:00 +01:00
lib.rs Back to no-entrypoint feature name 2020-11-03 10:34:43 -08:00
processor.rs Fix zero fee calculation (#813) 2020-11-09 19:01:21 +01:00
state.rs Refactor curve.rs (#754) 2020-11-02 14:29:00 +01:00