IFeeManager

Git Source

Inherits: IERC165

Functions

s_subscriberDiscounts

Gets the subscriber discount for a specific feedId.

function s_subscriberDiscounts(address subscriber, bytes32 feedId, address token) external view returns (uint256);

Parameters

NameTypeDescription
subscriberaddressThe address of the subscriber to check for a discount.
feedIdbytes32The feedId related to the discount.
tokenaddressThe address of the quote payment token.

Returns

NameTypeDescription
<none>uint256The current subscriber discount.

s_linkDeficit

Gets any subsidized LINK that is owed to the reward manager for a specific feedId.

function s_linkDeficit(bytes32 feedId) external view returns (uint256);

Parameters

NameTypeDescription
feedIdbytes32The feedId related to the link deficit.

Returns

NameTypeDescription
<none>uint256The amount of link deficit.

i_linkAddress

Gets the LINK token address.

function i_linkAddress() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of the LINK token.

i_nativeAddress

Gets the native token address.

function i_nativeAddress() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of the native token.

i_proxyAddress

Gets the proxy contract address.

function i_proxyAddress() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of the proxy contract.

s_nativeSurcharge

Gets the surcharge fee to be paid if paying in native.

function s_nativeSurcharge() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The surcharge fee for native payments.

getFeeAndReward

Calculates the applied fee and reward from a report. If the sender is a subscriber, they will receive a discount.

function getFeeAndReward(address subscriber, bytes memory report, address quoteAddress)
    external
    view
    returns (Asset memory feeData, Asset memory rewardData, uint256 discount);

Parameters

NameTypeDescription
subscriberaddressThe address of the subscriber trying to verify.
reportbytesThe report to calculate the fee for.
quoteAddressaddressThe address of the quote payment token.

Returns

NameTypeDescription
feeDataAssetThe calculated fee data.
rewardDataAssetThe calculated reward data.
discountuint256The current subscriber discount applied.

Structs

Asset

The Asset struct to hold the address of an asset and its amount.

struct Asset {
    address assetAddress;
    uint256 amount;
}

Properties

NameTypeDescription
assetAddressaddressThe address of the asset.
amountuint256The amount of the asset.