Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/roles
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos committed Oct 31, 2023
2 parents a6216f0 + 1e4e02b commit a593d69
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ contract TokenManagerLockUnlockFee is TokenManager, NoReEntrancy, ITokenManagerL

token.safeTransferFrom(from, address(this), amount);

return token.balanceOf(address(this)) - balanceBefore;
uint256 diff = token.balanceOf(address(this)) - balanceBefore;
if (diff < amount) {
amount = diff;
}

return amount;
}

/**
Expand All @@ -67,7 +72,12 @@ contract TokenManagerLockUnlockFee is TokenManager, NoReEntrancy, ITokenManagerL

token.safeTransfer(to, amount);

return token.balanceOf(to) - balanceBefore;
uint256 diff = token.balanceOf(to) - balanceBefore;
if (diff < amount) {
amount = diff;
}

return amount;
}

/**
Expand Down

0 comments on commit a593d69

Please sign in to comment.