TokenManager

All public interfaces for the TokenManager contract
TokenManager contract extends Ownable contract.

Deployment

address _wethAddress address of WETH token
address _ethUsdCL address of the Chainlink data feed for the ETH / USD exchange
uint8 _ethUsdCLDec decimals for the given Chainlink data feed

getAcceptedTokens

Provides list of all ERC20 tokens that can be swapped for sEURO, as symbols.
returns: string[]

get

Gets all TokenData for given symbol, if an accepted token.
parameters: string _symbol
returns: TokenData
_symbol is the symbol of the token that you would like to retrieve data for.

getTokenAddressFor

Gets token's decimals value for given symbol, if an accepted token.
parameters: string _symbol
returns: address
_symbol is the symbol of the token that you would like to retrieve data for.

getTokenDecimalFor

Gets token's decimals value for given symbol, if an accepted token.
parameters: string _symbol
returns: uint8
_symbol is the symbol of the token that you would like to retrieve data for.

getChainlinkAddressFor

Gets the address for the Chainlink data feed of the token / USD exchange.
parameters: string _symbol
returns: address
_symbol is the symbol of the token that you would like to retrieve data for.

getChainlinkDecimalFor

Gets the decimals value for the Chainlink data feed of the token / USD exchange.
parameters: string _symbol
returns: uint8
_symbol is the symbol of the token that you would like to retrieve data for.

addAcceptedToken

Adds a new ERC20 token as an accepted token to swap for sEURO.
parameters: address _addr, address _chainlinkAddr, uint8 _chainlinkDec
_addr is the address of the token's contract.
_chainlinkAddr is the address of the Chainlink data feed for the token / USD exchange.
_chainlinkDec is the decimals value of the Chainlink data feed.
User must be contract owner

removeAcceptedToken

Adds a new ERC20 token as an accepted token to swap for sEURO.
parameters: string _symbol
_symbol is the symbol of the token that you'd like to remove.
User must be contract owner

State Variables

string[] tokenSymbols list of all of the ERC20 token symbols that are currently accepted in a swap for sEURO
mapping(string => TokenData) tokenMetaData stores all the details for the ERC20 tokens, indexed by the token's symbol.

Structs

TokenData
  • address addr address of the token's contract
  • uint8 dec decimals used by
  • address chainlinkAddr address of the Chainlink data feed that provides token / USD rate
  • address chainlinkDec decimals used by the given Chainlink data feed