I made token based on Openzeppelin ERC20.
Few days before, StandardToken.sol which I imported changed some of its state variables(total supply_, balances) from internal to private. github history

After changing, my token does not work anymore.
Is there any other ways to import and using the StandardToken?

I use remix IDE.


  • This is part of a rather large release, which introduces API-breaking changes. It is due to be officially released on September 1. You can fix your contracts accordingly, or use OpenZeppelin v1.12.0. Whenever you update your OpenZeppelin code from the Master branch, you might experience API-breaking changes (although they are generally rare from what I've noticed). – goodvibration Aug 19 '18 at 12:29
  • @goodvibration Thanks. It was so embarassed to me when the compiler make some errors. Thanks for your help! – Ingyun Son Aug 19 '18 at 12:32

The commit introduced methods _mint, _burn and _burnFrom. These can be used to alter the balances in a safer way than just updating the balances mapping. I suggest you just use these.

As for getting a balance: use the balanceOf method.


As @goodvibration commented below:

You'd better wait until the official release is out before using any new functionality.

  • He would probably be better off waiting until the official release is out. These guys have been applying changes quite often recently. The latest official release (v1.12.0) does not include those changes. – goodvibration Aug 19 '18 at 12:33

As of 21st October 2018, OpenZeppelin 2.0 is officially released and it appears the goal is now to keep it stable:

The major feature in this release is that we are now commiting to a stable API. In the process of stabilizing we've also reviewed a lot of the existing API in order to ensure a more straightforward experience for users.

Also, the rationale for making variables like balances private:

All state variables are now private, which means that derived contracts cannot access them directly, but have to use getters. This is to increase encapsulation, to be able to reason better about the code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.