Skip to content
ClearClear
Docs
Protocol/Liquidator

Liquidator

Source: contracts/peripherals/Liquidator.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
grantRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
initialize(address admin, address _stableCredit, address _clrusd, address _vault, address _reserveToken, address _collateralRegistry)
Once, when the proxy is initialised
liquidate(address member, address issuer, uint256 tierId, bytes32 kind)
onlyRole(OPERATOR_ROLE)
liquidateShares(address member, address issuer, uint256 tierId, bytes32 kind, address pool)
onlyRole(OPERATOR_ROLE)
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)
settleFromSavings(address issuer, uint256 tierId, uint256 amount)
Anyone; acts on the caller's own account
settleRealized(address member, address issuer, uint256 tierId, uint256 amount)
onlyRole(OPERATOR_ROLE)
setTrustedSavingsIssuer(address issuer, bool trusted)
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
clrusd()
address
collateralRegistry()
address
DEFAULT_ADMIN_ROLE()
bytes32
getRoleAdmin(bytes32 role)
bytes32
hasRole(bytes32 role, address account)
bool
OPERATOR_ROLE()
bytes32
proxiableUUID()
bytes32
reserveToken()
address
stableCredit()
address
supportsInterface(bytes4 interfaceId)
bool
trustedSavingsIssuer(address)
bool
vault()
address

Events

Event
AdminChanged(address previousAdmin, address newAdmin)
BeaconUpgraded(address beacon indexed)
Initialized(uint8 version)
Liquidated(address member indexed, address issuer indexed, uint256 seized, uint256 redeemed, uint256 repaid)
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)
SettledFromSavings(address member indexed, address issuer indexed, uint256 seized, uint256 repaid)
SharesSeized(address member indexed, address pool indexed, uint256 shares, uint256 realized, bool queued)
TrustedSavingsIssuerUpdated(address issuer indexed, bool trusted)
Upgraded(address implementation indexed)

Errors

Error
LiquidatorInvalidAddress()
LiquidatorNothingToSeize(address member)
LiquidatorNotInDefault(address member, address issuer)
LiquidatorNotRealizable(address collateral, uint256 seized)
LiquidatorNotSavingsTier(uint256 tierId, bytes32 kind)
LiquidatorUntrustedIssuer(address issuer)