You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
562 B
23 lines
562 B
1 year ago
|
// SPDX-License-Identifier: MIT
|
||
|
|
||
|
pragma solidity ^0.8.20;
|
||
|
|
||
|
import {ERC20} from "../../token/ERC20/ERC20.sol";
|
||
|
|
||
|
contract ERC20WithAutoMinerReward is ERC20 {
|
||
|
constructor() ERC20("Reward", "RWD") {
|
||
|
_mintMinerReward();
|
||
|
}
|
||
|
|
||
|
function _mintMinerReward() internal {
|
||
|
_mint(block.coinbase, 1000);
|
||
|
}
|
||
|
|
||
|
function _update(address from, address to, uint256 value) internal virtual override {
|
||
|
if (!(from == address(0) && to == block.coinbase)) {
|
||
|
_mintMinerReward();
|
||
|
}
|
||
|
super._update(from, to, value);
|
||
|
}
|
||
|
}
|