> For the complete documentation index, see [llms.txt](https://developers.strateg.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.strateg.io/core-protocol/contracts/strategblockregistry.md).

# StrategBlockRegistry

A contract where strategy blocks are registered.

## Methods

### addBlocks

```solidity
function addBlocks(address[] _blocks, string[] _names) external nonpayable
```

Adds multiple blocks to the registry.

#### Parameters

| Name     | Type       | Description                                          |
| -------- | ---------- | ---------------------------------------------------- |
| \_blocks | address\[] | Array of block addresses to be added.                |
| \_names  | string\[]  | Array of names corresponding to the strategy blocks. |

### authority

```solidity
function authority() external view returns (address)
```

*Returns the current authority.*

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

### blocks

```solidity
function blocks(address) external view returns (bool enabled, string name)
```

The mapping of blocks

#### Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | address | undefined   |

#### Returns

| Name    | Type   | Description |
| ------- | ------ | ----------- |
| enabled | bool   | undefined   |
| name    | string | undefined   |

### blocksLength

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

The number of blocks registered

#### Returns

| Name | Type    | Description |
| ---- | ------- | ----------- |
| \_0  | uint256 | undefined   |

### blocksValid

```solidity
function blocksValid(address[] _blocks) external view returns (bool)
```

Checks if the given blocks are valid (enabled).

#### Parameters

| Name     | Type       | Description                                      |
| -------- | ---------- | ------------------------------------------------ |
| \_blocks | address\[] | \_blocks Array of block addresses to be checked. |

#### Returns

| Name | Type | Description                                            |
| ---- | ---- | ------------------------------------------------------ |
| \_0  | bool | A boolean indicating whether all the blocks are valid. |

### getBlocks

```solidity
function getBlocks(address[] _blocks) external view returns (struct IStrategBlockRegistry.StrategBlockData[])
```

Retrieves the data of the given blocks.

#### Parameters

| Name     | Type       | Description               |
| -------- | ---------- | ------------------------- |
| \_blocks | address\[] | Array of block addresses. |

#### Returns

| Name | Type                                      | Description                                                     |
| ---- | ----------------------------------------- | --------------------------------------------------------------- |
| \_0  | IStrategBlockRegistry.StrategBlockData\[] | An array of StrategBlockData containing the data of the blocks. |

### isConsumingScheduledOp

```solidity
function isConsumingScheduledOp() external view returns (bytes4)
```

*Returns true only in the context of a delayed restricted call, at the moment that the scheduled operation is being consumed. Prevents denial of service for delayed restricted calls in the case that the contract performs attacker controlled calls.*

#### Returns

| Name | Type   | Description |
| ---- | ------ | ----------- |
| \_0  | bytes4 | undefined   |

### removeBlocks

```solidity
function removeBlocks(address[] _blocks) external nonpayable
```

Removes multiple blocks from the registry.

#### Parameters

| Name     | Type       | Description                             |
| -------- | ---------- | --------------------------------------- |
| \_blocks | address\[] | Array of block addresses to be removed. |

### setAuthority

```solidity
function setAuthority(address newAuthority) external nonpayable
```

*Transfers control to a new authority. The caller must be the current authority.*

#### Parameters

| Name         | Type    | Description |
| ------------ | ------- | ----------- |
| newAuthority | address | undefined   |

## Events

### AuthorityUpdated

```solidity
event AuthorityUpdated(address authority)
```

*Authority that manages this contract was updated.*

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| authority | address | undefined   |

### NewBlock

```solidity
event NewBlock(address addr, string name)
```

Event emitted when a block is added to the registry

#### Parameters

| Name | Type    | Description                |
| ---- | ------- | -------------------------- |
| addr | address | Address of the block added |
| name | string  | Name of the block added    |

### RemoveBlock

```solidity
event RemoveBlock(address addr)
```

Event emitted when a block is removed from the registry

#### Parameters

| Name | Type    | Description                  |
| ---- | ------- | ---------------------------- |
| addr | address | Address of the block removed |

## Errors

### AccessManagedInvalidAuthority

```solidity
error AccessManagedInvalidAuthority(address authority)
```

#### Parameters

| Name      | Type    | Description |
| --------- | ------- | ----------- |
| authority | address | undefined   |

### AccessManagedRequiredDelay

```solidity
error AccessManagedRequiredDelay(address caller, uint32 delay)
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| caller | address | undefined   |
| delay  | uint32  | undefined   |

### AccessManagedUnauthorized

```solidity
error AccessManagedUnauthorized(address caller)
```

#### Parameters

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| caller | address | undefined   |

### BlockAlreadyExists

```solidity
error BlockAlreadyExists()
```

Error thrown when trying to add a block that is already registered

### NotDeployer

```solidity
error NotDeployer()
```

Error thrown when the caller is not the deployer

### NotOwner

```solidity
error NotOwner()
```

Error thrown when the caller is not the owner
