fix mixSwap weth to eth
This commit is contained in:
@@ -89,8 +89,8 @@ contract DVMFactory is InitializableOwnable {
|
||||
);
|
||||
}
|
||||
_REGISTRY_[baseToken][quoteToken].push(newVendingMachine);
|
||||
_USER_REGISTRY_[msg.sender].push(newVendingMachine);
|
||||
emit NewDVM(baseToken, quoteToken, msg.sender, newVendingMachine);
|
||||
_USER_REGISTRY_[tx.origin].push(newVendingMachine);
|
||||
emit NewDVM(baseToken, quoteToken, tx.origin, newVendingMachine);
|
||||
}
|
||||
|
||||
// ============ Admin Operation Functions ============
|
||||
|
||||
@@ -645,20 +645,27 @@ contract DODOV2Proxy01 is IDODOV2Proxy01, ReentrancyGuard, InitializableOwnable
|
||||
IUni(curPair).swapExactTokensForTokens(curAmountIn,0,portionPath,address(this),deadLine);
|
||||
}
|
||||
}
|
||||
|
||||
IERC20(_toToken).universalTransfer(
|
||||
msg.sender,
|
||||
IERC20(_toToken).universalBalanceOf(address(this))
|
||||
);
|
||||
|
||||
{
|
||||
uint256 toBalance;
|
||||
if (_toToken == _ETH_ADDRESS_) {
|
||||
toBalance = IWETH(_WETH_).balanceOf(address(this));
|
||||
IWETH(_WETH_).withdraw(toBalance);
|
||||
} else {
|
||||
toBalance = IERC20(_toToken).tokenBalanceOf(address(this));
|
||||
}
|
||||
IERC20(_toToken).universalTransfer(msg.sender,toBalance);
|
||||
}
|
||||
|
||||
returnAmount = IERC20(_toToken).universalBalanceOf(msg.sender).sub(toTokenOriginBalance);
|
||||
require(returnAmount >= minReturnAmount, "DODOV2Proxy01: Return amount is not enough");
|
||||
|
||||
|
||||
_externalGasReturn();
|
||||
|
||||
if(isIncentive) {
|
||||
IDODOIncentive(_DODO_INCENTIVE_).triggerIncentive(_fromToken,_toToken,msg.sender);
|
||||
}
|
||||
|
||||
emit OrderHistory(_fromToken, _toToken, msg.sender, fromTokenAmount, returnAmount);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,4 +81,10 @@ Deploy type: Proxy
|
||||
DODOApprove Address: 0xE0eE1f72c0Ce4097F204beBD3B7fF508fb26292D
|
||||
DODOProxyV1 Address: 0xf63baBc984ff05374dBCF0367Eaa2333663f2262
|
||||
Set DODOProxyV1 Owner tx: 0x2d00a39ad1904a34b8baa7d6a69bc634ea2bc2cff0038bec79e922b7d0687e76
|
||||
Set DODOApprove Owner And Init Set Proxy tx: 0xf368e47b184b3f0db035fa7a0838eabc46e6f24d98bc44cb0b1b1b8c73e31561
|
||||
Set DODOApprove Owner And Init Set Proxy tx: 0xf368e47b184b3f0db035fa7a0838eabc46e6f24d98bc44cb0b1b1b8c73e31561
|
||||
====================================================
|
||||
network type: live
|
||||
Deploy time: 2021/1/11 上午10:23:58
|
||||
Deploy type: Proxy
|
||||
DODOProxyV2 Address: 0x6ed3fd491F5B10384787B3fb162A72227FaFBf63
|
||||
Set DODOProxyV2 Owner tx: 0x438ba2bfcee92e641a3e48709de31bd0e2fcb9866d30f6d73be837e3b42bd551
|
||||
|
||||
@@ -189,3 +189,20 @@ DODOProxyV2 Address: 0xB035847e685925647AaA8b9d74e3bFF36f81EBcB
|
||||
Init DODOProxyV2 Tx: 0xe98f8e73c4ae138e8d9594dff37afd6657bb34ac8b644e1c6fa9c2f8df8413da
|
||||
DODOApprove Init tx: 0x7b1718f215975439ff86791a0eb05cbea2081e5e1b9d9c6751280a24a1dbb17c
|
||||
DODOIncentive ChangeProxy tx: 0x670e992a681a8808b112a8c5531df7ab11beac55f603d495a07ff91dce42cad4
|
||||
====================================================
|
||||
network type: kovan
|
||||
Deploy time: 2021/1/11 下午8:31:34
|
||||
Deploy type: V2
|
||||
DODOApprove Address: 0xe51d8085aB43AC8BC98e965b2F7B79b998c23814
|
||||
====================================================
|
||||
network type: kovan
|
||||
Deploy time: 2021/1/11 下午8:33:29
|
||||
Deploy type: V2
|
||||
DODOApprove Address: 0x9d48172B0189de70F8788DE10196A1FB622B8E6b
|
||||
DvmFactoryAddress: 0x369279f8e1cc936f7f9513559897B183d4B2F0Bd
|
||||
Init DvmFactory Tx: 0x999a11c9c72b14d421e9daad6e9b8bf0ebc735560ca704983249156050a149a0
|
||||
DODOProxyV2 Address: 0xbD3CAF4354FeFAf20a1c7240A681A553b40CE393
|
||||
Init DODOProxyV2 Tx: 0xc3d8815852219d5a33b8377389f2f9862010c741f9041b3bfb1f972957dfa9f3
|
||||
DODOApprove Init tx: 0x0fd68e3a962d04ae71815fecff10ae65b09a74fe995ecf064022ae299a6525a1
|
||||
DODOIncentive ChangeProxy tx: 0xe9e4dc61df5a36b11459530a29f7213b05f1611f043d56d733bf9c725f001782
|
||||
DODOV2RouteHelper Address: 0x9007007b1923C264088Fa23920109F5297bAd8c7
|
||||
|
||||
@@ -69,7 +69,7 @@ module.exports = async (deployer, network, accounts) => {
|
||||
WETHAddress = "0x5eca15b12d959dfcf9c71c59f8b467eb8c6efd0b";
|
||||
chiAddress = "0x0000000000004946c0e9f43f4dee607b0ef1fa1c";
|
||||
DODOCalleeHelperAddress = "0x507EBbb195CF54E0aF147A2b269C08a38EA36989";
|
||||
DODORouteV2HelperAddress = "0x3aAfE7c2643807718EFE35D6D529A74255cA4319";
|
||||
DODORouteV2HelperAddress = "";
|
||||
//Template
|
||||
CloneFactoryAddress = "0xf7959fe661124C49F96CF30Da33729201aEE1b27";
|
||||
// FeeRateModelTemplateAddress = "0xEF3137780B387313c5889B999D03BdCf9aeEa892";
|
||||
@@ -81,17 +81,17 @@ module.exports = async (deployer, network, accounts) => {
|
||||
DefaultMtFeeRateAddress = "0xEfdE4225AC747136289979e29f1236527b2E4DB1";
|
||||
DefaultPermissionAddress = "0xACc7E23368261e1E02103c4e5ae672E7D01f5797";
|
||||
|
||||
DvmTemplateAddress = "";
|
||||
DppTemplateAddress = "";
|
||||
DppAdminTemplateAddress = "";
|
||||
CpTemplateAddress = "";
|
||||
DvmTemplateAddress = "0xB13662Fcb9140dD573e74D76BACF2085A853C779";
|
||||
DppTemplateAddress = "0x5121e563d6f091945244d02cfE68b1b617206d76";
|
||||
DppAdminTemplateAddress = "0x59Fd9F2065b9aA717a51111c31B3cA89291BB866";
|
||||
CpTemplateAddress = "0x7b10eE056D1FBeABd0174477418f90032807b06E";
|
||||
//Factory
|
||||
DvmFactoryAddress = "";
|
||||
DppFactoryAddress = "";
|
||||
CpFactoryAddress = "";
|
||||
DppFactoryAddress = "0x6D4a70354cd03ae3A8461eDE9A4dAd445a169a6B";
|
||||
CpFactoryAddress = "0x3a4Cdaf1796b985826CF1Ee451CACA991c2f79E1";
|
||||
//Approve
|
||||
DODOApproveAddress = "";
|
||||
DODOIncentiveAddress = "";
|
||||
DODOIncentiveAddress = "0xe7F4bd2a486DE815824335353973B2f4B94BaCeA";
|
||||
DODOTokenAddress = "0xfF2985D13953Cb92ecc585aA2B6A4AF8cB46068f";
|
||||
//Account
|
||||
multiSigAddress = accounts[0];
|
||||
@@ -164,6 +164,12 @@ module.exports = async (deployer, network, accounts) => {
|
||||
defaultMaintainer = "0x4073f2b9bB95774531b9e23d206a308c614A943a";
|
||||
} else return;
|
||||
|
||||
if (deploySwitch.ROUTER_HELPER) {
|
||||
await deployer.deploy(DODOV2RouteHelper, "0x369279f8e1cc936f7f9513559897B183d4B2F0Bd", "0x6D4a70354cd03ae3A8461eDE9A4dAd445a169a6B");
|
||||
DODOV2RouteHelperAddress = DODOV2RouteHelper.address;
|
||||
logger.log("DODOV2RouteHelper Address: ", DODOV2RouteHelperAddress);
|
||||
}
|
||||
|
||||
if (deploySwitch.DEPLOY_V2) {
|
||||
logger.log("====================================================");
|
||||
logger.log("network type: " + network);
|
||||
|
||||
@@ -38,12 +38,13 @@ module.exports = {
|
||||
* $ truffle test --network <network-name>
|
||||
*/
|
||||
deploySwitch: {
|
||||
DEPLOY_V1: true,
|
||||
DEPLOY_V1: false,
|
||||
DEPLOY_V2: false,
|
||||
MOCK_TOKEN: false,
|
||||
MOCK_V2_POOL: false,
|
||||
MOCK_V2_SWAP: false,
|
||||
MANUAL_ADD_POOL: false
|
||||
MANUAL_ADD_POOL: false,
|
||||
ROUTER_HELPER: false
|
||||
},
|
||||
|
||||
networks: {
|
||||
|
||||
Reference in New Issue
Block a user