You can call mint using the OpenZeppelin CLI send-tx.
First create the token and initialize
$ 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)
$ 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.
$ 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)