AccountantWithRateProviders
Was this helpful?
Was this helpful?
Inherits: Auth, IRateProvider
Store the accountant state in 3 packed slots.
Maps ERC20s to their RateProviderData.
The base asset rates are provided in.
The decimals rates are provided in.
The BoringVault this accountant is working with. Used to determine share supply for fee calculation.
One share of the BoringVault.
Pause this contract, which prevents future calls to updateExchangeRate
, and any safe rate calls will revert.
Callable by MULTISIG_ROLE.
Unpause this contract, which allows future calls to updateExchangeRate
, and any safe rate calls will stop reverting.
Callable by MULTISIG_ROLE.
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.
Update the allowed upper bound change of exchange rate between updateExchangeRateCalls
.
Callable by OWNER_ROLE.
Update the allowed lower bound change of exchange rate between updateExchangeRateCalls
.
Callable by OWNER_ROLE.
Update the management fee to a new value.
Callable by OWNER_ROLE.
Update the payout address fees are sent to.
Callable by OWNER_ROLE.
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.
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.
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.
Get this BoringVault's current rate in the base.
Get this BoringVault's current rate in the base.
Revert if paused.
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.
Get this BoringVault's current rate in the provided quote.
quote
must have its RateProviderData set, else this will revert.
Revert if paused.
Used to change the decimals of precision used for an amount.
Properties
payoutAddress
address
the address claimFees
sends fees to
feesOwedInBase
uint128
total pending fees owed in terms of base
totalSharesLastUpdate
uint128
total amount of shares the last exchange rate update
exchangeRate
uint96
the current exchange rate in terms of base
allowedExchangeRateChangeUpper
uint16
the max allowed change to exchange rate from an update
allowedExchangeRateChangeLower
uint16
the min allowed change to exchange rate from an update
lastUpdateTimestamp
uint64
the block timestamp of the last exchange rate update
isPaused
bool
whether or not this contract is paused
minimumUpdateDelayInSeconds
uint32
the minimum amount of time that must pass between exchange rate updates, such that the update won't trigger the contract to be paused
managementFee
uint16
the management fee
Properties
isPeggedToBase
bool
whether or not the asset is 1:1 with the base asset
rateProvider
IRateProvider
the rate provider for this asset if isPeggedToBase
is false