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

**URL:** <https://forum.openzeppelin.com/t/very-interesting-problem-upgradeable-contract-on-pancakeswap-transfer-failed-after-upgrade/8099>\
**Category:** Support\
**Tags:** erc20, proxies\
**Created:** [May 11, 2021, 4:59am UTC](https://forum.openzeppelin.com/t/very-interesting-problem-upgradeable-contract-on-pancakeswap-transfer-failed-after-upgrade/8099 "2021-05-11T04:59:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xtremist](https://avatars.discourse-cdn.com/v4/letter/x/9de0a6/32.png) [@xtremist](https://forum.openzeppelin.com/u/xtremist)\
**Post date:** [May 11, 2021, 4:59am UTC](https://forum.openzeppelin.com/t/very-interesting-problem-upgradeable-contract-on-pancakeswap-transfer-failed-after-upgrade/8099/1 "2021-05-11T04:59:45Z")

</div>

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.

**💻 Environment**

**📝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.

**🔢 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’);  
}

---

<div class="post-metadata">

**Author:** ![Yoshiko](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/yoshiko/32/6858_2.png) [@Yoshiko](https://forum.openzeppelin.com/u/Yoshiko)\
**Post date:** [May 11, 2021, 9:20pm UTC](https://forum.openzeppelin.com/t/very-interesting-problem-upgradeable-contract-on-pancakeswap-transfer-failed-after-upgrade/8099/2 "2021-05-11T21:20:50Z")

</div>

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

[https://forum.openzeppelin.com/t/safemoon-fork-lp-issue/7612](https://forum.openzeppelin.com/t/safemoon-fork-lp-issue/7612)

> [@Execution revert error when deploying Safemoon fork on Rinkeby with Remix](https://forum.openzeppelin.com/t/execution-revert-error-when-deploying-safemoon-fork-on-rinkeby-with-remix/7222):
>
> I’m trying to deploy a Safemoon fork on Rinkeby but it kept getting reverted without giving me any log message. This is all I get: false Transaction mined but execution failed How do I get the log to identify the bugger. Remix debugger doesn’t seem to work for this contract

> [@SafeMoon fork problems with LP](https://forum.openzeppelin.com/t/safemoon-fork-problems-with-lp/6757):
>
> Hello everyone, First of all I'd like to thank you for providing this opportunity. Maybe there's someone who will help me, and it wouldn't be possible without this platform! I've merged various forks from popular contracts, most notably SafeMoon, and launched my token through DXSale. The Token has 4 basic functions: On every transaction, 5% is burnt, 5% is redistributed, and 5% is added to LP. Additionally, the maximum transaction is capped at 5000 Tokens (0.5% of supply) There is an issue w…

> [@Solidity learning resources](https://forum.openzeppelin.com/t/solidity-learning-resources/4242):
>
> The following is a list of Solidity learning resources. This is a wiki post that you can edit and add to. OpenZeppelin Learn Guides [https://docs.openzeppelin.com/learn/](https://docs.openzeppelin.com/learn/)Play [Ethernaut](https://ethernaut.openzeppelin.com/) + [Ethernaut Community Solutions](https://forum.openzeppelin.com/t/ethernaut-community-solutions/561)[Damn Vulnerable DeFi](https://www.damnvulnerabledefi.xyz/) + [Community Solutions to Damn Vulnerable DeFi](https://forum.openzeppelin.com/t/community-solutions-to-damn-vulnerable-defi/4744)books Read Security Audits Best practices [https://consensys.github.io/smart-contract-best-practices/](https://consensys.github.io/smart-contract-best-practices/)Books Articles/Posts [What are your top three recommendations for a new developer in the spa…](https://forum.openzeppelin.com/t/what-are-your-top-three-recommendations-for-a-new-developer-in-the-space/862)

---

<div class="post-metadata">

**Author:** ![Antonia\_Sa](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/antonia_sa/32/6221_2.png) [@Antonia\_Sa](https://forum.openzeppelin.com/u/Antonia_Sa)\
**Post date:** [December 2, 2021, 7:39pm UTC](https://forum.openzeppelin.com/t/very-interesting-problem-upgradeable-contract-on-pancakeswap-transfer-failed-after-upgrade/8099/3 "2021-12-02T19:39:24Z")

</div>

Could you solve the issue? I have also my contract with tokenomics in higher version 0.8.0 and getting exactly same issues
