S corp shareholder basis is tracked on IRS form 7203 which is included within the screens for the IRS Schedule K-1 (1120S).
The form takes into account gains, losses, distributions among other things.
Form instructions are here.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"