RateSchedule
Source: contracts/peripherals/RateSchedule.sol · Upgradeable (UUPS proxy)
Functions that change state
Function
Who can call
Also
initialize(address owner_)Once, when the proxy is initialised
renounceOwnership()The owner
setCflSources(address[] sources)onlyOwnersetProduct(bytes32 stateCode, bytes32 productId, (bool,uint32,uint32,uint128,uint32,uint64,bool,uint128,uint32) params, (uint128,uint32)[] bands)onlyOwnertransferOwnership(address newOwner)The owner
upgradeTo(address newImplementation)onlyOwner (via _authorizeUpgrade)upgradeToAndCall(address newImplementation, bytes data)onlyOwner (via _authorizeUpgrade)payable
Read functions
Anyone can call these; they change nothing.
Function
Returns
aggregatePrincipalOf(address member)uint256 total
bandsFor(bytes32 stateCode, bytes32 productId)(uint128,uint32)[]
capFor(address, bytes32 stateCode, bytes32 productId, uint256 principal, (uint256,uint256,uint256,uint256[]) from)uint256 cap
capMonthlyBps(bytes32 stateCode, bytes32 productId, uint256 principal)uint256
capSince(bytes32 stateCode, bytes32 productId, uint256 principal, (uint256,uint256,uint256,uint256[]) from)uint256
cflSourcesOf()address[]
chargesFor(address member, bytes32 stateCode, bytes32 productId, uint256 principal, (uint256,uint256,uint256,uint256[]) from)uint256 listCarry, uint256 capCarry
chargesSince(bytes32 stateCode, bytes32 productId, uint256 principal, (uint256,uint256,uint256,uint256[]) from)uint256 listCarry, uint256 capCarry, (uint256,uint256,uint256,uint256[]) now_
combinedTrim(bytes32 stateCode, bytes32 productId, uint256 revolvingPrincipal, uint256 revolvingMonthly, uint256[] planPrincipals, uint256[] planMonthly)uint256[] allowed
effectiveMonthlyBps(bytes32 stateCode, bytes32 productId, uint256 principal)uint256
graduatedBetween(bytes32 stateCode, bytes32 productId, uint256 principal, (uint256,uint256,uint256,uint256[]) from, uint256 at)uint256 total
graduatedMonthly(bytes32 stateCode, bytes32 productId, uint256 principal)uint256 total
graduatedSince(bytes32 stateCode, bytes32 productId, uint256 principal, (uint256,uint256,uint256,uint256[]) from)uint256
hasProduct(bytes32 stateCode, bytes32 productId)bool
isEnabled(bytes32 stateCode, bytes32 productId)bool
keyOf(bytes32 stateCode, bytes32 productId)bytes32
owner()address
paramsOf(bytes32 stateCode, bytes32 productId)(bool,uint32,uint32,uint128,uint32,uint64,bool,uint128,uint32)
proxiableUUID()bytes32
RATE_SCALE()uint256
revolvingRatesOf(bytes32 stateCode, bytes32 ceilingProduct, bytes32[] productIds, uint256[] principals, uint256[] ownRates)uint256[] rates
snapshot(bytes32 stateCode, bytes32 productId)(uint256,uint256,uint256,uint256[])
snapshotAt(bytes32 stateCode, bytes32 productId, uint256 at)(uint256,uint256,uint256,uint256[]) snap
termChargeFor(address member, bytes32 stateCode, bytes32 productId, uint256 principal, (uint256,uint256,uint256,uint256[]) from)uint256 charge
termRateOf(address member, bytes32 stateCode, bytes32 productId, uint256 principal, uint256 subsidyBps)uint256 rate
Events
Event
AdminChanged(address previousAdmin, address newAdmin)BandsSet(bytes32 stateCode indexed, bytes32 productId indexed, (uint128,uint32)[] bands)BeaconUpgraded(address beacon indexed)CflSourcesSet(address[] sources)Initialized(uint8 version)OwnershipTransferred(address previousOwner indexed, address newOwner indexed)ProductSet(bytes32 stateCode indexed, bytes32 productId indexed, (bool,uint32,uint32,uint128,uint32,uint64,bool,uint128,uint32) params)Upgraded(address implementation indexed)Errors
Error
RateScheduleBadBands()RateScheduleBandsFixed()RateScheduleUnknownProduct(bytes32 stateCode, bytes32 productId)