# PermissionGroups

{% hint style="warning" %}
You are referring to the **`Legacy`** version of KyberSwap docs.

For the most updated information, please refer to:

* [**`Classic`**](https://github.com/KyberNetwork/kyberswap-documentation/blob/main/reference/legacy/api-abi/misc-contracts/broken-reference/README.md)
* [**`Elastic`**](https://docs.kyberswap.com/reference/legacy/kyberswap-elastic)
* [**`Limit Order`**](https://docs.kyberswap.com/kyberswap-solutions/limit-order)
* [**`Aggregator`**](https://docs.kyberswap.com/kyberswap-solutions/kyberswap-aggregator)
  {% endhint %}

## contract PermissionGroups

*Source*: [PermissionGroups.sol](https://github.com/KyberNetwork/smart-contracts/blob/master/contracts/sol4/PermissionGroups.sol)

The PermissionGroups contract's maintains function modifiers that makes sure permission conditions are met before executing any proceeding body of code.

***

### INDEX[​](https://docs.kyberswap.com/Legacy/api-abi/misc/api_abi-permissiongroups#index) <a href="#index" id="index"></a>

\<AUTOGENERATED\_TABLE\_OF\_CONTENTS>

### REFERENCE[​](https://docs.kyberswap.com/Legacy/api-abi/misc/api_abi-permissiongroups#reference) <a href="#reference" id="reference"></a>

#### Events[​](https://docs.kyberswap.com/Legacy/api-abi/misc/api_abi-permissiongroups#events) <a href="#events" id="events"></a>

#### `AdminClaimed`[​](https://docs.kyberswap.com/Legacy/api-abi/misc/api_abi-permissiongroups#adminclaimed) <a href="#adminclaimed" id="adminclaimed"></a>

Event for logging of the change of admin address.

***

event **AdminClaimed**(address newAdmin, address previousAdmin) | Parameter | Type | Description | | --------------- |:-------:|:------------------------------:| | `newAdmin` | address | address of the new admin | | `previousAdmin` | address | address of the previous admin |\\

#### `AlerterAdded`[​](https://docs.kyberswap.com/Legacy/api-abi/misc/api_abi-permissiongroups#alerteradded) <a href="#alerteradded" id="alerteradded"></a>

Event for logging the addition of an address with alerter role.

***

event **AlerterAdded**(address newAlerter, bool isAdd) | Parameter | Type | Description | | ------------ |:-------:|:--------------------------------------------------------------------------:| | `newAlerter` | address | address of the new alerter | | `isAdd` | bool | if `true`, new alerter was added, otherwise `false` if alerter was removed |\\

#### `OperatorAdded`[​](https://docs.kyberswap.com/Legacy/api-abi/misc/api_abi-permissiongroups#operatoradded) <a href="#operatoradded" id="operatoradded"></a>

Event for logging the addition of an address with operator role.

***

event **OperatorAdded**(address newOperator, bool isAdd) | Parameter | Type | Description | | ------------- |:-------:|:----------------------------------------------------------------------------:| | `newOperator` | address | address of the new operator | | `isAdd` | bool | if `true`, new operator was added, otherwise `false` if operator was removed |

```
<br />

### `TransferAdminPending`
Event for logging for the transfer of the current admin address to the new address .
___
event __TransferAdminPending__(address pendingAdmin)
| Parameter      | Type     | Description                  |
| -------------- |:--------:|:----------------------------:|
| `pendingAdmin` | address  | address of the pending admin |
<br />

### Modifiers

### `onlyAdmin`
Modifier that ensures only an address with admin role can execute a function.

modifier __onlyAdmin__()
___
invokable functions: [addToken](api_abi-conversionrates.md#addtoken), [setValidRateDurationInBlocks](api_abi-conversionrates.md#setvalidratedurationinblocks), [enableTokenTrade](api_abi-conversionrates.md#enabletokentrade), [setReserveAddress](api_abi-conversionrates.md#setreserveaddress), [setReserveData](api_abi-feeburner.md#setreservedata), [setWalletFees](api_abi-feeburner.md#setwalletfees), [setTaxInBps](api_abi-feeburner.md#settaxinbps), [setTaxWallet](api_abi-feeburner.md#settaxwallet), [setKNCRate](api_abi-feeburner.md#setkncrate), [addReserve](api_abi-kybernetwork.md#addreserve), [listPairForReserve](api_abi-kybernetwork.md#listpairforreserve), [setEnable](api_abi-kybernetwork.md#setenable), [enableTrade](api_abi-kyberreserve.md#enabletrade), [approveWithdrawAddress](api_abi-kyberreserve.md#approvewithdrawaddress), [setReasonableDiff](api_abi-sanityrates.md#setreasonablediff), [setTokenControlInfo](api_abi-volumeimbalancerecorder.md#settokencontrolinfo), [withdrawToken](api_abi-withdrawable.md#withdrawtoken), [withdrawEther](api_abi-withdrawable.md#withdrawether), [addAlerter](api_abi-permissiongroups.md#addalerter), [addOperator](api_abi-permissiongroups.md#addoperator), [removeAlerter](api_abi-permissiongroups.md#removealerter), [removeOperator](api_abi-permissiongroups.md#removeoperator), [transferAdmin](api_abi-permissiongroups.md#transferadmin), [transferAdminQuickly](api_abi-permissiongroups.md#transferadminquickly)


<br />

### `onlyAlerter`
Modifier that ensures only an address with alerter role can execute a function.

modifier __onlyAlerter__()
___
invokable functions: [disableTokenTrade](api_abi-conversionrates.md#disabletokentrade), [disableTrade](api_abi-kyberreserve.md#disabletrade)
<br />

### `onlyOperator`
Modifier that ensures only an address with operator role can execute a function.

modifier __onlyOperator__()
___
invokable functions: [setCompactData](api_abi-conversionrates.md#setcompactdata), [setBaseRate](api_abi-conversionrates.md#setbaserate), [setQtyStepFunction](api_abi-conversionrates.md#setqtystepfunction), [setImbalanceStepFunction](api_abi-conversionrates.md#setimbalancestepfunction), [setQuantityFactor](api_abi-expectedrate.md#setquantityfactor), [setMinSlippageFactor](api_abi-expectedrate.md#setminslippagefactor), [setInfo](api_abi-kybernetwork.md#setinfo), [withdraw](api_abi-kyberreserve.md#withdraw), [setSanityRates](api_abi-sanityrates.md#setsanityrates), [setUserCategory](api_abi-whitelist.md#setusercategory), [setCategoryCap](api_abi-whitelist.md#setcategorycap), [setSgdToEthRate](api_abi-whitelist.md#setsgdtoethrate)
<br />

### Functions

### `PermissionGroups`
Contract constructor. Note that constructor methods are called exactly once during contract instantiation and cannot be called again.
___
function __PermissionGroups__() public

<br />

### `addAlerter`
Adds a new address to the list of alerters
___
function __addAlerter__(address newAlerter) public
| Parameter    | Type    | Description                |
| -------------|:-------:|:--------------------------:|
| `newAlerter` | address | address of the new alerter |
Modifiers: [onlyAdmin](api_abi-permissiongroups.md#onlyadmin)

<br />

### `addOperator`
Adds a new address to the list of operators
___
function __addOperator__(address newOperator) public
| Parameter     | Type    | Description                 |
| --------------|:-------:|:---------------------------:|
| `newOperator` | address | address of the new operator |
Modifiers: [onlyAdmin](api_abi-permissiongroups.md#onlyadmin)

<br />

### `claimAdmin`
Allows the pendingAdmin address to finalize the change admin process
___
function __claimAdmin__() public

<br />

### `getAlerters`
Gets the list of alerters
___
function __getAlerters__() public
**Returns:**\
List of alerters

<br />

### `getOperators`
Gets the list of operators
___
function __getOperators__() public
**Returns:**\
List of operators

<br />

### `removeAlerter`
Removes an address from the list of alerters
___
function __removeAlerter__(address newOperator) public
| Parameter | Type    | Description            |
| ----------|:-------:|:----------------------:|
| `alerter` | address | address of the alerter |
Modifiers: [onlyAdmin](api_abi-permissiongroups.md#onlyadmin)

<br />

### `removeOperator`
Removes an address from the list of operators
___
function __removeOperator__(address newOperator) public
| Parameter  | Type    | Description             |
| -----------|:-------:|:-----------------------:|
| `operator` | address | address of the operator |
Modifiers: [onlyAdmin](api_abi-permissiongroups.md#onlyadmin)

<br />

### `transferAdmin`
Allows the current admin to set the new admin address
___
function __transferAdmin__(address newAdmin) public
| Parameter  | Type    | Description                          |
| -----------|:-------:|:------------------------------------:|
| `newAdmin` | address | the address to transfer ownership to |
Modifiers: [onlyAdmin](api_abi-permissiongroups.md#onlyadmin)

<br />

### `transferAdminQuickly`
Allows the current admin to set the new admin address in one tx
___
function __transferAdminQuickly__(address newAdmin) public
| Parameter  | Type    | Description                          |
| -----------|:-------:|:------------------------------------:|
| `newAdmin` | address | the address to transfer ownership to |
Modifiers: [onlyAdmin](api_abi-permissiongroups.md#onlyadmin)

<br />
```


---

# 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.kyberswap.com/reference/legacy/api-abi/misc-contracts/permissiongroups.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.
