I'm trying to ramp up on defi so I'm testing deploying Safemoon and and running some test buys and sells via HardHat on a forked mainnet. Im able to automatically deploy the contract successfully and add liquidity, but test buys (swapExactETHForTokensSupportingFeeOnTransferTokens) only works for the contract owner. Otherwise I get a 'Pancake: TRANSFER_FAILED' error.
I looked at the Pancakeswap core smart contracts and see that this error is generated when _safeTransfer fails, and _safeTransfer is called during a swap in UniswapV2Pair::swap and UniswapV2Pair::skim. This presumably means there was an issue transferring tokens out of the LP to the person doing the swap - does anyone have an idea why this happens? Is it possible to test deploying and swapping a new token on a forked mainnet?
Thank you!