AccountantWithRateProviders
Inherits: Auth, IRateProvider
State Variables
accountantState
Store the accountant state in 3 packed slots.
rateProviderData
Maps ERC20s to their RateProviderData.
base
The base asset rates are provided in.
decimals
The decimals rates are provided in.
vault
The BoringVault this accountant is working with. Used to determine share supply for fee calculation.
ONE_SHARE
One share of the BoringVault.
Functions
constructor
pause
Pause this contract, which prevents future calls to updateExchangeRate
, and any safe rate calls will revert.
Callable by MULTISIG_ROLE.
unpause
Unpause this contract, which allows future calls to updateExchangeRate
, and any safe rate calls will stop reverting.
Callable by MULTISIG_ROLE.
updateDelay
Update the minimum time delay between updateExchangeRate
calls.
There are no input requirements, as it is possible the admin would want the exchange rate updated as frequently as needed.
Callable by OWNER_ROLE.
updateUpper
Update the allowed upper bound change of exchange rate between updateExchangeRateCalls
.
Callable by OWNER_ROLE.
updateLower
Update the allowed lower bound change of exchange rate between updateExchangeRateCalls
.
Callable by OWNER_ROLE.
updateManagementFee
Update the management fee to a new value.
Callable by OWNER_ROLE.
updatePayoutAddress
Update the payout address fees are sent to.
Callable by OWNER_ROLE.
setRateProviderData
Update the rate provider data for a specific asset
.
Rate providers must return rates in terms of base
or an asset pegged to base and they must use the same decimals as asset
.
Callable by OWNER_ROLE.
updateExchangeRate
Updates this contract exchangeRate.
If new exchange rate is outside of accepted bounds, or if not enough time has passed, this will pause the contract, and this function will NOT calculate fees owed.
Callable by UPDATE_EXCHANGE_RATE_ROLE.
claimFees
Claim pending fees.
This function must be called by the BoringVault.
This function will lose precision if the exchange rate decimals is greater than the feeAsset's decimals.
getRate
Get this BoringVault's current rate in the base.
getRateSafe
Get this BoringVault's current rate in the base.
Revert if paused.
getRateInQuote
Get this BoringVault's current rate in the provided quote.
quote
must have its RateProviderData set, else this will revert.
This function will lose precision if the exchange rate decimals is greater than the quote's decimals.
getRateInQuoteSafe
Get this BoringVault's current rate in the provided quote.
quote
must have its RateProviderData set, else this will revert.
Revert if paused.
changeDecimals
Used to change the decimals of precision used for an amount.
Events
Paused
Unpaused
DelayInSecondsUpdated
UpperBoundUpdated
LowerBoundUpdated
ManagementFeeUpdated
PayoutAddressUpdated
RateProviderUpdated
ExchangeRateUpdated
FeesClaimed
Errors
AccountantWithRateProviders__UpperBoundTooSmall
AccountantWithRateProviders__LowerBoundTooLarge
AccountantWithRateProviders__ManagementFeeTooLarge
AccountantWithRateProviders__Paused
AccountantWithRateProviders__ZeroFeesOwed
AccountantWithRateProviders__OnlyCallableByBoringVault
AccountantWithRateProviders__UpdateDelayTooLarge
Structs
AccountantState
Properties
RateProviderData
Properties