PIDRateSetter

Git Source

Inherits: Authorizable, Modifiable, IPIDRateSetter

This contract is used to trigger the update of the redemption rate using the PID controller

State Variables

oracleRelayer

The oracle relayer where the redemption price and rate are stored

IOracleRelayer public oracleRelayer;

pidCalculator

The PID calculator used to compute the redemption rate

IPIDController public pidCalculator;

_params

Getter for the unpacked contract parameters struct

PIDRateSetterParams public _params;

lastUpdateTime

The timestamp of the last update

uint256 public lastUpdateTime;

Functions

params

Getter for the contract parameters struct

function params() external view returns (PIDRateSetterParams memory _pidRateSetterParams);

Returns

NameTypeDescription
_pidRateSetterParamsPIDRateSetterParamsPIDRateSetter parameters struct

constructor

constructor(
  address _oracleRelayer,
  address _pidCalculator,
  PIDRateSetterParams memory _pidRateSetterParams
) Authorizable(msg.sender) validParams;

Parameters

NameTypeDescription
_oracleRelayeraddressAddress of the oracle relayer
_pidCalculatoraddressAddress of the PID calculator
_pidRateSetterParamsPIDRateSetterParamsInitial valid PID rate setter parameters struct

updateRate

Compute and set a new redemption rate

function updateRate() external;

_modifyParameters

Internal function to be overriden with custom logic to modify parameters

This function is set to revert if not overriden

function _modifyParameters(bytes32 _param, bytes memory _data) internal override;

_validateParameters

Internal function to be overriden with custom logic to validate parameters

function _validateParameters() internal view override;