# Where is ERC20Mintable.sol in OpenZeppelin Contracts 3.0?

**URL:** <https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283>\
**Category:** Contracts\
**Created:** [February 16, 2020, 11:13pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283 "2020-02-16T23:13:48Z")\
**Posts on this page:** 14\
**Page:** 1

<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:** [February 16, 2020, 11:13pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/1 "2020-02-16T23:13:49Z")

</div>

[smalaichami](https://github.com/smalaichami) asked on GitHub ([https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2092](https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2092)):

> It looks like that ERC20Mintable.sol contract is moved or removed.  
> Could you please suggest what is the new parth for ERC20Mintable.sol ?

---

<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:** [February 16, 2020, 11:26pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/2 "2020-02-16T23:26:02Z")

</div>

OpenZeppelin Contracts [v3.0 has a beta release](https://forum.openzeppelin.com/t/openzeppelin-contracts-v3-0-beta-release/2256)

> The final v3.0 release is [not yet finished](https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2086)

> Roles contracts (such as `MinterRole` and `PauserRole` ) were removed: we’re [redesigning our Access Control solution](https://forum.openzeppelin.com/t/redesigning-accesscontrol-for-the-openzeppelin-contracts/2177) and will have a better version of these in the v3.0 release.

* * *

ERC20Mintable.sol is part of OpenZeppelin Contracts [v2.5](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v2.5.0) which uses Solidity 0.5.  
[https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20Mintable.sol](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20Mintable.sol)

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [February 17, 2020, 7:49pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/3 "2020-02-17T19:49:08Z")

</div>

The `master` branch of the repo currently contains the work for the upcoming 3.0 release. For this release, we are removing the current role contracts, which includes `MinterRole`. Since we are removing this role, we are also removing the `ERC20Mintable` contract which used it.

There will be an alternative to `ERC20Mintable` and roles in 3.0, but we haven’t built it yet.

In the meantime, please continue using [`ERC20Mintable` from the 2.5 release of Contracts](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.5.0/contracts/token/ERC20/ERC20Mintable.sol), which can be found in the repository in the link that @abcoathup provided above.

---

<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:** [February 24, 2020, 12:46am UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/4 "2020-02-24T00:46:41Z")

</div>

Split this topic on February 24, 2020, 12:46am UTC

6 posts were split to a new topic: [Crowdsale contracts in OpenZeppelin Contracts 3.0?](https://forum.openzeppelin.com/t/crowdsale-contracts-in-openzeppelin-contracts-3-0/2348)

---

<div class="post-metadata">

**Author:** ![PaulRBerg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/paulrberg/32/14286_2.png) [@PaulRBerg](https://forum.openzeppelin.com/u/PaulRBerg)\
**Post date:** [May 25, 2020, 4:25pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/5 "2020-05-25T16:25:37Z")

</div>

Hey @frangio, v3 is out, but I can’t see the alternative for `ERC20Mintable`. I only found a `ERC20Capped` contract. Is this planned for a future version?

---

<div class="post-metadata">

**Author:** ![Ro5s](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ro5s/32/601_2.png) [@Ro5s](https://forum.openzeppelin.com/u/Ro5s)\
**Post date:** [May 25, 2020, 6:01pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/6 "2020-05-25T18:01:39Z")

</div>

Heya, I’ve had some similar issues fishing around, but if helpful, check out some of the OZ chunks I am using [here](https://github.com/lexDAO/LexToken/blob/master/contracts/LexTokenFactory.sol) which are blend of old/new (i’m still catching up lol)

---

<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:** [May 25, 2020, 11:25pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/7 "2020-05-25T23:25:30Z")

</div>

Hi @PaulRBerg,

[ERC20Capped.sol](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.0.1/contracts/token/ERC20/ERC20Capped.sol) was rewritten and it doesn't have a dependency on access control.

OpenZeppelin Contracts v3.x introduced [ERC20PresetMinterPauser](https://docs.openzeppelin.com/contracts/3.x/api/presets#ERC20PresetMinterPauser) which includes minting and pausing functionality using access control:

> The account that deploys the contract will be granted the minter and pauser roles, as well as the default admin role, which will let it grant both minter and pauser roles to aother accounts

The Preset contracts are opinionated, especially when it comes to access control.

Do you think there is still a need for an `ERC20Mintable`?  
What access control should it have?

---

<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:** [May 25, 2020, 11:39pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/8 "2020-05-25T23:39:55Z")

</div>

Hi @Ro5s,

I suggest having a look at [ERC20PresetMinterPauser](https://docs.openzeppelin.com/contracts/3.x/api/presets#ERC20PresetMinterPauser) in [OpenZeppelin Contracts v3.0](https://forum.openzeppelin.com/t/openzeppelin-contracts-v3-0/2695) depending where you are in the development cycle so you could update to Solidity 0.6 and OpenZeppelin Contracts 3.x.

I noticed that `LexTokenFactory.sol` has been flattened (I assume you used a flattener). I would recommend not flattening and only importing the OpenZeppelin Contracts for security and readability.

Note: [Solidity 0.6.8 introduces SPDX license identifiers](https://forum.openzeppelin.com/t/solidity-0-6-8-introduces-spdx-license-identifiers/2859) and the compiler will error if you have multiple license identifiers which you would get from flattening.

---

<div class="post-metadata">

**Author:** ![PaulRBerg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/paulrberg/32/14286_2.png) [@PaulRBerg](https://forum.openzeppelin.com/u/PaulRBerg)\
**Post date:** [May 26, 2020, 12:36am UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/9 "2020-05-26T00:36:44Z")

</div>

> [@abcoathup](#):
>
> Do you think there is still a need for an `ERC20Mintable` ?  
> What access control should it have?

Nah, [ERC20PresetMinterPauser](https://docs.openzeppelin.com/contracts/3.x/api/presets#ERC20PresetMinterPauser) fits the bill well. Thanks, Andrew!

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [May 26, 2020, 8:54pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/10 "2020-05-26T20:54:26Z")

</div>

V3 doesn’t include `ERC20Mintable` because the core contracts were made less opinionated: you get the internal `_mint` function in `ERC20` and you can expose it as an external function however you want. This grew out of a feeling that basic contracts like v2’s `ERC20Mintable` can be inadequate when a project grows, and it’s also related to the fact that we introduced the more feature-complete `AccessControl` but we didn’t want to force everyone to use it. To balance this out, we introduced the “preset” contracts that piece together the different components in an opinionated way to provide ready to use contracts. So I’m glad to hear that worked for you.

Maybe we need to do a better job explaining this idea in the documentation. May I ask @PaulRBerg and @Ro5s in what places you tried to find this so that we can make sure this information is discoverable for others that may search in similar places?

---

<div class="post-metadata">

**Author:** ![Ro5s](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ro5s/32/601_2.png) [@Ro5s](https://forum.openzeppelin.com/u/Ro5s)\
**Post date:** [May 26, 2020, 9:43pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/11 "2020-05-26T21:43:04Z")

</div>

@abcoathup Helpful links. I really like how OZ is showing more examples of ‘put together’ solidity for certain use cases ~~ lots of folks, like myself, are in team ‘copy pasta’

For `LexTokenFactory` I have the entire file there for my own silly purposes (I am actually a straight up “Remix” programmer, noob tendencies), but also, I remove some of the constructors for Roles that otherwise defaulted permissions to msg.sender (I like being able to set owner remotely from factory as option).

---

<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:** [May 26, 2020, 10:12pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/12 "2020-05-26T22:12:02Z")

</div>

Hi @Ro5s,

We can import OpenZeppelin Contracts via GitHub in Remix (see example: [Deploy a simple ERC20 token in Remix](https://forum.openzeppelin.com/t/deploy-a-simple-erc20-token-in-remix/1203)). I find flattened contracts difficult to read and it isn’t clear when changes have been made (such as when you are modifying Roles).

I recommend checking out OpenZeppelin Contracts v3.0 [Access Control](https://docs.openzeppelin.com/contracts/3.x/access-control#role-based-access-control)

---

<div class="post-metadata">

**Author:** ![PaulRBerg](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/paulrberg/32/14286_2.png) [@PaulRBerg](https://forum.openzeppelin.com/u/PaulRBerg)\
**Post date:** [May 27, 2020, 12:04pm UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/13 "2020-05-27T12:04:17Z")

</div>

> [@frangio](#):
>
> Maybe we need to do a better job explaining this idea in the documentation. May I ask @PaulRBerg and @Ro5s in what places you tried to find this so that we can make sure this information is discoverable for others that may search in similar places?

I think it'd be nice to have a reference to the new `AccessControl` contract and the "preset" model in the README of the ERC20 folder:

> <https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC20>
>
> //github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC20

---

<div class="post-metadata">

**Author:** ![saingsab](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/saingsab/32/6816_2.png) [@saingsab](https://forum.openzeppelin.com/u/saingsab)\
**Post date:** [June 21, 2021, 8:43am UTC](https://forum.openzeppelin.com/t/where-is-erc20mintable-sol-in-openzeppelin-contracts-3-0/2283/14 "2021-06-21T08:43:33Z")

</div>

My last update on Solidity 0.8.0 If you have any advise or comment let’s me know.

```auto

pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC20/ERC20.sol';

contract TokenBase is ERC20 {
  address public admin;

  constructor(string memory name, string memory symbol) ERC20(name, symbol) {
    admin = msg.sender;
  }

  function updateAdmin(address newAdmin) external {
    require(msg.sender == admin, 'only admin');
    admin = newAdmin;
  }

  function mint(address to, uint amount) external {
    require(msg.sender == admin, 'only admin');
    _mint(to, amount);
  }

  function burn(address owner, uint amount) external {
    require(msg.sender == admin, 'only admin');
    _burn(owner, amount);
  }
}

```
