API Version: v0.3.1

MockFeeManager v0.3.1 API Reference

MockFeeManager

A mock implementation of the Data Streams verifier fee manager for local testing.

MockFeeManager

Errors

Unauthorized

error Unauthorized()

InvalidAddress

error InvalidAddress()

InvalidQuote

error InvalidQuote()

ExpiredReport

error ExpiredReport()

InvalidDiscount

error InvalidDiscount()

InvalidSurcharge

error InvalidSurcharge()

InvalidDeposit

error InvalidDeposit()

Functions

constructor

Initializes the contract.

constructor(address linkAddress, address nativeAddress, address proxyAddress, address rewardManager)

Parameters

ParameterTypeDescription
linkAddressaddressThe LINK token address
nativeAddressaddressThe wrapped native token address
proxyAddressaddressThe verifier proxy address (only caller)
rewardManageraddressThe reward manager address

processFee

Processes the fee for a single report verification.

function processFee(bytes calldata payload, bytes calldata parameterPayload, address subscriber) external payable override onlyProxy

processFeeBulk

Processes fees for multiple report verifications.

function processFeeBulk(bytes[] calldata payloads, bytes calldata parameterPayload, address subscriber) external payable override onlyProxy

getFeeAndReward

Returns the fee and reward for a report and quote token.

function getFeeAndReward(address subscriber, bytes memory report, address quoteAddress) public view returns (Common.Asset memory, Common.Asset memory, uint256)

Parameters

ParameterTypeDescription
subscriberaddressThe subscriber address (for the discount lookup)
reportbytesThe report data
quoteAddressaddressThe fee token to quote (LINK or wrapped native)

Returns

ParameterTypeDescription
(unnamed)Common.AssetThe fee asset and amount
(unnamed)Common.AssetThe reward asset and amount (always LINK)
(unnamed)uint256The discount applied

setNativeSurcharge

Sets the surcharge applied to native token fees.

function setNativeSurcharge(uint256 surcharge) external onlyOwner

setMockDiscount

Sets a per-subscriber discount.

function setMockDiscount(address subscriber, uint256 discount) external onlyOwner

withdrawMockFee

Withdraws accumulated fees.

function withdrawMockFee(address to, address coin) external onlyOwner

Withdraws accumulated LINK.

function withdrawLink(address to) external onlyOwner

Get the latest Chainlink content straight to your inbox.