# Withdraw

WITHDRAW SYSTEM :

* If yours project wants to take a fee or report unstake from stake of specific user you need to call `ISDK(farmAddress).noticeReducedStakeWithoutStakeId`&#x20;

```solidity
function noticeReducedStakeWithoutStakeId( 
    address _user,   
    uint256 _amount
)
```

* Once the stake was updated to new state there is mapping called&#x20;

  ```solidity
  mapping(address => uint256) public totalPendingAmountForUser;
  ```

that after `noticeReducedStakeWithoutStakeId` was called, contains newly collected rewards that stake that was updated was earning during staking time.

* In order for user to collect those collected rewards from `totalPendingAmountForUser` he can call directly from contract `TokensFarmSDK.withdrawRewards(msg.sender)` or you can execute withdraw from contract admin through `ISDK(farmAddress).withdrawRewards(addressOfUser)`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tokensfarm.com/for-developers/tokensfarmsdk/withdraw.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
