I want to create a and ERC20 token with a specially function.

The question is the following:

PERSON A: Create 1000 example Tokens.

PERSON B: Execute a function that mint 10 of that example Tokens.

Im starting to code in solidity and im fighting with that. Thanks! :)

  • Did you try using OpenZeppelin contracts as a base?
    – Ismael
    Commented Oct 22, 2021 at 4:32

1 Answer 1


You can create a new ERC20 token using openZeppelin contracts.

Basic ERC20 token

And if you need to send the token to another account by either using some wallet or send it using some lib like web3js, etherjs etc



You can also create a function to mint token in your contract itself

function mint(address to, uint256 amount) public {
    _mint(to, amount);

Use some access control to restrict it from all wallet

Access Control

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.