# ERC20 Upgradeable Initial Supply Issue

**URL:** <https://forum.openzeppelin.com/t/erc20-upgradeable-initial-supply-issue/5182>\
**Category:** Upgrades\
**Tags:** erc20\
**Created:** [December 27, 2020, 8:12am UTC](https://forum.openzeppelin.com/t/erc20-upgradeable-initial-supply-issue/5182 "2020-12-27T08:12:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmourey26](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/rmourey26/32/20786_2.png) [@rmourey26](https://forum.openzeppelin.com/u/rmourey26)\
**Post date:** [December 27, 2020, 8:12am UTC](https://forum.openzeppelin.com/t/erc20-upgradeable-initial-supply-issue/5182/1 "2020-12-27T08:12:56Z")

</div>

Deployed upgradeable ERC20, Proxy, and Admin based upon @abcoathup forum post for Upgradeable ERC20, token name, symbol, and supply were entered in 2\_deployer\_js script, I entered initial supply amount in the script to be 50,000 tokens, migrated it to live and only 0.0000.....5 tokens were actually deployed. And this seems to be because I should have added additional zeroes onto the 50,000 to account for ethereum number formatting standards....Am I correct in thinking this? Can I upgrade the contract to deploy the correct amount of tokens? I need to fix this as soon as possible @abcoathup

**💻 Environment**

 Truffle Upgrades 1.31, VSCode Wsl2, 

**📝Details**

 The upgraded ERC20 and migrations script did not deploy the correct amount of tokens. Nor did I notice any specific instructions regarding total supply input in js script.

**🔢 Code to reproduce**

 2\_deployment\_script 

```auto
const DAFI = artifacts.require('DaFi_ERC20_Upgrdbl');

const { deployProxy } = require('@openzeppelin/truffle-upgrades');

module.exports = async function (deployer, accounts) {

    await deployProxy(DAFI, ['Da-Fi Token', 'DAFI', '50000'], { deployer, initializer: 'initialize' });
};

```

Solidity Contract

```auto
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.5;

import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";

import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";

contract DaFi_ERC20_Upgrdbl is Initializable, ERC20Upgradeable { 

    function initialize( string memory name, string memory symbol, uint256 initialSupply

    ) public virtual initializer {__ERC20_init(name, symbol);

        _mint(_msgSender(), initialSupply);

    }

}

```

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [December 27, 2020, 9:44am UTC](https://forum.openzeppelin.com/t/erc20-upgradeable-initial-supply-issue/5182/2 "2020-12-27T09:44:53Z")

</div>

Yeah, the default decimals is 18, so if you want to set the total supply is `50000` token, it should be `5000 * 10 ** 18`, as for how to upgrade the contract, you can have a look at this article: [OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat](https://forum.openzeppelin.com/t/openzeppelin-upgrades-step-by-step-tutorial-for-hardhat/3580)

---

<div class="post-metadata">

**Author:** ![rmourey26](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/rmourey26/32/20786_2.png) [@rmourey26](https://forum.openzeppelin.com/u/rmourey26)\
**Post date:** [December 27, 2020, 11:21am UTC](https://forum.openzeppelin.com/t/erc20-upgradeable-initial-supply-issue/5182/3 "2020-12-27T11:21:49Z")

</div>

Thanks. I transferred ownership of the admin proxy into my gnosis safe. It then appears that I should be able to add a minter which would then allow me to mint the correct token amount, correct?

In terms of the total supply “formula” that you listed - do you mean that I can enter the exact sequence of numbers and operators you mentioned - 5000\*10\*\*18 directly into the java script migrations file in the exact location where I originally inputted 50000? Are you saying I wont have any issues with js or the compiler picking up the correct initial supply?

It baffles me that afer 10 years of innovations, upgrades, proxies, and now eth2 beacon chain that we still have to manually transform the initial supply to mesh with Ethereum…

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [December 30, 2020, 9:15am UTC](https://forum.openzeppelin.com/t/erc20-upgradeable-initial-supply-issue/5182/4 "2020-12-30T09:15:15Z")

</div>

Hi @rmourey26,

> [@rmourey26](#):
>
> It then appears that I should be able to add a minter which would then allow me to mint the correct token amount, correct?

You would need to upgrade to a new implementation contract which included the minting functionality to increase the supply, either as a one off or to allow further minting.
