fix test
This commit is contained in:
@@ -179,7 +179,6 @@ contract DPPTrader is DPPVault {
|
||||
receiveQuoteAmount = receiveQuoteAmount
|
||||
.sub(DecimalMath.mulFloor(receiveQuoteAmount, lpFeeRate))
|
||||
.sub(mtFee);
|
||||
|
||||
return (receiveQuoteAmount, mtFee, newRState, state.B0);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ pragma solidity 0.6.9;
|
||||
|
||||
import {Ownable} from "../lib/Ownable.sol";
|
||||
import {IERC20} from "../intf/IERC20.sol";
|
||||
import {UniversalERC20} from "./UniversalERC20.sol";
|
||||
import {UniversalERC20} from "./lib/UniversalERC20.sol";
|
||||
import {SafeMath} from "../lib/SafeMath.sol";
|
||||
import {IDODOSellHelper} from "../intf/IDODOSellHelper.sol";
|
||||
import {IDODOSellHelper} from "./intf/IDODOSellHelper.sol";
|
||||
import {IDODOApprove} from "../intf/IDODOApprove.sol";
|
||||
import {IDODO} from "../intf/IDODO.sol";
|
||||
import {IWETH} from "../intf/IWETH.sol";
|
||||
@@ -59,7 +59,7 @@ contract DODOV1Proxy01 is Ownable {
|
||||
uint256 fromTokenAmount,
|
||||
uint256 minReturnAmount,
|
||||
address[] memory dodoPairs,
|
||||
uint256[] memory directions,
|
||||
uint8[] memory directions,
|
||||
uint256 deadline
|
||||
) public payable judgeExpired(deadline) returns (uint256 returnAmount) {
|
||||
if (fromToken != ETH_ADDRESS) {
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
|
||||
pragma solidity 0.6.9;
|
||||
|
||||
import {IDODOV2Proxy01} from "../intf/IDODOV2Proxy01.sol";
|
||||
import {IDODOV2} from "../intf/IDODOV2.sol";
|
||||
import {IDODOV2Proxy01} from "./intf/IDODOV2Proxy01.sol";
|
||||
import {IDODOV2} from "./intf/IDODOV2.sol";
|
||||
import {IERC20} from "../intf/IERC20.sol";
|
||||
import {IWETH} from "../intf/IWETH.sol";
|
||||
import {SafeMath} from "../lib/SafeMath.sol";
|
||||
import {UniversalERC20} from "./UniversalERC20.sol";
|
||||
import {UniversalERC20} from "./lib/UniversalERC20.sol";
|
||||
import {SafeERC20} from "../lib/SafeERC20.sol";
|
||||
import {DecimalMath} from "../lib/DecimalMath.sol";
|
||||
|
||||
@@ -266,7 +266,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01 {
|
||||
uint256 fromTokenAmount,
|
||||
uint256 minReturnAmount,
|
||||
address[] memory dodoPairs,
|
||||
uint256[] memory directions,
|
||||
uint8[] memory directions,
|
||||
uint256 deadline
|
||||
) external virtual override payable judgeExpired(deadline) returns (uint256 returnAmount) {
|
||||
uint256 originToTokenBalance = IERC20(toToken).balanceOf(msg.sender);
|
||||
@@ -309,7 +309,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01 {
|
||||
uint256 fromTokenAmount,
|
||||
uint256 minReturnAmount,
|
||||
address[] memory dodoPairs,
|
||||
uint256[] memory directions,
|
||||
uint8[] memory directions,
|
||||
uint256 deadline
|
||||
) external virtual override judgeExpired(deadline) returns (uint256 returnAmount) {
|
||||
IDODOV2(dodoApprove).claimTokens(fromToken, msg.sender, dodoPairs[0], fromTokenAmount);
|
||||
@@ -350,7 +350,7 @@ contract DODOV2Proxy01 is IDODOV2Proxy01 {
|
||||
uint256 fromTokenAmount,
|
||||
uint256 minReturnAmount,
|
||||
address[] memory dodoPairs,
|
||||
uint256[] memory directions,
|
||||
uint8[] memory directions,
|
||||
uint256 deadline
|
||||
) external virtual override judgeExpired(deadline) returns (uint256 returnAmount) {
|
||||
uint256 originToTokenBalance = IERC20(toToken).balanceOf(msg.sender);
|
||||
|
||||
@@ -27,7 +27,7 @@ interface IDODOV2 {
|
||||
//========== DODOVendingMachine ========
|
||||
|
||||
function createDODOVendingMachine(
|
||||
address from,
|
||||
address creator,
|
||||
address baseToken,
|
||||
address quoteToken,
|
||||
uint256 lpFeeRate,
|
||||
@@ -46,7 +46,7 @@ interface IDODOV2 {
|
||||
|
||||
function initDODOPrivatePool(
|
||||
address dppAddress,
|
||||
address from,
|
||||
address creator,
|
||||
address baseToken,
|
||||
address quoteToken,
|
||||
uint256 lpFeeRate,
|
||||
@@ -56,7 +56,7 @@ interface IDODOV2 {
|
||||
) external;
|
||||
|
||||
function reset(
|
||||
address assetTo,
|
||||
address operator,
|
||||
uint256 newLpFeeRate,
|
||||
uint256 newMtFeeRate,
|
||||
uint256 newI,
|
||||
@@ -65,23 +65,8 @@ interface IDODOV2 {
|
||||
uint256 quoteOutAmount
|
||||
) external;
|
||||
|
||||
function resetETH(
|
||||
address from,
|
||||
uint256 newLpFeeRate,
|
||||
uint256 newMtFeeRate,
|
||||
uint256 newI,
|
||||
uint256 newK,
|
||||
uint256 baseOutAmount,
|
||||
uint256 quoteOutAmount
|
||||
) external;
|
||||
|
||||
//========== DODOSellHelper ============
|
||||
|
||||
function querySellQuoteToken(address pair, uint256 quoteInAmount) external view returns (uint256 expectedReceiveBaseAmount);
|
||||
|
||||
function querySellBaseToken(address pair, uint256 baseInAmount) external view returns (uint256 expectedReceiveQuoteAmount);
|
||||
|
||||
//========== SmartApprove =============
|
||||
//========== IDODOApprove =============
|
||||
|
||||
function claimTokens(address token,address who,address dest,uint256 amount) external;
|
||||
|
||||
@@ -15,7 +15,7 @@ interface IDODOV2Proxy01 {
|
||||
uint256 fromTokenAmount,
|
||||
uint256 minReturnAmount,
|
||||
address[] memory dodoPairs,
|
||||
uint256[] memory directions,
|
||||
uint8[] memory directions,
|
||||
uint256 deadline
|
||||
) external payable returns (uint256 returnAmount);
|
||||
|
||||
@@ -25,7 +25,7 @@ interface IDODOV2Proxy01 {
|
||||
uint256 fromTokenAmount,
|
||||
uint256 minReturnAmount,
|
||||
address[] memory dodoPairs,
|
||||
uint256[] memory directions,
|
||||
uint8[] memory directions,
|
||||
uint256 deadline
|
||||
) external returns (uint256 returnAmount);
|
||||
|
||||
@@ -36,7 +36,7 @@ interface IDODOV2Proxy01 {
|
||||
uint256 fromTokenAmount,
|
||||
uint256 minReturnAmount,
|
||||
address[] memory dodoPairs,
|
||||
uint256[] memory directions,
|
||||
uint8[] memory directions,
|
||||
uint256 deadline
|
||||
) external returns (uint256 returnAmount);
|
||||
|
||||
@@ -111,4 +111,6 @@ interface IDODOV2Proxy01 {
|
||||
//TODO: addLiquidityToClassical
|
||||
|
||||
//TODO: removeLiquidityToClassical
|
||||
|
||||
//TODO: Compatible with classical swap
|
||||
}
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
pragma solidity 0.6.9;
|
||||
|
||||
import {SafeMath} from "../lib/SafeMath.sol";
|
||||
import {IERC20} from "../intf/IERC20.sol";
|
||||
import {SafeERC20} from "../lib/SafeERC20.sol";
|
||||
import {SafeMath} from "../../lib/SafeMath.sol";
|
||||
import {IERC20} from "../../intf/IERC20.sol";
|
||||
import {SafeERC20} from "../../lib/SafeERC20.sol";
|
||||
|
||||
library UniversalERC20 {
|
||||
using SafeMath for uint256;
|
||||
Reference in New Issue
Block a user