Skip to content

Commit

Permalink
Allow disabiling autoLiquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
meetmangukiya committed Aug 29, 2021
1 parent 1c35718 commit 6ef98e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CAKEBANK.sol
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,12 @@ contract CAKEBANK is ERC20, Ownable {
uint256 marketingTokens = contractTokenBalance.mul(marketingFee).div(totalFees);
swapAndSendToFee(marketingTokens);

uint256 swapTokens = contractTokenBalance.mul(liquidityFee).div(totalFees);
swapAndLiquify(swapTokens);
// do not add liquidity if liquidity fee is 0, i.e. ability to disable adding liquidity by setting
// liquidityFee to 0.
if (liquidityFee > 0) {
uint256 swapTokens = contractTokenBalance.mul(liquidityFee).div(totalFees);
swapAndLiquify(swapTokens);
}

uint256 sellTokens = balanceOf(address(this));
swapAndSendDividends(sellTokens);
Expand Down

0 comments on commit 6ef98e1

Please sign in to comment.