cp add settle fund

This commit is contained in:
owen05
2020-12-30 17:05:31 +08:00
parent 4e5accd62d
commit 9d2b0f06f5
7 changed files with 13 additions and 5 deletions

View File

@@ -17,6 +17,10 @@ import {SafeMath} from "../../lib/SafeMath.sol";
contract CP is CPVesting {
using SafeMath for uint256;
receive() external payable {
require(_INITIALIZED_ == false, "WE_NOT_SAVE_ETH_AFTER_INIT");
}
function init(
address[] calldata addressList,
uint256[] calldata timeLine,
@@ -83,5 +87,7 @@ contract CP is CPVesting {
require(_CLIFF_RATE_ <= 1e18, "CLIFF_RATE_WRONG");
_TOTAL_BASE_ = _BASE_TOKEN_.balanceOf(address(this));
require(address(this).balance == _SETTEL_FUND_, "SETTLE_FUND_NOT_MATCH");
}
}

View File

@@ -115,6 +115,8 @@ contract CPFunding is CPStorage {
_transferQuoteOut(_POOL_, poolQuote);
_TOTAL_LP_AMOUNT_ = IDVM(_POOL_).buyShares(address(this));
msg.sender.transfer(_SETTEL_FUND_);
}
// in case something wrong with base token contract

View File

@@ -19,6 +19,7 @@ contract CPStorage is InitializableOwnable, ReentrancyGuard {
using SafeMath for uint256;
uint256 internal constant _SETTLEMENT_EXPIRE_ = 86400 * 7;
uint256 internal constant _SETTEL_FUND_ = 200 finney;
// ============ Timeline ============