fix: [asset-swapper] excludedFeeSources. DODO Trade Allowed (#2731)

* fix: Fee sources and Ganache existence

* Added excludedFeeSources

* Comments and CHANGELOG

* fix: DODO Trade Allowed (#2732)
This commit is contained in:
Jacob Evans
2020-10-16 10:01:12 +10:00
committed by GitHub
parent fb21ca5404
commit c4ead689a9
5 changed files with 33 additions and 5 deletions

View File

@@ -34,6 +34,7 @@ interface IDODOHelper {
interface IDODO {
function querySellBaseToken(uint256 amount) external view returns (uint256);
function _TRADE_ALLOWED_() external view returns (bool);
}
contract DODOSampler is
@@ -80,6 +81,11 @@ contract DODOSampler is
sellBase = false;
}
// DODO Pool has been disabled
if (!IDODO(pool)._TRADE_ALLOWED_()) {
return (sellBase, pool, makerTokenAmounts);
}
for (uint256 i = 0; i < numSamples; i++) {
uint256 buyAmount = _sampleSellForApproximateBuyFromDODO(
abi.encode(takerToken, pool, baseToken), // taker token data
@@ -132,6 +138,11 @@ contract DODOSampler is
sellBase = false;
}
// DODO Pool has been disabled
if (!IDODO(pool)._TRADE_ALLOWED_()) {
return (sellBase, pool, takerTokenAmounts);
}
takerTokenAmounts = _sampleApproximateBuys(
ApproximateBuyQuoteOpts({
makerTokenData: abi.encode(makerToken, pool, baseToken),