# How to transfer tokens between smart contracts?

I am trying to understand exactly how can I transfer ERC20 tokens between contracts.

In my case, these contracts are basically the same and they are different versions of the same contract. To put it in a scenario: let's imagine I have released a smart new token based on ERC20 and used it in an ICO. Then I found a bug in my contract that I solved in the dev environment.

The question is: How do I transfer the data stored in the first contract (deployed) to the second one (after deployment of the dev contract), when it comes to the tokens and the balances?

• You can not transfer data from one contract to other (same or different) contract. – Sayed Tauseef Haider Naqvi Jun 28 '18 at 16:18

Your ERC20 token contract's balances variable should be public so you can just read the data and write the same data to the new contract.