Skip to content

Commit

Permalink
update transfer routefee
Browse files Browse the repository at this point in the history
  • Loading branch information
Skyewwww committed Sep 6, 2024
1 parent 85b2295 commit fb2ee21
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions contracts/SmartRoute/DODORouteProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ contract DODOFeeRouteProxy is Ownable {
uint256 returnAmount
);

event TransferHistory(
address token,
event PositiveSlippage(
uint256 amount
);

Expand Down Expand Up @@ -504,7 +503,6 @@ contract DODOFeeRouteProxy is Ownable {
require(brokerFeeRate < 10**18, "DODORouteProxy: brokerFeeRate overflowed");

uint256 routeFee = DecimalMath.mulFloor(receiveAmount, routeFeeRate);
IERC20(toToken).universalTransfer(payable(routeFeeReceiver), routeFee);

uint256 brokerFee = DecimalMath.mulFloor(receiveAmount, brokerFeeRate);
IERC20(toToken).universalTransfer(payable(broker), brokerFee);
Expand All @@ -514,9 +512,12 @@ contract DODOFeeRouteProxy is Ownable {

if (receiveAmount > expReturnAmount) {
uint256 amount = receiveAmount - expReturnAmount;
IERC20(toToken).universalTransfer(payable(routeFeeReceiver), amount);
IERC20(toToken).universalTransfer(payable(routeFeeReceiver), amount + routeFee);
receiveAmount = expReturnAmount;
emit TransferHistory(toToken, amount);

emit PositiveSlippage(amount);
} else {
IERC20(toToken).universalTransfer(payable(routeFeeReceiver), routeFee);
}

if (originToToken == _ETH_ADDRESS_) {
Expand Down

0 comments on commit fb2ee21

Please sign in to comment.