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
_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
_0
address
undefined
blocks
function blocks(address) external view returns (bool enabled, string name)
The mapping of blocks
Parameters
_0
address
undefined
Returns
enabled
bool
undefined
name
string
undefined
blocksLength
function blocksLength() external view returns (uint256)
The number of blocks registered
Returns
_0
uint256
undefined
blocksValid
function blocksValid(address[] _blocks) external view returns (bool)
Checks if the given blocks are valid (enabled).
Parameters
_blocks
address[]
_blocks Array of block addresses to be checked.
Returns
_0
bool
A boolean indicating whether all the blocks are valid.
getBlocks
function getBlocks(address[] _blocks) external view returns (struct IStrategBlockRegistry.StrategBlockData[])
Retrieves the data of the given blocks.
Parameters
_blocks
address[]
Array of block addresses.
Returns
_0
IStrategBlockRegistry.StrategBlockData[]
An array of StrategBlockData containing the data of the blocks.
isConsumingScheduledOp
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
_0
bytes4
undefined
removeBlocks
function removeBlocks(address[] _blocks) external nonpayable
Removes multiple blocks from the registry.
Parameters
_blocks
address[]
Array of block addresses to be removed.
setAuthority
function setAuthority(address newAuthority) external nonpayable
Transfers control to a new authority. The caller must be the current authority.
Parameters
newAuthority
address
undefined
Events
AuthorityUpdated
event AuthorityUpdated(address authority)
Authority that manages this contract was updated.
Parameters
authority
address
undefined
NewBlock
event NewBlock(address addr, string name)
Event emitted when a block is added to the registry
Parameters
addr
address
Address of the block added
name
string
Name of the block added
RemoveBlock
event RemoveBlock(address addr)
Event emitted when a block is removed from the registry
Parameters
addr
address
Address of the block removed
Errors
AccessManagedInvalidAuthority
error AccessManagedInvalidAuthority(address authority)
Parameters
authority
address
undefined
AccessManagedRequiredDelay
error AccessManagedRequiredDelay(address caller, uint32 delay)
Parameters
caller
address
undefined
delay
uint32
undefined
AccessManagedUnauthorized
error AccessManagedUnauthorized(address caller)
Parameters
caller
address
undefined
BlockAlreadyExists
error BlockAlreadyExists()
Error thrown when trying to add a block that is already registered
NotDeployer
error NotDeployer()
Error thrown when the caller is not the deployer
NotOwner
error NotOwner()
Error thrown when the caller is not the owner
Last updated