mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Fixed paraswp approve issue
This commit is contained in:
parent
3a4480d5d3
commit
d6af759404
|
@ -3,6 +3,7 @@ pragma solidity ^0.7.0;
|
|||
import { DSMath } from "../../common/math.sol";
|
||||
import { Basic } from "../../common/basic.sol";
|
||||
import { TokenInterface } from "../../common/interfaces.sol";
|
||||
import { AugustusSwapperInterface } from "./interface.sol";
|
||||
|
||||
abstract contract Helpers is DSMath, Basic {
|
||||
|
||||
|
@ -43,7 +44,8 @@ abstract contract Helpers is DSMath, Basic {
|
|||
if (address(_sellAddr) == maticAddr) {
|
||||
maticAmt = swapData._sellAmt;
|
||||
} else {
|
||||
TokenInterface(_sellAddr).approve(paraswap, swapData._sellAmt);
|
||||
address tokenProxy = AugustusSwapperInterface(paraswap).getTokenTransferProxy();
|
||||
TokenInterface(_sellAddr).approve(tokenProxy, swapData._sellAmt);
|
||||
}
|
||||
|
||||
swapData._buyAmt = _swapHelper(swapData, maticAmt);
|
||||
|
|
5
contracts/polygon/connectors/paraswap/interface.sol
Normal file
5
contracts/polygon/connectors/paraswap/interface.sol
Normal file
|
@ -0,0 +1,5 @@
|
|||
pragma solidity ^0.7.0;
|
||||
|
||||
interface AugustusSwapperInterface {
|
||||
function getTokenTransferProxy() external view returns (address);
|
||||
}
|
Loading…
Reference in New Issue
Block a user