0

I want a mint function but instead of _mint(to, amount) i want _mint(msg.sender, amount) how can i do it??

1
  • 1
    I'm not sure if I understand correctly, but can you just write the function like this: function _mint(uint amount) public { _mint(msg.sender, amount; }, or so Oct 27 at 16:32
1

You can try this:

function mint(uint256 _amount) public {

//Now you call the internal mint function from your ERC20 token
//You can find more about it here
//https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol

_mint(msg.sender, _amount);

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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