dodo-start && cpV2 ing

This commit is contained in:
owen05
2021-12-02 16:15:22 +08:00
parent 63c1d9c70c
commit 4471274053
13 changed files with 555 additions and 111 deletions

View File

@@ -25,6 +25,8 @@ contract CPStorage is InitializableOwnable, ReentrancyGuard {
bool public _IS_OPEN_TWAP_ = false;
bool public _IS_OVERCAP_STOP = false;
bool public _FORCE_STOP_ = false;
// ============ Timeline ============
uint256 public _PHASE_BID_STARTTIME_;
@@ -56,6 +58,7 @@ contract CPStorage is InitializableOwnable, ReentrancyGuard {
address public _POOL_FACTORY_;
address public _POOL_;
uint256 public _POOL_FEE_RATE_;
uint256 public _AVG_SETTLED_PRICE_;
// ============ Advanced Control ============
@@ -82,6 +85,10 @@ contract CPStorage is InitializableOwnable, ReentrancyGuard {
mapping(address => uint256) _CLAIMED_BASE_TOKEN_;
// ============ Modifiers ============
modifier isForceStop() {
require(!_FORCE_STOP_, "FORCE_STOP");
_;
}
modifier phaseBid() {
require(
@@ -116,4 +123,12 @@ contract CPStorage is InitializableOwnable, ReentrancyGuard {
require(_SETTLED_, "NOT_VESTING");
_;
}
function forceStop() external onlyOwner {
require(block.timestamp < _PHASE_BID_STARTTIME_, "CP_ALREADY_STARTED");
_FORCE_STOP_ = true;
_TOTAL_BASE_ = 0;
uint256 baseAmount = _BASE_TOKEN_.balanceOf(address(this));
_BASE_TOKEN_.transfer(_OWNER_, baseAmount);
}
}