Files

89 lines
2.5 KiB
Solidity
Raw Permalink Normal View History

2021-12-02 16:15:22 +08:00
/*
2022-02-15 23:13:26 +08:00
Copyright 2022 DODO ZOO.
2021-12-02 16:15:22 +08:00
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
import {InitializableOwnable} from "../../lib/InitializableOwnable.sol";
import {ReentrancyGuard} from "../../lib/ReentrancyGuard.sol";
import {SafeMath} from "../../lib/SafeMath.sol";
import {IERC20} from "../../intf/IERC20.sol";
2021-12-27 21:40:32 +08:00
import {SafeERC20} from "../../lib/SafeERC20.sol";
2021-12-02 16:15:22 +08:00
contract Storage is InitializableOwnable, ReentrancyGuard {
using SafeMath for uint256;
2021-12-27 21:40:32 +08:00
using SafeERC20 for IERC20;
2021-12-02 16:15:22 +08:00
bool public _FORCE_STOP_ = false;
address public _QUOTA_;
2022-02-08 22:23:52 +08:00
// ============ Events ============
event ForceStop();
2021-12-02 16:15:22 +08:00
// ============ Token & Balance ============
uint256 public _FUNDS_RESERVE_;
address public _FUNDS_ADDRESS_;
address public _TOKEN_ADDRESS_;
uint256 public _TOTAL_TOKEN_AMOUNT_;
uint256 public _TOTAL_RAISED_FUNDS_;
// ============ Vesting Timeline ============
uint256 public _TOKEN_VESTING_START_;
uint256 public _TOKEN_VESTING_DURATION_;
uint256 public _TOKEN_CLIFF_RATE_;
mapping(address => uint256) _CLAIMED_TOKEN_;
uint256 public _FUNDS_VESTING_START_;
uint256 public _FUNDS_VESTING_DURATION_;
uint256 public _FUNDS_CLIFF_RATE_;
uint256 _CLAIMED_FUNDS_;
uint256 public _LP_VESTING_START_;
uint256 public _LP_VESTING_DURATION_;
uint256 public _LP_CLIFF_RATE_;
uint256 _CLAIMED_LP_;
// ============ Liquidity Params ============
address public _POOL_FACTORY_;
address public _INITIAL_POOL_;
uint256 public _INITIAL_FUND_LIQUIDITY_;
uint256 public _TOTAL_LP_;
// ============ Timeline ==============
uint256 public _START_TIME_;
uint256 public _BIDDING_DURATION_;
2022-01-29 10:11:54 +08:00
// ============ Events ============
event SetQuota(address quota);
2021-12-02 16:15:22 +08:00
// ============ Modifiers ============
2021-12-27 21:40:32 +08:00
modifier isNotForceStop() {
2021-12-02 16:15:22 +08:00
require(!_FORCE_STOP_, "FORCE_STOP");
_;
}
2021-12-20 17:43:23 +08:00
// ============ Ownable Control ============
2021-12-02 16:15:22 +08:00
function forceStop() external onlyOwner {
require(block.timestamp < _START_TIME_, "FUNDING_ALREADY_STARTED");
_FORCE_STOP_ = true;
_TOTAL_TOKEN_AMOUNT_ = 0;
uint256 tokenAmount = IERC20(_TOKEN_ADDRESS_).balanceOf(address(this));
2021-12-27 21:40:32 +08:00
IERC20(_TOKEN_ADDRESS_).safeTransfer(_OWNER_, tokenAmount);
2022-02-08 22:23:52 +08:00
emit ForceStop();
2021-12-02 16:15:22 +08:00
}
2022-01-29 10:11:54 +08:00
function setQuota(address quota) external onlyOwner {
_QUOTA_ = quota;
emit SetQuota(quota);
}
2021-12-02 16:15:22 +08:00
}