Skip to content

Commit fb89fe5

Browse files
committed
fix: add remainder to _deposit() call in _deposit4626()
1 parent 8da0891 commit fb89fe5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/router-plus/SuperformRouterPlus.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,12 @@ contract SuperformRouterPlus is ISuperformRouterPlus, BaseSuperformRouterPlus {
640640

641641
uint256 amountIn = _validateAndGetAmountIn(args.depositCallData, amountRedeemed);
642642

643-
uint256 msgValue = msg.value / arrayLength;
644643
address router = _getAddress(keccak256("SUPERFORM_ROUTER"));
645644

646-
_deposit(router, asset, amountIn, msgValue, args.depositCallData);
645+
uint256 valuePerItem = (msg.value - (msg.value % arrayLength)) / arrayLength;
646+
uint256 remainingValue = msg.value % arrayLength;
647+
648+
_deposit(router, asset, amountIn, valuePerItem + remainingValue, args.depositCallData);
647649

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

0 commit comments

Comments
 (0)