Create Mint-On-Demand ERC20 & BEP20 Token

FacebooktwitterredditlinkedinmailFacebooktwitterredditlinkedinmail

Mint-on-demand is a great way to make your operation smooth and effective. We have created a regular basic crypto, a coin that is mintable, a crypto faucet and a self-drop contractLet’s combine a mintable coin with a self-drop contract and also drop the ownership of the coin and contract.

Having control over a coin and/or it’s contract is really only useful for playing around and testing out new stuff. But if you wish to sell it and want other people to trust it enough to be willing to invest in it, they have to know that you can’t just make new coins directly to your own wallet whenever you want.

You can copy the full code from GitHub

Next, follow the usual steps and compile the contract. Once you have compiled the code without errors, you need to choose the SaleDeployer contract on the deployment page.

mint-on-demand token

Name: Give your token a name

Symbol: Set the symbol for the token (i.e ETH for Ethereum)

Wallet: This is the wallet where you want the profit to be sent (so make sure it’s yours).

When you are done naming your token, and have set a symbol as well as beneficiary address, click “Transact”

Once you have confirmed the deployment in metamask you get a dropdown menu under “Deployed Contracts”. Reveal the address of the token as well as the sales contract by clicking on its respective button.

Deployed ERC20 BEP20 contracts
Don’t confuse these two!

Next, we choose the “Demand – demand.sol” contract. If you renamed the contract, not the token, then you choose the contract as you named it. Copy the token_address and put it in the “At Address” text field and press the “At Address” button. Then choose the DemandSale contract, copy the token_sale_address and put it in the “At Address” text field and press the “At Address” button.

Token contract
Sale contract

When you expand the DemandSale contract under deployed contracts, you can see the sales rate, token address, which address the currency from the sales will be sent to and the amount of currency raised so far.

You should now see three different contract under “Deployed Contracts”.

SaleDeployer

Demand (token contract)

DemanSale

The rate is set to 10000. This can be changed in the code itself. A rate of 10000 means that you will get 10,000 of your tokens for 1 BNB (or ETH).

Rate
Deployed contracts

If you expand the Demand contract you also get various types of information. You can try to mint coins or add a new minter, but you will get error messages. You are no longer the owner of the contract, and only the sales contract is allowed to mint new coins. By putting the address of the sales contract in the “isMinter” box and press the button, you will get confirmation that the sales contract is the minter.

When you send currency (in this case BNB) to the sales contract, it will mint your coins and send it back to you. The picture below shows how I’m sending 0.05 BNB to the sales contract, the sales contract forwards the 0.05 BNB to the address we provided as the beneficiary when we first deployed the SaleDeployer contract, and finally 500 Print (MOAR) tokens is minted and sent to the address of the buyer.

Transaction

If you found this guide helpful, then please share it with your friends!


Promoted Exchanges

Note: Investing and trading with cryptocurrencies can result in significant loss

Binance and Crypto.com offer everything you need, along with a $20 welcome bonus.

freebtc

BitPanda is the easiest cryptotrading platform, and perfect for the beginner.

ExpressVPN is the fastest and most secure on the market. Try it for FREE for 30 days!

84 / 100
youtubeinstagramyoutubeinstagram

FacebooktwitterredditlinkedinmailFacebooktwitterredditlinkedinmail