How can i create a token ERC20 with a customized function

erc-20ethereum-wallet-dappremixsoliditytokens

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! 🙂

Best Answer

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

Web3

EtherJS

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

Related Topic