# GNSAddressStore

*Proxy base for the diamond and its facet contracts to store addresses and manage access control*

## initialize

```solidity
function initialize(address _rolesManager) external
```

*Initializes address store facet*

### Parameters

| Name           | Type    | Description           |
| -------------- | ------- | --------------------- |
| \_rolesManager | address | roles manager address |

## getAddresses

```solidity
function getAddresses() external view returns (struct IAddressStore.Addresses)
```

*Returns addresses current values*

## hasRole

```solidity
function hasRole(address _account, enum IAddressStore.Role _role) public view returns (bool)
```

*Returns whether an account has been granted a particular role*

### Parameters

| Name      | Type                    | Description              |
| --------- | ----------------------- | ------------------------ |
| \_account | address                 | account address to check |
| \_role    | enum IAddressStore.Role | role to check            |

## \_setRole

```solidity
function _setRole(address _account, enum IAddressStore.Role _role, bool _value) internal
```

*Update role for account*

### Parameters

| Name      | Type                    | Description                   |
| --------- | ----------------------- | ----------------------------- |
| \_account | address                 | account to update             |
| \_role    | enum IAddressStore.Role | role to set                   |
| \_value   | bool                    | true if allowed, false if not |

## setRoles

```solidity
function setRoles(address[] _accounts, enum IAddressStore.Role[] _roles, bool[] _values) external
```

*Updates access control for a list of accounts*

### Parameters

| Name       | Type                       | Description                     |
| ---------- | -------------------------- | ------------------------------- |
| \_accounts | address\[]                 | accounts addresses to update    |
| \_roles    | enum IAddressStore.Role\[] | corresponding roles to update   |
| \_values   | bool\[]                    | corresponding new values to set |

## \_enforceRole

```solidity
function _enforceRole(enum IAddressStore.Role _role) internal view
```

*Reverts if caller does not have role*

### Parameters

| Name   | Type                    | Description     |
| ------ | ----------------------- | --------------- |
| \_role | enum IAddressStore.Role | role to enforce |

## onlyRole

```solidity
modifier onlyRole(enum IAddressStore.Role _role)
```

*Reverts if caller does not have role*

## onlySelf

```solidity
modifier onlySelf()
```

*Reverts if caller isn't this same contract (facets calling other facets)*


---

# 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.gains.trade/developer/technical-reference/contracts/core/abstract/gnsaddressstore.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.
