Skip to content
ClearClear
Docs
Protocol/ClearUSD

ClearUSD

Source: contracts/peripherals/ClearUSD.sol · Guide: savings

1 min readUpdated View source

On this page

Functions that change state

Function
Who can call
Also
approve(address spender, uint256 amount)
The token holder
burn(address account, uint256 amount)
onlyRole(BURNER_ROLE) (through burnFrom)
burn(uint256 amount)
onlyRole(BURNER_ROLE)
burnFrom(address account, uint256 amount)
onlyRole(BURNER_ROLE)
decreaseAllowance(address spender, uint256 subtractedValue)
The token holder
grantIssuerRoles(address issuer)
onlyRole(DEFAULT_ADMIN_ROLE)
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)
increaseAllowance(address spender, uint256 addedValue)
The token holder
mint(address account, uint256 amount)
onlyRole(MINTER_ROLE)
renounceRole(bytes32 role, address account)
Only the account renouncing its own role
revokeIssuerRoles(address issuer)
onlyRole(DEFAULT_ADMIN_ROLE)
revokeRole(bytes32 role, address account)
The role's admin role (DEFAULT_ADMIN_ROLE unless set otherwise)
setCCIPAdmin(address newAdmin)
onlyRole(DEFAULT_ADMIN_ROLE)
transfer(address to, uint256 amount)
The token holder
transferFrom(address from, address to, uint256 amount)
The holder, or an approved spender

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
getCCIPAdmin()
address
getRoleAdmin(bytes32 role)
bytes32
hasRole(bytes32 role, address account)
bool
maxSupply()
uint256
MINTER_ROLE()
bytes32
name()
string
supportsInterface(bytes4 interfaceId)
bool
symbol()
string
totalSupply()
uint256

Events

Event
Approval(address owner indexed, address spender indexed, uint256 value)
CCIPAdminTransferred(address previousAdmin indexed, address newAdmin 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)
Transfer(address from indexed, address to indexed, uint256 value)

Errors

Error
ClearUSDInvalidAdmin()
InvalidRecipient(address recipient)
MaxSupplyExceeded(uint256 supplyAfterMint)