cp add settle fund
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ============
|
||||
|
||||
|
||||
@@ -122,8 +122,6 @@ contract CrowdPoolingFactory is InitializableOwnable {
|
||||
_USER_REGISTRY_[creator].push(cpAddress);
|
||||
|
||||
emit NewCP(baseToken, quoteToken, creator, cpAddress);
|
||||
|
||||
//TODO: 初始存入资金,用于settle补贴
|
||||
}
|
||||
|
||||
// ============ View Functions ============
|
||||
|
||||
@@ -606,7 +606,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
|
||||
uint256[] memory timeLine,
|
||||
uint256[] memory valueList,
|
||||
uint256 deadLine
|
||||
) external override judgeExpired(deadLine) returns (address newCrowdPooling) {
|
||||
) external override payable judgeExpired(deadLine) returns (address payable newCrowdPooling) {
|
||||
address _baseToken = baseToken;
|
||||
address _quoteToken = quoteToken == _ETH_ADDRESS_ ? _WETH_ : quoteToken;
|
||||
|
||||
@@ -620,6 +620,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
|
||||
false
|
||||
);
|
||||
|
||||
newCrowdPooling.transfer(msg.value);
|
||||
|
||||
IDODOV2(_CP_FACTORY_).initCrowdPooling(
|
||||
newCrowdPooling,
|
||||
|
||||
@@ -85,7 +85,7 @@ interface IDODOV2 {
|
||||
|
||||
//========== CrowdPooling ===========
|
||||
|
||||
function createCrowdPooling() external returns (address newCrowdPooling);
|
||||
function createCrowdPooling() external returns (address payable newCrowdPooling);
|
||||
|
||||
function initCrowdPooling(
|
||||
address cpAddress,
|
||||
|
||||
@@ -100,7 +100,7 @@ interface IDODOV2Proxy01 is IDODOV1Proxy01 {
|
||||
uint256[] memory timeLine,
|
||||
uint256[] memory valueList,
|
||||
uint256 deadLine
|
||||
) external returns (address newCrowdPooling);
|
||||
) external payable returns (address payable newCrowdPooling);
|
||||
|
||||
function bid(
|
||||
address assetTo,
|
||||
|
||||
Reference in New Issue
Block a user