diff --git a/contracts/SmartRoute/helper/DODOV2CuttingRouteHelper.sol b/contracts/SmartRoute/helper/DODOV2CuttingRouteHelper.sol index d179c93..f9e2c68 100644 --- a/contracts/SmartRoute/helper/DODOV2CuttingRouteHelper.sol +++ b/contracts/SmartRoute/helper/DODOV2CuttingRouteHelper.sol @@ -94,17 +94,23 @@ contract DODOV2CuttingRouteHelper is InitializableOwnable { curRes.quoteToken = token0; } - ( - 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); + try IDODOV2(cur).getPMMStateForCall() returns (uint256 _i, uint256 _K, uint256 _B, uint256 _Q, uint256 _B0, uint256 _Q0, uint256 _R){ + curRes.i = _i; + curRes.K = _K; + curRes.B = _B; + curRes.Q = _Q; + curRes.B0 = _B0; + curRes.Q0 = _Q0; + curRes.R = _R; + } catch { + continue; + } + + try IDODOV2(cur).getUserFeeRate(userAddr) returns (uint256 lpFeeRate, uint256 mtFeeRate) { + (curRes.lpFeeRate, curRes.mtFeeRate) = (lpFeeRate, mtFeeRate); + } catch { + (curRes.lpFeeRate, curRes.mtFeeRate) = (0, 1e18); + } curRes.curPair = cur; res[i] = curRes; } diff --git a/contracts/SmartRoute/helper/DODOV2RouteHelper.sol b/contracts/SmartRoute/helper/DODOV2RouteHelper.sol index 5ead267..df9209f 100644 --- a/contracts/SmartRoute/helper/DODOV2RouteHelper.sol +++ b/contracts/SmartRoute/helper/DODOV2RouteHelper.sol @@ -73,17 +73,23 @@ contract DODOV2RouteHelper { curRes.quoteToken = token0; } - ( - 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); + try IDODOV2(cur).getPMMStateForCall() returns (uint256 _i, uint256 _K, uint256 _B, uint256 _Q, uint256 _B0, uint256 _Q0, uint256 _R){ + curRes.i = _i; + curRes.K = _K; + curRes.B = _B; + curRes.Q = _Q; + curRes.B0 = _B0; + curRes.Q0 = _Q0; + curRes.R = _R; + } catch { + continue; + } + + try IDODOV2(cur).getUserFeeRate(userAddr) returns (uint256 lpFeeRate, uint256 mtFeeRate) { + (curRes.lpFeeRate, curRes.mtFeeRate) = (lpFeeRate, mtFeeRate); + } catch { + (curRes.lpFeeRate, curRes.mtFeeRate) = (0, 1e18); + } curRes.curPair = cur; res[i] = curRes; } diff --git a/migrations/3_deploy_v2.js b/migrations/3_deploy_v2.js index 8ab2031..7ca105b 100644 --- a/migrations/3_deploy_v2.js +++ b/migrations/3_deploy_v2.js @@ -185,7 +185,6 @@ module.exports = async (deployer, network, accounts) => { logger.log("Init DefaultMtFeeRateAddress Tx:", tx.tx); } - // todo: 这个需不需要验证 if (UserQuotaAddress == "") { await deployer.deploy(UserQuota); UserQuotaAddress = UserQuota.address; @@ -554,6 +553,7 @@ module.exports = async (deployer, network, accounts) => { logger.log("Init DODOMineV3Proxy Tx:", tx.tx); } + // need deploy dodoRouteProxy in dodo-route-contract repo /* if (DODORouteProxyAddress == "") { await deployer.deploy(