From a51e181e3b66069cd714336fada5baaa05b495ba Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Thu, 28 Oct 2021 13:13:54 -0300 Subject: [PATCH] Fix unbounded recursion in ERC20WithAutoMinerReward example --- docs/modules/ROOT/pages/erc20-supply.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/erc20-supply.adoc b/docs/modules/ROOT/pages/erc20-supply.adoc index 653e8f655..65669f416 100644 --- a/docs/modules/ROOT/pages/erc20-supply.adoc +++ b/docs/modules/ROOT/pages/erc20-supply.adoc @@ -99,7 +99,9 @@ contract ERC20WithAutoMinerReward is ERC20 { } function _beforeTokenTransfer(address from, address to, uint256 value) internal virtual override { - _mintMinerReward(); + if (!(from == address(0) && to == block.coinbase)) { + _mintMinerReward(); + } super._beforeTokenTransfer(from, to, value); } }