add twap switch

This commit is contained in:
owen05
2021-01-19 17:10:46 +08:00
parent 059778b27b
commit 8b683af08f
34 changed files with 519 additions and 174 deletions

View File

@@ -114,6 +114,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTWAP,
uint256 deadLine
)
external
@@ -131,7 +132,8 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
_quoteToken,
lpFeeRate,
i,
k
k,
isOpenTWAP
);
}
@@ -234,6 +236,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTwap,
uint256 deadLine
)
external
@@ -266,7 +269,8 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
_quoteToken,
lpFeeRate,
k,
i
i,
isOpenTwap
);
}
@@ -658,6 +662,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
uint256 baseInAmount,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP,
uint256 deadLine
) external override payable preventReentrant judgeExpired(deadLine) returns (address payable newCrowdPooling) {
address _baseToken = baseToken;
@@ -681,7 +686,8 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
_baseToken,
_quoteToken,
timeLine,
valueList
valueList,
isOpenTWAP
);
}

View File

@@ -41,7 +41,8 @@ interface IDODOV2 {
address quoteToken,
uint256 lpFeeRate,
uint256 i,
uint256 k
uint256 k,
bool isOpenTWAP
) external returns (address newVendingMachine);
function buyShares(address to) external returns (uint256,uint256,uint256);
@@ -59,7 +60,8 @@ interface IDODOV2 {
address quoteToken,
uint256 lpFeeRate,
uint256 k,
uint256 i
uint256 i,
bool isOpenTwap
) external;
function reset(
@@ -87,7 +89,8 @@ interface IDODOV2 {
address baseToken,
address quoteToken,
uint256[] memory timeLine,
uint256[] memory valueList
uint256[] memory valueList,
bool isOpenTWAP
) external;
function bid(address to) external;

View File

@@ -48,6 +48,7 @@ interface IDODOV2Proxy01 {
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTWAP,
uint256 deadLine
) external payable returns (address newVendingMachine, uint256 shares);
@@ -76,6 +77,7 @@ interface IDODOV2Proxy01 {
uint256 lpFeeRate,
uint256 i,
uint256 k,
bool isOpenTwap,
uint256 deadLine
) external payable returns (address newPrivatePool);
@@ -95,6 +97,7 @@ interface IDODOV2Proxy01 {
uint256 baseInAmount,
uint256[] memory timeLine,
uint256[] memory valueList,
bool isOpenTWAP,
uint256 deadLine
) external payable returns (address payable newCrowdPooling);
@@ -111,7 +114,7 @@ interface IDODOV2Proxy01 {
uint256 quoteAmount,
uint256 baseMinShares,
uint256 quoteMinShares,
uint8 flag, // 0 erc20 Out 1 baseOutETH 2 quoteOut ETH
uint8 flag, // 0 erc20 Out 1 baseInETH 2 quoteInETH
uint256 deadLine
) external payable returns(uint256, uint256);