> For the complete documentation index, see [llms.txt](https://elektro.gitbook.io/elektro-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://elektro.gitbook.io/elektro-protocol/smart-contracts/natspec-technical-documentation/funds-management/fundlockbase.md).

# FundLockBase

View Source: contracts/fund-lock/FundLockBase.sol

**↗ Extends: FundLockStorage** **↘ Derived Contracts: FundLockTrade, FundLockUser**

**FundLockBase**

Base contract, which functionality could be used by several contracts inside the FundLock group.

## Functions

* \_deposit(address tokenAddress, uint256 value)
* \_withdraw(address tokenAddress, uint256 value)

### \_deposit

Internal function used by {FundLockUser.deposit()}. Does general depositing logic: check if the asset is Ether, validates amount and token, performs token transfer to FundLock, updates {balanceSheetS} storage and fires {FundLockDeposit} event.

```js
function _deposit(address tokenAddress, uint256 value) internal nonpayable
returns(bool)
```

**Arguments**

| Name         | Type    | Description                       |
| ------------ | ------- | --------------------------------- |
| tokenAddress | address | - address of the token to deposit |
| value        | uint256 | - the amount of token to deposit  |

### \_withdraw

Marking funds that need to be withdrawn by the client. This function does NOT do any transfers. It only marks funds by creating `Funds` structs and mapping them to user and token addresses. Also changes `balanceSheet` and emits event. Created for security purposes.

```js
function _withdraw(address tokenAddress, uint256 value) internal nonpayable
returns(bool)
```

**Arguments**

| Name         | Type    | Description                                        |
| ------------ | ------- | -------------------------------------------------- |
| tokenAddress | address | - address of the token to be marked for withdrawal |
| value        | uint256 | - amount of the token to be marked for withdrawal  |
