Fixed paraswp approve issue

This commit is contained in:
Thrilok Kumar 2021-05-03 22:20:26 +05:30
parent 3a4480d5d3
commit d6af759404
2 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,7 @@ pragma solidity ^0.7.0;
import { DSMath } from "../../common/math.sol"; import { DSMath } from "../../common/math.sol";
import { Basic } from "../../common/basic.sol"; import { Basic } from "../../common/basic.sol";
import { TokenInterface } from "../../common/interfaces.sol"; import { TokenInterface } from "../../common/interfaces.sol";
import { AugustusSwapperInterface } from "./interface.sol";
abstract contract Helpers is DSMath, Basic { abstract contract Helpers is DSMath, Basic {
@ -43,7 +44,8 @@ abstract contract Helpers is DSMath, Basic {
if (address(_sellAddr) == maticAddr) { if (address(_sellAddr) == maticAddr) {
maticAmt = swapData._sellAmt; maticAmt = swapData._sellAmt;
} else { } else {
TokenInterface(_sellAddr).approve(paraswap, swapData._sellAmt); address tokenProxy = AugustusSwapperInterface(paraswap).getTokenTransferProxy();
TokenInterface(_sellAddr).approve(tokenProxy, swapData._sellAmt);
} }
swapData._buyAmt = _swapHelper(swapData, maticAmt); swapData._buyAmt = _swapHelper(swapData, maticAmt);

View File

@ -0,0 +1,5 @@
pragma solidity ^0.7.0;
interface AugustusSwapperInterface {
function getTokenTransferProxy() external view returns (address);
}