-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPausableValidator.sol
55 lines (48 loc) · 1.31 KB
/
PausableValidator.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
pragma solidity 0.4.24;
import "openzeppelin-solidity/contracts/lifecycle/Pausable.sol";
import "../interfaces/IModuleContract.sol";
import "../inheritables/TransferValidator.sol";
/**
* @title Transfer Validator that pauses transfers and unpauses transfers
*/
contract PausableValidator is TransferValidator, IModuleContract, Pausable {
/*----------- Constants -----------*/
bytes32 public constant moduleName = "PausableValidator";
/*----------- Methods -----------*/
/**
* @dev Validate whether contract is paused
* @param _token address Unused for this validation
* @param _to address Unused for this validation
* @param _from address Unused for this validation
* @param _amount uint256 Unused for this validation
* @return bool
*/
function canSend(address _token, address _from, address _to, uint256 _amount)
external
returns(bool)
{
return !paused;
}
/**
* @dev Returns the name of the validator
* @return bytes32
*/
function getName()
external
view
returns(bytes32)
{
return moduleName;
}
/**
* @dev Returns the type of the validator
* @return uint8
*/
function getType()
external
view
returns(uint8)
{
return moduleType;
}
}