fix: Double-subtraction if stakingPoolAddr == feeDestination (#911)
This commit is contained in:
parent
dc9a053db4
commit
e4225b364b
1 changed files with 3 additions and 1 deletions
|
|
@ -325,7 +325,9 @@ contract LiquidityManager is ThreePositionStrategy, PriceOracle {
|
|||
supply -= kraiken.balanceOf(feeDestination);
|
||||
}
|
||||
(, address stakingPoolAddr) = kraiken.peripheryContracts();
|
||||
if (stakingPoolAddr != address(0)) {
|
||||
// Guard against double-subtraction: if stakingPoolAddr == feeDestination,
|
||||
// that balance was already deducted above.
|
||||
if (stakingPoolAddr != address(0) && stakingPoolAddr != feeDestination) {
|
||||
supply -= kraiken.balanceOf(stakingPoolAddr);
|
||||
}
|
||||
return supply;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue