simplify dpp

This commit is contained in:
owen05
2020-12-30 18:41:13 +08:00
parent 9d2b0f06f5
commit c717e5fb9b
12 changed files with 163 additions and 363 deletions

View File

@@ -213,7 +213,6 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
uint256 baseInAmount,
uint256 quoteInAmount,
uint256 lpFeeRate,
uint256 mtFeeRate,
uint256 i,
uint256 k,
uint256 deadLine
@@ -247,7 +246,6 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
_baseToken,
_quoteToken,
lpFeeRate,
mtFeeRate,
k,
i
);
@@ -255,7 +253,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
function resetDODOPrivatePool(
address dppAddress,
uint256[] memory paramList, //0 - newLpFeeRate, 1 - newMtFeeRate, 2 - newI, 3 - newK
uint256[] memory paramList, //0 - newLpFeeRate, 1 - newI, 2 - newK
uint256[] memory amountList, //0 - baseInAmount, 1 - quoteInAmount, 2 - baseOutAmount, 3- quoteOutAmount
uint8 flag, // 0 - ERC20, 1 - baseInETH, 2 - quoteInETH, 3 - baseOutETH, 4 - quoteOutETH
uint256 minBaseReserve,
@@ -282,7 +280,6 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
paramList[0],
paramList[1],
paramList[2],
paramList[3],
amountList[2],
amountList[3],
minBaseReserve,

View File

@@ -21,7 +21,7 @@ contract DODOV2RouteHelper {
uint256 Q;
uint256 B0;
uint256 Q0;
uint8 R;
uint256 R;
uint256 lpFeeRate;
uint256 mtFeeRate;
address baseToken;
@@ -60,19 +60,17 @@ contract DODOV2RouteHelper {
curRes.quoteToken = token0;
}
if(!IDODOV2(cur)._BUYING_CLOSE_() && !IDODOV2(cur)._SELLING_CLOSE_()){
(
curRes.i,
curRes.K,
curRes.B,
curRes.Q,
curRes.B0,
curRes.Q0,
curRes.R
) = IDODOV2(cur).getPMMStateForCall();
(
curRes.i,
curRes.K,
curRes.B,
curRes.Q,
curRes.B0,
curRes.Q0,
curRes.R
) = IDODOV2(cur).getPMMStateForCall();
(curRes.lpFeeRate, curRes.mtFeeRate) = IDODOV2(cur).getUserFeeRate(userAddr);
}
(curRes.lpFeeRate, curRes.mtFeeRate) = IDODOV2(cur).getUserFeeRate(userAddr);
curRes.curPair = cur;
res[i] = curRes;
}

View File

@@ -22,12 +22,6 @@ interface IDODOV2 {
function _QUOTE_TOKEN_() external view returns (address);
function _BUYING_CLOSE_() external view returns (bool);
function _SELLING_CLOSE_() external view returns (bool);
function _OWNER_() external returns (address);
function getPMMStateForCall() external view returns (
uint256 i,
uint256 K,
@@ -35,7 +29,7 @@ interface IDODOV2 {
uint256 Q,
uint256 B0,
uint256 Q0,
uint8 R
uint256 R
);
function getUserFeeRate(address user) external view returns (uint256 lpFeeRate, uint256 mtFeeRate);
@@ -64,7 +58,6 @@ interface IDODOV2 {
address baseToken,
address quoteToken,
uint256 lpFeeRate,
uint256 mtFeeRate,
uint256 k,
uint256 i
) external;
@@ -72,7 +65,6 @@ interface IDODOV2 {
function reset(
address operator,
uint256 newLpFeeRate,
uint256 newMtFeeRate,
uint256 newI,
uint256 newK,
uint256 baseOutAmount,
@@ -82,6 +74,8 @@ interface IDODOV2 {
) external returns (bool);
function getPrivatePoolBidirection(address token0, address token1) external view returns (address[] memory baseToken0Pool, address[] memory baseToken1Pool);
function _OWNER_() external returns (address);
//========== CrowdPooling ===========

View File

@@ -77,7 +77,6 @@ interface IDODOV2Proxy01 is IDODOV1Proxy01 {
uint256 baseInAmount,
uint256 quoteInAmount,
uint256 lpFeeRate,
uint256 mtFeeRate,
uint256 i,
uint256 k,
uint256 deadLine
@@ -85,7 +84,7 @@ interface IDODOV2Proxy01 is IDODOV1Proxy01 {
function resetDODOPrivatePool(
address dppAddress,
uint256[] memory paramList, //0 - newLpFeeRate, 1 - newMtFeeRate, 2 - newI, 3 - newK
uint256[] memory paramList, //0 - newLpFeeRate, 1 - newI, 2 - newK
uint256[] memory amountList, //0 - baseInAmount, 1 - quoteInAmount, 2 - baseOutAmount, 3 - quoteOutAmount
uint8 flag, // 0 - ERC20, 1 - baseInETH, 2 - quoteInETH, 3 - baseOutETH, 4 - quoteOutETH
uint256 minBaseReserve,