Skip to content

Commit

Permalink
Fix weth issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dulguun-staderlabs committed Jan 5, 2024
1 parent 7421670 commit c93e196
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions contracts/OperatorRewardsCollector.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ contract OperatorRewardsCollector is IOperatorRewardsCollector, AccessControlUpg
if (balances[operator] < operatorLiquidation.totalAmountInEth) revert InsufficientBalance();

// Transfer WETH to liquidator and ETH to treasury
weth.deposit{value: operatorLiquidation.totalAmountInEth}();
weth.deposit{value: operatorLiquidation.totalAmountInEth - operatorLiquidation.totalFeeInEth}();
if (
weth.transferFrom(
address(this),
Expand Down Expand Up @@ -132,7 +132,14 @@ contract OperatorRewardsCollector is IOperatorRewardsCollector, AccessControlUpg
// If there's an amount to send, transfer it to the operator's rewards address
if (amount > 0) {
address rewardsAddress = UtilLib.getOperatorRewardAddress(operator, staderConfig);
UtilLib.sendValue(rewardsAddress, amount);
weth.deposit{value: amount}();
if (
weth.transferFrom(
address(this),
rewardsAddress,
amount
) == false
) revert WethTransferFailed();
emit Claimed(rewardsAddress, amount);
}
}
Expand Down

0 comments on commit c93e196

Please sign in to comment.