Make view and pure functions virtual (#2473)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user