Skip to content

Commit 0ae44d0

Browse files
satyamakgecmaxsam4
authored andcommitted
Remove inconsistency of the index value (#688)
1 parent dcea2c4 commit 0ae44d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contracts/modules/TransferManager/LTM/LockUpTransferManager.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ contract LockUpTransferManager is LockUpTransferManagerStorage, TransferManager
550550
// delete the user from the lockup type
551551
uint256 _lockupIndex = lockupToUserIndex[_lockupName][_userAddress];
552552
uint256 _len = lockupToUsers[_lockupName].length;
553-
if ( _lockupIndex != _len) {
553+
if ( _lockupIndex != _len - 1) {
554554
lockupToUsers[_lockupName][_lockupIndex] = lockupToUsers[_lockupName][_len - 1];
555555
lockupToUserIndex[_lockupName][lockupToUsers[_lockupName][_lockupIndex]] = _lockupIndex;
556556
}
@@ -560,7 +560,7 @@ contract LockUpTransferManager is LockUpTransferManagerStorage, TransferManager
560560
// delete the lockup from the user
561561
uint256 _userIndex = userToLockupIndex[_userAddress][_lockupName];
562562
_len = userToLockups[_userAddress].length;
563-
if ( _userIndex != _len) {
563+
if ( _userIndex != _len - 1) {
564564
userToLockups[_userAddress][_userIndex] = userToLockups[_userAddress][_len - 1];
565565
userToLockupIndex[_userAddress][userToLockups[_userAddress][_userIndex]] = _userIndex;
566566
}

0 commit comments

Comments
 (0)