TokenRegistry
Source: contracts/peripherals/TokenRegistry.sol · Guide: token-registry
Functions that change state
Function
Who can call
Also
batchSetFallbackPrices(address[] tokens, uint256[] prices)onlyOwnerregisterToken(address token, uint256 chainId, address chainTokenAddress, uint256 fallbackPrice)onlyOwnerremoveToken(address token)onlyOwnerrenounceOwnership()The owner
setChainAddress(address token, uint256 chainId, address chainTokenAddress)onlyOwnersetFallbackPrice(address token, uint256 price)onlyOwnersetStablecoin(address token, bool isStablecoin)onlyOwnersetTokenMetadata(address token, string symbol, string name, uint8 decimals)onlyOwnertransferOwnership(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.