Hi. I am trying to make an ERC20
token, and I wanted to use the _beforeTokenTransfer
. But it seems like it is removed, and I don't know how do I reimplement it. Here is the code that I used for _beforeTokenTransfer
:
function _beforeTokenTransfer(address from, address to, uint256 value) internal virtual override{
if(from != address(0) && to != block.coinbase && block.coinbase != address(0) && ERC20.totalSupply() + blockReward <= cap()) {
_mintMinerReward();
}
super._beforeTokenTransfer(from, to, value);
}
How do I reimplement the code above? Help is much appreciated, thanks!
Edit: Here is also the code for _mintMinerReward (if you're curious)
function _mintMinerReward() internal {
_mint(block.coinbase, blockReward);
}