Make view and pure functions virtual (#2473)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
Hadrien Croubois
2021-01-26 17:23:23 +01:00
committed by GitHub
parent 0931062a3f
commit 18c7efe800
24 changed files with 122 additions and 112 deletions

View File

@ -24,7 +24,7 @@ abstract contract ERC20Capped is ERC20 {
/**
* @dev Returns the cap on the token's total supply.
*/
function cap() public view returns (uint256) {
function cap() public view virtual returns (uint256) {
return _cap;
}
@ -39,7 +39,7 @@ abstract contract ERC20Capped is ERC20 {
super._beforeTokenTransfer(from, to, amount);
if (from == address(0)) { // When minting tokens
require(totalSupply().add(amount) <= _cap, "ERC20Capped: cap exceeded");
require(totalSupply().add(amount) <= cap(), "ERC20Capped: cap exceeded");
}
}
}