mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Update helpers.sol
add approve
This commit is contained in:
parent
e0322afab7
commit
5c0dd54f24
|
@ -27,4 +27,17 @@ abstract contract Helpers is DSMath, Basic {
|
||||||
return IVaultV3(universeVault).withdraw(share0, share1);
|
return IVaultV3(universeVault).withdraw(share0, share1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _approve(address universeVault, uint256 amount0, uint256 amount1) internal {
|
||||||
|
IVaultV3 universe = IVaultV3(universeVault);
|
||||||
|
TokenInterface token;
|
||||||
|
if (amount0 > 0) {
|
||||||
|
token = universe.token0();
|
||||||
|
token.approve(address(universeAdapter), amount0);
|
||||||
|
}
|
||||||
|
if (amount1 > 0) {
|
||||||
|
token = universe.token1();
|
||||||
|
token.approve(address(universeAdapter), amount1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user