# grgVault docs

## GrgVault

### stakingProxy

```solidity
address stakingProxy
```

### isInCatastrophicFailure

```solidity
bool isInCatastrophicFailure
```

### \_balances

```solidity
mapping(address => uint256) _balances
```

### grgAssetProxy

```solidity
contract IAssetProxy grgAssetProxy
```

### \_grgToken

```solidity
contract IERC20Token _grgToken
```

### \_grgAssetData

```solidity
bytes _grgAssetData
```

### onlyStakingProxy

```solidity
modifier onlyStakingProxy()
```

*Only stakingProxy can call this function.*

### onlyInCatastrophicFailure

```solidity
modifier onlyInCatastrophicFailure()
```

*Function can only be called in catastrophic failure mode.*

### onlyNotInCatastrophicFailure

```solidity
modifier onlyNotInCatastrophicFailure()
```

*Function can only be called not in catastropic failure mode*

### constructor

```solidity
constructor(address grgProxyAddress, address grgTokenAddress, address newOwner) public
```

*Constructor.*

#### Parameters

| Name            | Type    | Description                         |
| --------------- | ------- | ----------------------------------- |
| grgProxyAddress | address | Address of the RigoBlock Grg Proxy. |
| grgTokenAddress | address | Address of the Grg Token.           |
| newOwner        | address | Address of the Grg vault owner.     |

### setStakingProxy

```solidity
function setStakingProxy(address stakingProxyAddress) external
```

*Sets the address of the StakingProxy contract. Note that only the contract owner can call this function.*

#### Parameters

| Name                | Type    | Description                        |
| ------------------- | ------- | ---------------------------------- |
| stakingProxyAddress | address | Address of Staking proxy contract. |

### enterCatastrophicFailure

```solidity
function enterCatastrophicFailure() external
```

*Vault enters into Catastrophic Failure Mode. \*\*\* WARNING - ONCE IN CATOSTROPHIC FAILURE MODE, YOU CAN NEVER GO BACK! \*\*\* Note that only the contract owner can call this function.*

### setGrgProxy

```solidity
function setGrgProxy(address grgProxyAddress) external
```

*Sets the Grg proxy. Note that only an authorized address can call this function. Note that this can only be called when not in Catastrophic Failure mode.*

#### Parameters

| Name            | Type    | Description                         |
| --------------- | ------- | ----------------------------------- |
| grgProxyAddress | address | Address of the RigoBlock Grg Proxy. |

### depositFrom

```solidity
function depositFrom(address staker, uint256 amount) external
```

*Deposit an `amount` of Grg Tokens from `staker` into the vault. Note that only the Staking contract can call this. Note that this can only be called when not in Catastrophic Failure mode.*

#### Parameters

| Name   | Type    | Description               |
| ------ | ------- | ------------------------- |
| staker | address | of Grg Tokens.            |
| amount | uint256 | of Grg Tokens to deposit. |

### withdrawFrom

```solidity
function withdrawFrom(address staker, uint256 amount) external
```

*Withdraw an `amount` of Grg Tokens to `staker` from the vault. Note that only the Staking contract can call this. Note that this can only be called when not in Catastrophic Failure mode.*

#### Parameters

| Name   | Type    | Description                |
| ------ | ------- | -------------------------- |
| staker | address | of Grg Tokens.             |
| amount | uint256 | of Grg Tokens to withdraw. |

### withdrawAllFrom

```solidity
function withdrawAllFrom(address staker) external returns (uint256)
```

*Withdraw ALL Grg Tokens to `staker` from the vault. Note that this can only be called when in Catastrophic Failure mode.*

#### Parameters

| Name   | Type    | Description    |
| ------ | ------- | -------------- |
| staker | address | of Grg Tokens. |

### balanceOf

```solidity
function balanceOf(address staker) external view returns (uint256)
```

*Returns the balance in Grg Tokens of the `staker`*

#### Return Values

| Name | Type    | Description     |
| ---- | ------- | --------------- |
| \[0] | uint256 | Balance in Grg. |

### balanceOfGrgVault

```solidity
function balanceOfGrgVault() external view returns (uint256)
```

*Returns the entire balance of Grg tokens in the vault.*

### \_withdrawFrom

```solidity
function _withdrawFrom(address staker, uint256 amount) internal
```

*Withdraw an `amount` of Grg Tokens to `staker` from the vault.*

#### Parameters

| Name   | Type    | Description                |
| ------ | ------- | -------------------------- |
| staker | address | of Grg Tokens.             |
| amount | uint256 | of Grg Tokens to withdraw. |

### \_assertSenderIsStakingProxy

```solidity
function _assertSenderIsStakingProxy() private view
```

*Asserts that sender is stakingProxy contract.*

### \_assertInCatastrophicFailure

```solidity
function _assertInCatastrophicFailure() private view
```

*Asserts that vault is in catastrophic failure mode.*

### \_assertNotInCatastrophicFailure

```solidity
function _assertNotInCatastrophicFailure() private view
```

*Asserts that vault is not in catastrophic failure mode.*
