'Solidity documentation mint and send function
In the documentation solidity has this coin example, I read the documentation but I couldn't understand what is the difference and purpose of both? What mint and send functions are doing? The send function makes sense but mint function is confusing. What is the meaning of "Sends an amount of newly created coins to an address, can only be called by the contract creator"
Solution 1:[1]
When the coin contract is deployed, there is nothing to use as long as you create something. The process of creating coins is referred to as minting.
Sends an amount of newly created coins to an address Minting is usually perceived to be sending coins somewhere from nowhere. This may sound confusing but think of it this way:
If you want a regular transfer: address(Alice) sends to address(Bob)
If you have a method to do: address(Nothing) to address(Contract Creator), now you can create coins.
can only be called by the contract creator
This makes sense since minting creates value out of thin air, and this contract wants to allow no one but the creator.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | keser |

