mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
16 lines
459 B
Solidity
16 lines
459 B
Solidity
pragma solidity ^0.7.0;
|
|
|
|
import { TokenInterface } from "./interfaces.sol";
|
|
|
|
abstract contract Utils {
|
|
function convertEthToWeth(bool isEth, TokenInterface token, uint amount) internal {
|
|
if(isEth) token.deposit{value: amount}();
|
|
}
|
|
|
|
function convertWethToEth(bool isEth, TokenInterface token, uint amount) internal {
|
|
if(isEth) {
|
|
token.approve(address(token), amount);
|
|
token.withdraw(amount);
|
|
}
|
|
}
|
|
} |