-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: [#13] extract logic into libraries and include base contrac…
…ts to ensure order for upgrades BREAKING CHANGE: storage locations could have changed for any of these contracts, which means old contracts cannot be safely upgraded.
- Loading branch information
Showing
33 changed files
with
360 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2020 The Paypr Company | ||
* | ||
* This file is part of Paypr Ethereum Contracts. | ||
* | ||
* Paypr Ethereum Contracts is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Paypr Ethereum Contracts is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Paypr Ethereum Contracts. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
// SPDX-License-Identifier: GPL-3.0-only | ||
|
||
pragma solidity ^0.6.0; | ||
|
||
interface IDisableable { | ||
/** | ||
* Emitted when the contract is disabled | ||
*/ | ||
event Disabled(); | ||
|
||
/** | ||
* Emitted when the contract is enabled | ||
*/ | ||
event Enabled(); | ||
|
||
/** | ||
* @dev Returns whether or not the contract is disabled | ||
*/ | ||
function disabled() external view returns (bool); | ||
|
||
/** | ||
* @dev Returns whether or not the contract is enabled | ||
*/ | ||
function enabled() external view returns (bool); | ||
|
||
modifier onlyEnabled() virtual { | ||
require(!this.disabled(), 'Contract is disabled'); | ||
_; | ||
} | ||
|
||
/** | ||
* @dev Disables the contract | ||
*/ | ||
function disable() external; | ||
|
||
/** | ||
* @dev Enables the contract | ||
*/ | ||
function enable() external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.