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

@ -36,7 +36,7 @@ abstract contract Pausable is Context {
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
function paused() public view virtual returns (bool) {
return _paused;
}
@ -48,7 +48,7 @@ abstract contract Pausable is Context {
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
require(!paused(), "Pausable: paused");
_;
}
@ -60,7 +60,7 @@ abstract contract Pausable is Context {
* - The contract must be paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
require(paused(), "Pausable: not paused");
_;
}