mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
modifications
This commit is contained in:
parent
e3946201a8
commit
fa345da4fc
|
@ -502,12 +502,10 @@ abstract contract CompoundV3Resolver is Events, Helpers {
|
||||||
? CometInterface(market).borrowBalanceOf(address(this))
|
? CometInterface(market).borrowBalanceOf(address(this))
|
||||||
: amt_;
|
: amt_;
|
||||||
|
|
||||||
uint256 borrowBal = CometInterface(market).borrowBalanceOf(
|
uint256 supplyBalance_ = CometInterface(market).balanceOf(
|
||||||
address(this)
|
address(this)
|
||||||
);
|
);
|
||||||
if (borrowBal > 0) {
|
require(supplyBalance_ == 0, "cannot-repay-when-supplied");
|
||||||
require(amt_ <= borrowBal, "repay-amt-greater-than-debt");
|
|
||||||
}
|
|
||||||
|
|
||||||
convertEthToWeth(isEth, tokenContract, amt_);
|
convertEthToWeth(isEth, tokenContract, amt_);
|
||||||
approve(tokenContract, market, amt_);
|
approve(tokenContract, market, amt_);
|
||||||
|
@ -557,10 +555,8 @@ abstract contract CompoundV3Resolver is Events, Helpers {
|
||||||
? CometInterface(market).borrowBalanceOf(to)
|
? CometInterface(market).borrowBalanceOf(to)
|
||||||
: amt_;
|
: amt_;
|
||||||
|
|
||||||
uint256 borrowBal = CometInterface(market).borrowBalanceOf(to);
|
uint256 supplyBalance_ = CometInterface(market).balanceOf(to);
|
||||||
if (borrowBal > 0) {
|
require(supplyBalance_ == 0, "cannot-repay-when-supplied");
|
||||||
require(amt_ <= borrowBal, "repay-amt-greater-than-debt");
|
|
||||||
}
|
|
||||||
|
|
||||||
convertEthToWeth(isEth, tokenContract, amt_);
|
convertEthToWeth(isEth, tokenContract, amt_);
|
||||||
approve(tokenContract, market, amt_);
|
approve(tokenContract, market, amt_);
|
||||||
|
@ -618,12 +614,8 @@ abstract contract CompoundV3Resolver is Events, Helpers {
|
||||||
Action.REPAY
|
Action.REPAY
|
||||||
);
|
);
|
||||||
|
|
||||||
uint256 borrowBal = CometInterface(market).borrowBalanceOf(to);
|
uint256 supplyBalance_ = CometInterface(market).balanceOf(to);
|
||||||
if (borrowBal > 0) {
|
require(supplyBalance_ == 0, "cannot-repay-when-supplied");
|
||||||
require(amt_ <= borrowBal, "repay-amt-greater-than-debt");
|
|
||||||
}
|
|
||||||
|
|
||||||
approve(tokenContract, market, amt_);
|
|
||||||
|
|
||||||
CometInterface(market).supplyFrom(from, to, token_, amt_);
|
CometInterface(market).supplyFrom(from, to, token_, amt_);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user