Did swapAndLiquify actually executed? - in safemoon

I’m trying to understand the flow of safemoon, but I’m stuck at the _transfer function.

I deployed the token onto bsc testnet.
When the token is deployed, total supply are transfer to owner.
Then I used this site https://pancake.kiemtienonline360.com/#/swap to add liquidity.
After add liquidity the token is then transfer to another address.

My question is balanceOf(address(this)) always return 0.
Do address(this) always point to the contract address? Or the address that holds the token?

if balanceOf(address(this)) is always 0, then swapAndLiquify will never be executed.
Please do help me to understand this. Thanks

2 Likes

at start the contract token address will have 0 tokens, the initial tokens are stored on the owners wallet , but as the transfer liquity pool fees take effect the contract token address will start to grow until it reaches numTokensSellToAddLiquidity and activate swap and liquify!

The contract owner is excluded from fees. You need to transfer tokens between addresses which are not excluded if you wanna see the contract’s balance grow…