> 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/token-management/tokenmanageradmin.md).

# TokenManagerAdmin

View Source: @nomisma/elektro-protocol-aux/contracts/tokens/manager/TokenManagerAdmin.sol

**↗ Extends: Delegator,** [**TokenManagerBase**](broken://pages/TOjwcVPk40tq1hEV5Xad)**, ITokenManagerAdmin** **↘ Derived Contracts: TokenManagerAdminProxy**

**TokenManagerAdmin**

Contract is responsible for managing interactions with tokens. It provides helper functions that allows to get decimals, balances and allowances of tokens. {collectFunds} function is used to safely transfer tokens to `msg.sender` by using {TokenWrapper} contract which implements {safeTransferFrom} function to transfer non compatible {ERC20} tokens

## Contract Members

**Constants & Variables**

```js
bytes32 private constant GOVERNOR_ROLE_NAME;
```

***

```js
bytes32 public constant ADMIN_ROLE_NAME;
```

***

## Functions

* setElektroRegistry(address \_registry)
* setEthereumAddress(address \_ethereumAddress)
* setWETH9Address(address \_weth9Address)
* setTokenWrapper(address \_wrapper)
* collectFundsToFundLock(address from, address tokenAddress, uint256 amount)
* getEthereumAddress()
* getWETH9Address()
* getTokenWrapper()
* getTokenDecimals(address token)
* getTokenSymbol(address token)
* getTokenProperties(address\[] tokens, address spender)
* collectFundsCommon(address from, address tokenAddress, uint256 amount)

### setElektroRegistry

Setting Elektro registry in {TokenManager}

```js
function setElektroRegistry(address _registry) external nonpayable onlyRole 
```

**Arguments**

| Name       | Type    | Description                           |
| ---------- | ------- | ------------------------------------- |
| \_registry | address | address of {ElektroRegistry} contract |

### setEthereumAddress

Setting ethereum asset address in {TokenManager}

```js
function setEthereumAddress(address _ethereumAddress) external nonpayable onlyRole 
```

**Arguments**

| Name              | Type    | Description               |
| ----------------- | ------- | ------------------------- |
| \_ethereumAddress | address | address of ethereum asset |

### setWETH9Address

Setting {WETH9} asset address in {TokenManager}

```js
function setWETH9Address(address _weth9Address) external nonpayable onlyRole 
```

**Arguments**

| Name           | Type    | Description                 |
| -------------- | ------- | --------------------------- |
| \_weth9Address | address | address of {WETH9} contract |

### setTokenWrapper

Setting {TokenWrapper} address in {TokenManager}

```js
function setTokenWrapper(address _wrapper) external nonpayable onlyRole 
```

**Arguments**

| Name      | Type    | Description                        |
| --------- | ------- | ---------------------------------- |
| \_wrapper | address | address of {TokenWrapper} contract |

### collectFundsToFundLock

Function that allows to safely transfer tokens to {FundLock} from an external source. This function is always called by {FundLock}, so msg.sender is address of {FundLock} contract Can be used only by verified Elektro contracts.

```js
function collectFundsToFundLock(address from, address tokenAddress, uint256 amount) external nonpayable onlyAllowedContracts 
```

**Arguments**

| Name         | Type    | Description                                |
| ------------ | ------- | ------------------------------------------ |
| from         | address | address of account to transfer tokens from |
| tokenAddress | address | address of the token to transfer           |
| amount       | uint256 | of tokens to be transferred                |

### getEthereumAddress

Getting address of Ether set in {TokenManager}

```js
function getEthereumAddress() external view
returns(address)
```

**Arguments**

### getWETH9Address

Getting address of WETH9 set in {TokenManager}

```js
function getWETH9Address() external view
returns(address)
```

**Arguments**

### getTokenWrapper

Getting address of {TokenWrapper} contract set in {TokenManager}

```js
function getTokenWrapper() external view
returns(address)
```

**Arguments**

### getTokenDecimals

Helper functions that gets decimals property for specified token

```js
function getTokenDecimals(address token) external view
returns(uint256)
```

**Arguments**

| Name  | Type    | Description                      |
| ----- | ------- | -------------------------------- |
| token | address | address of asset to get decimals |

### getTokenSymbol

Helper functions that gets symbol property for specified token

```js
function getTokenSymbol(address token) external view
returns(string)
```

**Arguments**

| Name  | Type    | Description                        |
| ----- | ------- | ---------------------------------- |
| token | address | address of asset to get symbol for |

### getTokenProperties

Helper functions that gets multiple balances and allowances for specified tokens

```js
function getTokenProperties(address[] tokens, address spender) external view
returns(uint256[], uint256[])
```

**Arguments**

| Name    | Type       | Description                                      |
| ------- | ---------- | ------------------------------------------------ |
| tokens  | address\[] | address of assets to get balances and allowances |
| spender | address    | address of account used to get allowance         |

### collectFundsCommon

See {collectFunds}.

```js
function collectFundsCommon(address from, address tokenAddress, uint256 amount) internal nonpayable
```

**Arguments**

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| from         | address |             |
| tokenAddress | address |             |
| amount       | uint256 |             |
