Is it possible to create a token that you can mint on demand?

Some possibilities might be to allow a specific wallet to execute the minting command, or to set the price ahead of time, or to use other data on the blockchain to set the price.

My assumption is that this would be too expensive with current ERC-20 contracts, since most of them mint all the tokens at once and issue them over time.

One possible workaround might be to issue the tokens all at once, then send them to a smart contract which will sell them based on a formula built into the code.

1 Answer 1


It is not rare, farming tokens create token on demand. OpenZeppelin's contracts has a mint functionality that can be made callable under certain circumstances.

  • Assume I want a token to mint 1 per day, but not mint them proper until a call to the ERC20's "totalSupply" attribute. Then again, this is an attribute not a method or function call so.... maybe not. I assume this is only possible during a call to _transfer?
    – Tomachi
    Commented Jun 2, 2023 at 2:52
  • @Tomachi Please create a new question.
    – Ismael
    Commented Jun 2, 2023 at 6:58

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.