Skip to content
ClearClear
Docs
Protocol/TokenRegistry

TokenRegistry

Source: contracts/peripherals/TokenRegistry.sol · Guide: token-registry

1 min readUpdated View source

On this page
Network
Chain id
Address
Base Sepolia
84532

Functions that change state

Function
Who can call
Also
batchSetFallbackPrices(address[] tokens, uint256[] prices)
onlyOwner
registerToken(address token, uint256 chainId, address chainTokenAddress, uint256 fallbackPrice)
onlyOwner
removeToken(address token)
onlyOwner
renounceOwnership()
The owner
setChainAddress(address token, uint256 chainId, address chainTokenAddress)
onlyOwner
setFallbackPrice(address token, uint256 price)
onlyOwner
setStablecoin(address token, bool isStablecoin)
onlyOwner
setTokenMetadata(address token, string symbol, string name, uint8 decimals)
onlyOwner
transferOwnership(address newOwner)
The owner

Read functions

Anyone can call these; they change nothing.

Function
Returns
getChainAddress(address token, uint256 chainId)
address
getFallbackPrice(address token)
uint256
getIsStablecoin(address token)
bool
getIsWhitelisted(address token)
bool
getPriceSource(address token)
string
getTokenInfo(address token)
(bool,bool,uint8,string,string)
getWhitelistedTokens()
address[]
hasPricingData(address token)
bool
owner()
address

Events

Event
FallbackPriceUpdated(address token indexed, uint256 newPrice)
OwnershipTransferred(address previousOwner indexed, address newOwner indexed)
TokenChainAddressSet(address token indexed, uint256 chainId indexed, address chainTokenAddress)
TokenMetadataUpdated(address token indexed, string symbol, string name, uint8 decimals)
TokenStablecoinFlagUpdated(address token indexed, bool isStablecoin)
TokenWhitelisted(address token indexed, bool whitelisted)

Errors

No custom errors; failures revert with a reason string.