The Transfer event accepts 3 params: token sender, recipient, and amount.
A token contract which creates new tokens SHOULD trigger a Transfer event with the _from
address set to 0x0
when tokens are created.
Source: https://eips.ethereum.org/EIPS/eip-20
This is the standardized approach to emitting events when minting tokens.
You can also emit custom events on top of that. For example:
event Transfer(address indexed from, address indexed to, uint256 amount);
event Mint(uint256 amount, uint256 timestamp);
function mint(uint256 amount) external onlyOwner {
balanceOf[msg.sender] += amount;
totalSupply += amount;
emit Transfer(address(0x0), msg.sender, amount);
emit Mint(amount, block.timestamp);
}