Very Interesting problem. ( Upgradeable contract on pancakeswap, transfer failed after upgrade )

I am facing "PancakeSwap: Transfer Failed " issue after upgrading my contract to a new version. There are many doubts in my mind but I want to take your valuable opnions.

:computer: Environment

:memo:Details

So, my pair was working fine on pancakeswap. I had to add some new functionality in the token contract. I did that, and upgraded using proxy contract. When I did that, total supply became 0 but holders still had the balance. I was worried as it was live, I reverted back to old token contract ( before upgrade ). Now, Supply was normal again, everything was working BUT when doing SWAP on pancakeswap, it throws an error from its pair or router contract I guess, where it checks the abi of the contract ( thats my doubt ) and could succeed throwing this error. " PancakeSwap: Tranfsfer Failed ". I am attaching error originated code below.

:1234: Code to reproduce
Following is the code from where error is thrown ( it pancakeswap router )

function _safeTransfer(address token, address to, uint value) private {
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), ‘Pancake: TRANSFER_FAILED’);
}

Hi @xtremist please use the search bar to search for issues when cloning a SafeMoon contract. There are too many similar topics.

1 Like