update timelock
This commit is contained in:
@@ -11,11 +11,19 @@ import {IERC20} from "../intf/IERC20.sol";
|
||||
import {SafeERC20} from "../lib/SafeERC20.sol";
|
||||
import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
|
||||
|
||||
|
||||
/**
|
||||
* @title DODOApprove
|
||||
* @author DODO Breeder
|
||||
*
|
||||
* @notice Handle authorizations in DODO platform
|
||||
*/
|
||||
contract DODOApprove is InitializableOwnable {
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
// ============ Storage ============
|
||||
uint256 private constant _TIMELOCK_DURATION_ = 3 days;
|
||||
uint256 private constant _TIMELOCK_EMERGENCY_DURATION_ = 2 hours;
|
||||
uint256 public _TIMELOCK_;
|
||||
address public _PENDING_DODO_PROXY_;
|
||||
address public _DODO_PROXY_;
|
||||
@@ -34,9 +42,14 @@ contract DODOApprove is InitializableOwnable {
|
||||
_;
|
||||
}
|
||||
|
||||
function init(address owner, address initProxyAddress) external {
|
||||
initOwner(owner);
|
||||
_DODO_PROXY_ = initProxyAddress;
|
||||
}
|
||||
|
||||
function unlockSetProxy(address newDodoProxy) public onlyOwner {
|
||||
if(newDodoProxy == address(0) || _DODO_PROXY_ == address(0))
|
||||
_TIMELOCK_ = block.timestamp;
|
||||
if(_DODO_PROXY_ == address(0))
|
||||
_TIMELOCK_ = block.timestamp + _TIMELOCK_EMERGENCY_DURATION_;
|
||||
else
|
||||
_TIMELOCK_ = block.timestamp + _TIMELOCK_DURATION_;
|
||||
_PENDING_DODO_PROXY_ = newDodoProxy;
|
||||
|
||||
@@ -17,10 +17,16 @@ import {IChi} from "./intf/IChi.sol";
|
||||
import {IUni} from "./intf/IUni.sol";
|
||||
import {IDODOApprove} from "../intf/IDODOApprove.sol";
|
||||
import {IDODOV1Proxy01} from "./intf/IDODOV1Proxy01.sol";
|
||||
import {ReentrancyGuard} from "../lib/ReentrancyGuard.sol";
|
||||
import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
|
||||
|
||||
contract DODOV1Proxy01 is IDODOV1Proxy01, ReentrancyGuard, InitializableOwnable {
|
||||
|
||||
/**
|
||||
* @title DODOV1Proxy01
|
||||
* @author DODO Breeder
|
||||
*
|
||||
* @notice Entrance of trading in DODO platform
|
||||
*/
|
||||
contract DODOV1Proxy01 is IDODOV1Proxy01, InitializableOwnable {
|
||||
using SafeMath for uint256;
|
||||
using UniversalERC20 for IERC20;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user