convert Pausable to initializers
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
pragma solidity ^0.4.24;
|
pragma solidity ^0.4.24;
|
||||||
|
|
||||||
|
import "../Initializable.sol";
|
||||||
import "../access/roles/PauserRole.sol";
|
import "../access/roles/PauserRole.sol";
|
||||||
|
|
||||||
|
|
||||||
@ -7,12 +8,15 @@ import "../access/roles/PauserRole.sol";
|
|||||||
* @title Pausable
|
* @title Pausable
|
||||||
* @dev Base contract which allows children to implement an emergency stop mechanism.
|
* @dev Base contract which allows children to implement an emergency stop mechanism.
|
||||||
*/
|
*/
|
||||||
contract Pausable is PauserRole {
|
contract Pausable is Initializable, PauserRole {
|
||||||
event Paused();
|
event Paused();
|
||||||
event Unpaused();
|
event Unpaused();
|
||||||
|
|
||||||
bool private _paused = false;
|
bool private _paused = false;
|
||||||
|
|
||||||
|
function initialize() public initializer {
|
||||||
|
PauserRole.initialize();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the contract is paused, false otherwise.
|
* @return true if the contract is paused, false otherwise.
|
||||||
|
|||||||
@ -1,16 +1,19 @@
|
|||||||
pragma solidity ^0.4.24;
|
pragma solidity ^0.4.24;
|
||||||
|
|
||||||
|
|
||||||
|
import "../Initializable.sol";
|
||||||
import "../lifecycle/Pausable.sol";
|
import "../lifecycle/Pausable.sol";
|
||||||
import "./PauserRoleMock.sol";
|
import "./PauserRoleMock.sol";
|
||||||
|
|
||||||
|
|
||||||
// mock class using Pausable
|
// mock class using Pausable
|
||||||
contract PausableMock is Pausable, PauserRoleMock {
|
contract PausableMock is Initializable, Pausable, PauserRoleMock {
|
||||||
bool public drasticMeasureTaken;
|
bool public drasticMeasureTaken;
|
||||||
uint256 public count;
|
uint256 public count;
|
||||||
|
|
||||||
constructor() public {
|
constructor() public {
|
||||||
|
Pausable.initialize();
|
||||||
|
|
||||||
drasticMeasureTaken = false;
|
drasticMeasureTaken = false;
|
||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user