Skip to content

Commit

Permalink
chore: assign valueToDeposit as a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaraRingas committed Nov 22, 2024
1 parent 92c1cb2 commit 4648402
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/router-plus/SuperformRouterPlus.sol
Original file line number Diff line number Diff line change
Expand Up @@ -641,11 +641,14 @@ contract SuperformRouterPlus is ISuperformRouterPlus, BaseSuperformRouterPlus {
uint256 amountIn = _validateAndGetAmountIn(args.depositCallData, amountRedeemed);

address router = _getAddress(keccak256("SUPERFORM_ROUTER"));
uint256 valueToDeposit;
{
uint256 valuePerItem = (msg.value - (msg.value % arrayLength)) / arrayLength;
uint256 remainingValue = msg.value % arrayLength;
valueToDeposit = valuePerItem + remainingValue;
}

uint256 valuePerItem = (msg.value - (msg.value % arrayLength)) / arrayLength;
uint256 remainingValue = msg.value % arrayLength;

_deposit(router, asset, amountIn, valuePerItem + remainingValue, args.depositCallData);
_deposit(router, asset, amountIn, valueToDeposit, args.depositCallData);

_tokenRefunds(router, assetAdr, args.receiverAddressSP, balanceBefore);

Expand Down

0 comments on commit 4648402

Please sign in to comment.