Skip to content
ClearClear
Docs
Protocol/ClearUSDUpgradeable

ClearUSDUpgradeable

Source: contracts/peripherals/ClearUSDUpgradeable.sol · Guide: savings · Upgradeable (UUPS proxy)

2 min readUpdated View source

On this page
Network
Chain id
Address
Base Sepolia
84532

Functions that change state

Function
Who can call
Also
acceptDefaultAdminTransfer()
The pending default admin
approve(address spender, uint256 value)
The token holder
beginDefaultAdminTransfer(address newAdmin)
The default admin
burn(address account, uint256 amount)
onlyRole(BURNER_ROLE) (through burnFrom)
burn(uint256 amount)
onlyRole(BURNER_ROLE)
burnFrom(address account, uint256 amount)
onlyRole(BURNER_ROLE)
cancelDefaultAdminTransfer()
The default admin
changeDefaultAdminDelay(uint48 newDelay)
The default admin
grantMintAndBurnRoles(address burnAndMinter)
DEFAULT_ADMIN_ROLE (it calls grantRole)
grantRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
initialize(string name, string symbol, uint8 decimals_, uint256 maxSupply_, uint256 preMint, address defaultAdmin, address defaultUpgrader)
Once, when the proxy is initialised
mint(address account, uint256 amount)
onlyRole(MINTER_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)
rollbackDefaultAdminDelay()
The default admin
seize(address holder, address to, uint256 amount)
onlyRole(LIQUIDATOR_ROLE)
setCCIPAdmin(address newAdmin)
onlyRole(DEFAULT_ADMIN_ROLE)
setEncumbranceSource(address source)
onlyRole(DEFAULT_ADMIN_ROLE)
transfer(address to, uint256 value)
The token holder
transferFrom(address from, address to, uint256 value)
The holder, or an approved spender
upgradeToAndCall(address newImplementation, bytes data)
onlyRole(UPGRADER_ROLE) (via _authorizeUpgrade)
payable

Read functions

Anyone can call these; they change nothing.

Function
Returns
allowance(address owner, address spender)
uint256
balanceOf(address account)
uint256
BURNER_ROLE()
bytes32
decimals()
uint8
DEFAULT_ADMIN_ROLE()
bytes32
defaultAdmin()
address
defaultAdminDelay()
uint48
defaultAdminDelayIncreaseWait()
uint48
encumbranceSource()
address
freeBalanceOf(address holder)
uint256
getCCIPAdmin()
address
getRoleAdmin(bytes32 role)
bytes32
hasRole(bytes32 role, address account)
bool
LIQUIDATOR_ROLE()
bytes32
maxSupply()
uint256
MINTER_ROLE()
bytes32
name()
string
owner()
address
pendingDefaultAdmin()
address newAdmin, uint48 schedule
pendingDefaultAdminDelay()
uint48 newDelay, uint48 schedule
proxiableUUID()
bytes32
supportsInterface(bytes4 interfaceId)
bool
symbol()
string
totalSupply()
uint256
UPGRADE_INTERFACE_VERSION()
string
UPGRADER_ROLE()
bytes32

Events

Event
Approval(address owner indexed, address spender indexed, uint256 value)
CCIPAdminTransferred(address previousAdmin indexed, address newAdmin indexed)
DefaultAdminDelayChangeCanceled()
DefaultAdminDelayChangeScheduled(uint48 newDelay, uint48 effectSchedule)
DefaultAdminTransferCanceled()
DefaultAdminTransferScheduled(address newAdmin indexed, uint48 acceptSchedule)
EncumbranceSourceUpdated(address source indexed)
Initialized(uint64 version)
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)
Transfer(address from indexed, address to indexed, uint256 value)
Upgraded(address implementation indexed)

Errors

Error
AccessControlBadConfirmation()
AccessControlEnforcedDefaultAdminDelay(uint48 schedule)
AccessControlEnforcedDefaultAdminRules()
AccessControlInvalidDefaultAdmin(address defaultAdmin)
AccessControlUnauthorizedAccount(address account, bytes32 neededRole)
AddressEmptyCode(address target)
BurnMintERC20UUPS__InvalidRecipient(address recipient)
BurnMintERC20UUPS__MaxSupplyExceeded(uint256 supplyAfterMint)
ClearUSDEncumbered(address holder, uint256 free, uint256 amount)
ClearUSDSeizureExceedsEncumbrance(address holder, uint256 encumbered, uint256 amount)
ERC1967InvalidImplementation(address implementation)
ERC1967NonPayable()
ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed)
ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed)
ERC20InvalidApprover(address approver)
ERC20InvalidReceiver(address receiver)
ERC20InvalidSender(address sender)
ERC20InvalidSpender(address spender)
FailedInnerCall()
InvalidInitialization()
NotInitializing()
SafeCastOverflowedUintDowncast(uint8 bits, uint256 value)
UUPSUnauthorizedCallContext()
UUPSUnsupportedProxiableUUID(bytes32 slot)