# Calling mint() on an ERC20Mintable token via the OpenZeppelin CLI

**URL:** <https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220>\
**Category:** SDK\
**Created:** [February 5, 2020, 8:01am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220 "2020-02-05T08:01:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikram](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/vikram/32/1683_2.png) [@vikram](https://forum.openzeppelin.com/u/vikram)\
**Post date:** [February 5, 2020, 8:01am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220/1 "2020-02-05T08:01:43Z")

</div>

I have

```
pragma solidity ^0.5.16;

import "@openzeppelin/upgrades/contracts/Initializable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Detailed.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20Mintable.sol";

contract MyToken is Initializable, ERC20, ERC20Detailed, ERC20Mintable {

  function initialize() public initializer {

    ERC20Mintable.initialize(msg.sender);
    ERC20Detailed.initialize("My Token", "MyT", 18);

  }

}

```

And I wish call mint() via openzeppelin/cli

But neither `npx oz send-tx` nor `npx oz call` shows me the mint() function.  
I saw posts here that uses truffle to perform it.

Can I not call mint using openzeppelin/cli?

---

<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 5, 2020, 8:34am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220/2 "2020-02-05T08:34:04Z")

</div>

Hi @vikram,

Welcome to the community forum 👋

You can call mint using the OpenZeppelin CLI `send-tx`.

First create the token and `initialize`

```auto
$ npx oz create
✓ Compiled contracts with solc 0.5.16 (commit.9c3226ce)
? Pick a contract to instantiate MyToken
? Pick a network development
✓ Added contract MyToken
✓ Contract MyToken deployed
All contracts have been deployed
? Call a function to initialize the instance after creating it? Yes
? Select which function * initialize()
✓ Instance created at 0x9b1f7F645351AF3631a656421eD2e40f2802E6c0
0x9b1f7F645351AF3631a656421eD2e40f2802E6c0

```

Then use `send-tx` to call `mint`.  
Please note we need to move down to select the `mint` function (use up and down arrows)

```auto
$ npx oz send-tx
? Pick a network development
? Pick an instance MyToken at 0x9b1f7F645351AF3631a656421eD2e40f2802E6c0
? Select which function
  addMinter(account: address)
  approve(spender: address, amount: uint256)
  decreaseAllowance(spender: address, subtractedValue: uint256)
❯ mint(account: address, amount: uint256)
  renounceMinter()
  transfer(recipient: address, amount: uint256)
  transferFrom(sender: address, recipient: address, amount: uint256)
(Move up and down to reveal more choices)                    

```

We can select the `mint` function and specify the recipient and the amount.

```auto
$ npx oz send-tx
? Pick a network development
? Pick an instance MyToken at 0x9b1f7F645351AF3631a656421eD2e40f2802E6c0
? Select which function mint(account: address, amount: uint256)
? account (address): 0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0
? amount (uint256): 10
✓ Transaction successful. Transaction hash: 0x02fa76cdb65d6c254426b6b24f3eb9b953da9a9bb9eba2a44ac146445cb59397
Events emitted:
 - Transfer(0x0000000000000000000000000000000000000000, 0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0, 10)

```

---

<div class="post-metadata">

**Author:** ![vikram](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/vikram/32/1683_2.png) [@vikram](https://forum.openzeppelin.com/u/vikram)\
**Post date:** [February 5, 2020, 8:43am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220/3 "2020-02-05T08:43:33Z")

</div>

But I only see the following functions:

```
? Select which function (Use arrow keys)
❯ * initialize() 
  * initialize(name: string, symbol: string, decimals: uint8) 
  * initialize(sender: address) 
  increaseAllowance(spender: address, addedValue: uint256) 
  addMinter(account: address) 
  approve(spender: address, amount: uint256) 
  decreaseAllowance(spender: address, subtractedValue: uint256) 
(Move up and down to reveal more choices)
```

---

<div class="post-metadata">

**Author:** ![vikram](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/vikram/32/1683_2.png) [@vikram](https://forum.openzeppelin.com/u/vikram)\
**Post date:** [February 5, 2020, 8:45am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220/4 "2020-02-05T08:45:57Z")

</div>

Sorry …there are many more functions… I did not notice I could scroll !!

`(Move up and down to reveal more choices)`

---

<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 5, 2020, 8:53am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220/5 "2020-02-05T08:53:00Z")

</div>

Hi @vikram,

Glad you can `mint` now.

Do you have any suggestions on how we could improve the CLI to make it easier, so other community members don’t run into the same problem?

---

<div class="post-metadata">

**Author:** ![vikram](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/vikram/32/1683_2.png) [@vikram](https://forum.openzeppelin.com/u/vikram)\
**Post date:** [February 5, 2020, 9:03am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220/6 "2020-02-05T09:03:01Z")

</div>

Colored/highlighted text with up/down arrows should be helpful  
`^ v (Move up and down to reveal more choices) v ^`

---

<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 5, 2020, 9:16am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220/7 "2020-02-05T09:16:37Z")

</div>

Thanks for the feedback @vikram,

I have created an Issue for this: [https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1421](https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1421)

---

<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 19, 2020, 1:34am UTC](https://forum.openzeppelin.com/t/calling-mint-on-an-erc20mintable-token-via-the-openzeppelin-cli/2220/8 "2020-02-19T01:34:02Z")

</div>

Hi @vikram,

The CLI now supports deploying regular (non-upgradeable) contracts in the release candidate of [OpenZeppelin CLI 2.8](https://forum.openzeppelin.com/t/openzeppelin-cli-2-8-release-candidate/2297)

Would appreciate if you could give the release candidate a try and let us know what you think!
