StrategBlockRegistry

A contract where strategy blocks are registered.

Methods

addBlocks

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

function authority() external view returns (address)

Returns the current authority.

Returns

Name
Type
Description

_0

address

undefined

blocks

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

The number of blocks registered

Returns

Name
Type
Description

_0

uint256

undefined

blocksValid

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

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

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

Removes multiple blocks from the registry.

Parameters

Name
Type
Description

_blocks

address[]

Array of block addresses to be removed.

setAuthority

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

Parameters

Name
Type
Description

newAuthority

address

undefined

Events

AuthorityUpdated

Authority that manages this contract was updated.

Parameters

Name
Type
Description

authority

address

undefined

NewBlock

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

Event emitted when a block is removed from the registry

Parameters

Name
Type
Description

addr

address

Address of the block removed

Errors

AccessManagedInvalidAuthority

Parameters

Name
Type
Description

authority

address

undefined

AccessManagedRequiredDelay

Parameters

Name
Type
Description

caller

address

undefined

delay

uint32

undefined

AccessManagedUnauthorized

Parameters

Name
Type
Description

caller

address

undefined

BlockAlreadyExists

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

NotDeployer

Error thrown when the caller is not the deployer

NotOwner

Error thrown when the caller is not the owner

Last updated