# How to use ERC20PresetMinterPauserUpgradeable preset

**URL:** <https://forum.openzeppelin.com/t/how-to-use-erc20presetminterpauserupgradeable-preset/5168>\
**Category:** Contracts\
**Tags:** erc20, upgrades\
**Created:** [December 25, 2020, 2:42am UTC](https://forum.openzeppelin.com/t/how-to-use-erc20presetminterpauserupgradeable-preset/5168 "2020-12-25T02:42:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![platocrat](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/platocrat/32/3914_2.png) [@platocrat](https://forum.openzeppelin.com/u/platocrat)\
**Post date:** [December 25, 2020, 2:42am UTC](https://forum.openzeppelin.com/t/how-to-use-erc20presetminterpauserupgradeable-preset/5168/1 "2020-12-25T02:42:29Z")

</div>

I’m relatively new to how to write upgradeable contracts.  
I want to use the ERC20PresetMinterPauserUpgradeable.sol preset for my contract but I’m confused about how to implement it.

I saw this [example](https://forum.openzeppelin.com/t/create-upgradeable-erc20/4782/3) on how to create an upgradeable ERC20 and the example on [how to use this same preset by copying the code](https://forum.openzeppelin.com/t/creating-upgradable-erc20-token-using-openzeppelin-and-buidler-plugin/4415) into your own contract but I’m not sure how this translates to using the preset as an _inheritable_ contract.

Here’s what I assumed to make my contract as:

```auto
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.2 <0.8.1;

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

contract MyToken is Initializable, ERC20PresetMinterPauserUpgradeable {
    function initialize(
        string memory name,
        string memory symbol,
        uint256 initialSupply
    ) public virtual initializer {
        __ERC20PresetMinterPauserUpgradeable__ init(name, symbol);
    }

    function _beforeTokenTransfer(
        address from, 
        address to, 
        uint256 amount
    ) internal virtual override(ERC20PresetMinterPauserUpgradeable) {
        super._beforeTokenTransfer(from, to, amount);

        /
    }
}

```

Does this still work?

---

<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 25, 2020, 11:04am UTC](https://forum.openzeppelin.com/t/how-to-use-erc20presetminterpauserupgradeable-preset/5168/2 "2020-12-25T11:04:55Z")

</div>

I think the function name should be `__ERC20PresetMinterPauser_init`, and I think you should call `ERC20PresetMinterPauserUpgradeable.initialize()` to initialize contract rather than `__ERC20PresetMinterPauser_init()`, but just calling `__ERC20PresetMinterPauser_init` is fine.

---

<div class="post-metadata">

**Author:** ![platocrat](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/platocrat/32/3914_2.png) [@platocrat](https://forum.openzeppelin.com/u/platocrat)\
**Post date:** [December 25, 2020, 8:22pm UTC](https://forum.openzeppelin.com/t/how-to-use-erc20presetminterpauserupgradeable-preset/5168/3 "2020-12-25T20:22:33Z")

</div>

Thanks! I will try that.

---

<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 29, 2020, 8:12am UTC](https://forum.openzeppelin.com/t/how-to-use-erc20presetminterpauserupgradeable-preset/5168/4 "2020-12-29T08:12:07Z")

</div>

Hi @platocrat,

Welcome to the community 👋

Were you able to get it working?
