fix
This commit is contained in:
@@ -82,8 +82,8 @@ contract CPVesting is CPFunding {
|
||||
|
||||
function _claimBaseToken(address to) internal {
|
||||
uint256 claimableBaseAmount = getClaimableBaseToken(msg.sender);
|
||||
_transferBaseOut(to, claimableBaseAmount);
|
||||
_CLAIMED_BASE_TOKEN_[msg.sender] = _CLAIMED_BASE_TOKEN_[msg.sender].add(claimableBaseAmount);
|
||||
_transferBaseOut(to, claimableBaseAmount);
|
||||
emit ClaimBaseToken(msg.sender, claimableBaseAmount);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,5 @@ interface ICP {
|
||||
|
||||
function emergencySettle() external;
|
||||
|
||||
function claimBaseToken() external;
|
||||
|
||||
function ClaimQuoteToken(address to,bytes calldata data) external;
|
||||
|
||||
function claimLPToken() external;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ contract FairFunding is Vesting {
|
||||
|
||||
// ============ Settle Functions ============
|
||||
|
||||
function settle() public isForceStop preventReentrant {
|
||||
function settle() public isNotForceStop preventReentrant {
|
||||
require(_FINAL_PRICE_ == 0 && isFundingEnd(), "CAN_NOT_SETTLE");
|
||||
_FINAL_PRICE_ = getCurrentPrice();
|
||||
if(_TOTAL_RAISED_FUNDS_ == 0) {
|
||||
@@ -187,7 +187,7 @@ contract FairFunding is Vesting {
|
||||
|
||||
// ============ Funding Functions ============
|
||||
|
||||
function depositFunds(address to) external preventReentrant isForceStop returns(uint256 inputFund) {
|
||||
function depositFunds(address to) external preventReentrant isNotForceStop returns(uint256 inputFund) {
|
||||
require(isDepositOpen(), "DEPOSIT_NOT_OPEN");
|
||||
|
||||
uint256 currentFundBalance = IERC20(_FUNDS_ADDRESS_).balanceOf(address(this));
|
||||
|
||||
@@ -142,7 +142,7 @@ contract InstantFunding is Vesting {
|
||||
function depositFunds(address to)
|
||||
external
|
||||
preventReentrant
|
||||
isForceStop
|
||||
isNotForceStop
|
||||
returns (uint256 newTokenAllocation)
|
||||
{
|
||||
require(isDepositOpen(), "DEPOSIT_NOT_OPEN");
|
||||
|
||||
@@ -12,9 +12,11 @@ import {InitializableOwnable} from "../../lib/InitializableOwnable.sol";
|
||||
import {ReentrancyGuard} from "../../lib/ReentrancyGuard.sol";
|
||||
import {SafeMath} from "../../lib/SafeMath.sol";
|
||||
import {IERC20} from "../../intf/IERC20.sol";
|
||||
import {SafeERC20} from "../../lib/SafeERC20.sol";
|
||||
|
||||
contract Storage is InitializableOwnable, ReentrancyGuard {
|
||||
using SafeMath for uint256;
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
bool public _FORCE_STOP_ = false;
|
||||
address public _QUOTA_;
|
||||
@@ -58,7 +60,7 @@ contract Storage is InitializableOwnable, ReentrancyGuard {
|
||||
|
||||
|
||||
// ============ Modifiers ============
|
||||
modifier isForceStop() {
|
||||
modifier isNotForceStop() {
|
||||
require(!_FORCE_STOP_, "FORCE_STOP");
|
||||
_;
|
||||
}
|
||||
@@ -69,6 +71,6 @@ contract Storage is InitializableOwnable, ReentrancyGuard {
|
||||
_FORCE_STOP_ = true;
|
||||
_TOTAL_TOKEN_AMOUNT_ = 0;
|
||||
uint256 tokenAmount = IERC20(_TOKEN_ADDRESS_).balanceOf(address(this));
|
||||
IERC20(_TOKEN_ADDRESS_).transfer(_OWNER_, tokenAmount);
|
||||
IERC20(_TOKEN_ADDRESS_).safeTransfer(_OWNER_, tokenAmount);
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,8 @@ contract Vesting is Storage {
|
||||
cliffRate = _LP_CLIFF_RATE_;
|
||||
}
|
||||
|
||||
require(timestamp >= vestingStart, "NOT_START_TO_CLAIM");
|
||||
|
||||
uint256 timePast = timestamp.sub(vestingStart);
|
||||
if (timePast < vestingDuration) {
|
||||
uint256 remainingTime = vestingDuration.sub(timePast);
|
||||
@@ -94,12 +96,12 @@ contract Vesting is Storage {
|
||||
DecimalMath.ONE,
|
||||
isOpenTWAP
|
||||
);
|
||||
IERC20(_TOKEN_ADDRESS_).transferFrom(msg.sender, _INITIAL_POOL_, initialTokenAmount);
|
||||
IERC20(_TOKEN_ADDRESS_).safeTransferFrom(msg.sender, _INITIAL_POOL_, initialTokenAmount);
|
||||
|
||||
if(totalUsedRaiseFunds > _INITIAL_FUND_LIQUIDITY_) {
|
||||
IERC20(_FUNDS_ADDRESS_).transfer(_INITIAL_POOL_, _INITIAL_FUND_LIQUIDITY_);
|
||||
IERC20(_FUNDS_ADDRESS_).safeTransfer(_INITIAL_POOL_, _INITIAL_FUND_LIQUIDITY_);
|
||||
}else {
|
||||
IERC20(_FUNDS_ADDRESS_).transfer(_INITIAL_POOL_, totalUsedRaiseFunds);
|
||||
IERC20(_FUNDS_ADDRESS_).safeTransfer(_INITIAL_POOL_, totalUsedRaiseFunds);
|
||||
}
|
||||
|
||||
(_TOTAL_LP_, , ) = IDVM(_INITIAL_POOL_).buyShares(address(this));
|
||||
|
||||
@@ -12,6 +12,7 @@ import {InitializableOwnable} from "../lib/InitializableOwnable.sol";
|
||||
import {ICloneFactory} from "../lib/CloneFactory.sol";
|
||||
import {SafeMath} from "../lib/SafeMath.sol";
|
||||
import {IERC20} from "../intf/IERC20.sol";
|
||||
import {SafeERC20} from "../lib/SafeERC20.sol";
|
||||
import {DecimalMath} from "../lib/DecimalMath.sol";
|
||||
import {IDODOStarter} from "../DODOStarter/intf/IDODOStarter.sol";
|
||||
|
||||
@@ -23,6 +24,8 @@ import {IDODOStarter} from "../DODOStarter/intf/IDODOStarter.sol";
|
||||
*/
|
||||
contract DODOStarterFactory is InitializableOwnable {
|
||||
using SafeMath for uint256;
|
||||
using SafeERC20 for IERC20;
|
||||
|
||||
// ============ Templates ============
|
||||
|
||||
address public immutable _CLONE_FACTORY_;
|
||||
@@ -83,7 +86,7 @@ contract DODOStarterFactory is InitializableOwnable {
|
||||
) external payable permissionCheck(addressList[0],addressList[1]) returns(address newFairFundPool){
|
||||
newFairFundPool = ICloneFactory(_CLONE_FACTORY_).clone(_FAIR_FUND_TEMPLATE_);
|
||||
|
||||
IERC20(addressList[1]).transferFrom(msg.sender, newFairFundPool,sellTokenAmount);
|
||||
IERC20(addressList[1]).safeTransferFrom(msg.sender, newFairFundPool,sellTokenAmount);
|
||||
(bool success, ) = newFairFundPool.call{value: msg.value}("");
|
||||
require(success, "Settle fund Transfer failed");
|
||||
|
||||
@@ -107,7 +110,7 @@ contract DODOStarterFactory is InitializableOwnable {
|
||||
) external permissionCheck(addressList[0],addressList[1]) returns(address newInstantFundPool){
|
||||
newInstantFundPool = ICloneFactory(_CLONE_FACTORY_).clone(_INSTANT_FUND_TEMPLATE_);
|
||||
|
||||
IERC20(addressList[1]).transferFrom(msg.sender, newInstantFundPool,sellTokenAmount);
|
||||
IERC20(addressList[1]).safeTransferFrom(msg.sender, newInstantFundPool,sellTokenAmount);
|
||||
|
||||
IDODOStarter(newInstantFundPool).init(
|
||||
addressList,
|
||||
|
||||
Reference in New Issue
Block a user