Skip to content
ClearClear
Docs
Protocol/LimitCalculator

LimitCalculator

Source: contracts/peripherals/LimitCalculator.sol · Guide: credit · Upgradeable (UUPS proxy)

1 min readUpdated View source

On this page
Network
Chain id
Address
Base Sepolia
84532

Functions that change state

Function
Who can call
Also
attest(address member, bytes32 kind, uint256 value, uint64 effectiveFrom)
onlyRole(ATTESTOR_ROLE)
grantRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
initialize(address admin, address _collateralRegistry, address _issuer)
Once, when the proxy is initialised
pushCapacities(address member)
Anyone
renounceRole(bytes32 role, address account)
Only the account renouncing its own role
revokeRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
setCollateralYield(bytes32 kind, uint256 yieldPerCycleBps)
onlyRole(OPERATOR_ROLE)
setIssuer(address _issuer)
onlyRole(OPERATOR_ROLE)
upgradeTo(address newImplementation)
onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)
upgradeToAndCall(address newImplementation, bytes data)
onlyRole(DEFAULT_ADMIN_ROLE) (via _authorizeUpgrade)
payable

Read functions

Anyone can call these; they change nothing.

Function
Returns
ATTESTOR_ROLE()
bytes32
capacityOf(address member, bytes32 kind)
uint256
collateralRegistry()
address
collateralYieldOf(bytes32)
uint256
DEFAULT_ADMIN_ROLE()
bytes32
effectiveAttestationOf(address member, bytes32 kind)
uint256
getRoleAdmin(bytes32 role)
bytes32
hasRole(bytes32 role, address account)
bool
issuer()
address
OPERATOR_ROLE()
bytes32
pendingAttestationOf(address member, bytes32 kind)
uint256 value, uint64 effectiveFrom
proxiableUUID()
bytes32
supportsInterface(bytes4 interfaceId)
bool
tiersOf(address member)
(bytes32,uint256,uint256,uint256)[] tiers
totalCapacityOf(address member)
uint256 total

Events

Event
AdminChanged(address previousAdmin, address newAdmin)
Attested(address member indexed, bytes32 kind indexed, uint256 value, uint64 effectiveFrom)
BeaconUpgraded(address beacon indexed)
CapacitiesPushed(address member indexed, uint256 total)
CollateralYieldUpdated(bytes32 kind indexed, uint256 yieldPerCycleBps)
Initialized(uint8 version)
IssuerUpdated(address issuer indexed)
RoleAdminChanged(bytes32 role indexed, bytes32 previousAdminRole indexed, bytes32 newAdminRole indexed)
RoleGranted(bytes32 role indexed, address account indexed, address sender indexed)
RoleRevoked(bytes32 role indexed, address account indexed, address sender indexed)
Upgraded(address implementation indexed)

Errors

Error
LimitCalculatorInvalidAddress()
LimitCalculatorYieldExceedsCarry(bytes32 kind, uint256 yieldBps, uint256 rateBps)