The next contract that we're going to look at is the coin.
I created this under Minter.sol.
The name of the contract is Coin and this is also from the Solidity documentation,
and we have here one state variable, public minter.
You can see that it has a data type of address that is Solidity specific.
They are also illustrating
the mapping function here mapping table where
address is used to map on to the balances that we have.
It also illustrates the event,
an event has been defined as sent with three parameters: from whom the money was sent,
to what address the money was sent,
and the amount of money that was sent.
We have the constructor where the message sender or the person who's
creating this contract is defined as the minter and message sender.
We're also illustrating the use of message and the sender data of
the message and initializing the minter public data that we have in this contract.
Next comes the function mint,
where the coins are minted and in this case,
only the sender, only the minter should be able to mint the coins.
Only the owner of the smart contract should be able to mint the coin.
So, I have here a simple command
that tests the condition that whoever is the message sender for mint,
is indeed the minter who created this contract.
At this time, I'm going to close this bidder,
we don't need that anymore.
Once that is so, once a mint is requested by
the owner of the contract and I mint those newly created coins
and add to the receiver whose address was sent as a parameter.
Finally, I have a send function
where the coins created can be sent to a specific address.
You specify the address of the receiver and the amount to be
sent as a parameter and this is also a public function as you can see.
If the balance of the sender of this message is less than the amount to be transferred,
the function is returned.
This is not completed.
Otherwise, the balance of the sender is decremented,
balance of the receiver is incremented.
There is also an event log as what happened here?
The sent is the event and it is pushed,
it is logged with