Skip to content

Update oracle daemon config docs #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions docs/contracts/oracle-daemon-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,102 @@ The full list of params are provided in the Lido V2 mainnet parameters [guide](/
:::note
In contrast to [`OracleReportSanityChecker`](/contracts/oracle-report-sanity-checker), the stored values aren't enforced by the protocol on-chain code.
:::

## View methods

### get(string calldata _key)

Retrieves the value corresponding to the provided key.

```solidity
function get(string calldata _key) external view returns (bytes memory)
```

:::note
Reverts if value is missing.
:::

### getList(string[] calldata _keys)

Retrieves a list of values corresponding to the provided keys.

```solidity
function getList(string[] calldata _keys) external view returns (bytes[] memory)
```

:::note
Reverts if any value for a specific key is missing.
:::

## Methods

### set(string calldata _key, bytes calldata _value)

Sets the value for the provided key. Can only be called by users with `CONFIG_MANAGER_ROLE`.

```solidity
function set(string calldata _key, bytes calldata _value) external
```

:::note
Reverts if any of the following is true:
- value with provided key already exists
- value is empty
- called by someone who doesn't have `CONFIG_MANAGER_ROLE` role
:::

### update(string calldata _key, bytes calldata _value)

Updates the value for the provided key. Can only be called by users with `CONFIG_MANAGER_ROLE`.

```solidity
function update(string calldata _key, bytes calldata _value) external
```

:::note
Reverts if any of the following is true:
- value with provided key doesn't exist
- value is the same with the one already set
- value is empty
- called by someone who doesn't have `CONFIG_MANAGER_ROLE` role
:::

### unset(string calldata _key)

Removes the value of the provided key. Can only be called by users with `CONFIG_MANAGER_ROLE`.

```solidity
function unset(string calldata _key) external
```

:::note
Reverts if any of the following is true:
- value with provided key doesn't exist
- called by someone who doesn't have `CONFIG_MANAGER_ROLE` role
:::

## Events

### ConfigValueSet

Emitted when a new key-value pair is set.

```solidity
event ConfigValueSet(string indexed key, bytes value)
```

### ConfigValueUpdated

Emitted when a key-value pair is updated.

```solidity
event ConfigValueUpdated(string indexed key, bytes value)
```

### ConfigValueUnset

Emitted when a key-value pair is unset.

```solidity
event ConfigValueUnset(string indexed key)
```