GenericRateProvider

Git Source

Inherits: IRateProvider

State Variables

target

The address to make rate calls to.

address public immutable target;

selector

The selector to call on the target.

bytes4 public immutable selector;

staticArgument0

Static arguments to pass to the target.

bytes32 public immutable staticArgument0;

staticArgument1

bytes32 public immutable staticArgument1;

staticArgument2

bytes32 public immutable staticArgument2;

staticArgument3

bytes32 public immutable staticArgument3;

staticArgument4

bytes32 public immutable staticArgument4;

staticArgument5

bytes32 public immutable staticArgument5;

staticArgument6

bytes32 public immutable staticArgument6;

staticArgument7

bytes32 public immutable staticArgument7;

Functions

constructor

constructor(
    address _target,
    bytes4 _selctor,
    bytes32 _staticArgument0,
    bytes32 _staticArgument1,
    bytes32 _staticArgument2,
    bytes32 _staticArgument3,
    bytes32 _staticArgument4,
    bytes32 _staticArgument5,
    bytes32 _staticArgument6,
    bytes32 _staticArgument7
);

getRate

Get the rate of some generic asset.

This function only supports selectors that only contain static arguments, dynamic arguments will not be encoded correctly, and calls will likely fail.

If staticArgumentN is not used, it can be left as 0.

function getRate() public view returns (uint256);