Do you guys have any idea how to fix this safemon’s hardcode issue? Certifik Foundation shows this issue in Safemoon’s security audit.
Contract gains non-withdrawableBNB via the swapAndLiquify function
The swapAndLiquify function converts half of the contractTokenBalance SafeMoon tokens to BNB.
The other half of SafeMoon tokens and part of the converted BNB are deposited into the SafeMoonBNB pool on pancakeswap as liquidity. For every swapAndLiquify function call, a small amount of BNB
leftover in the contract. This is because the price of SafeMoon drops after swapping the first half of
SafeMoon tokens into BNBs, and the other half of SafeMoon tokens require less than the converted
BNB to be paired with it when adding liquidity. The contract doesn’t appear to provide a way to
withdraw those BNB, and they will be locked in the contract forever.
It’s not ideal that more and more BNB are locked into the contract over time. The simplest solution is to
add a withdraw function in the contract to withdraw BNB. Other approaches that benefit the SafeMoon
token holders can be:
- Distribute BNB to SafeMoon token holders proportional to the amount of token they hold.
- Use leftover BNB to buy back SafeMoon tokens from the market to increase the price of
The screenshot talking about it