TokenManagerAdmin

View Source: @nomisma/elektro-protocol-aux/contracts/tokens/manager/TokenManagerAdmin.sol

↗ Extends: Delegator, TokenManagerBase, ITokenManagerAdmin ↘ Derived Contracts: TokenManagerAdminProxy

TokenManagerAdmin

Contract is responsible for managing interactions with tokens. It provides helper functions that allows to get decimals, balances and allowances of tokens. {collectFunds} function is used to safely transfer tokens to msg.sender by using {TokenWrapper} contract which implements {safeTransferFrom} function to transfer non compatible {ERC20} tokens

Contract Members

Constants & Variables

bytes32 private constant GOVERNOR_ROLE_NAME;

bytes32 public constant ADMIN_ROLE_NAME;

Functions

  • setElektroRegistry(address _registry)

  • setEthereumAddress(address _ethereumAddress)

  • setWETH9Address(address _weth9Address)

  • setTokenWrapper(address _wrapper)

  • collectFundsToFundLock(address from, address tokenAddress, uint256 amount)

  • getEthereumAddress()

  • getWETH9Address()

  • getTokenWrapper()

  • getTokenDecimals(address token)

  • getTokenSymbol(address token)

  • getTokenProperties(address[] tokens, address spender)

  • collectFundsCommon(address from, address tokenAddress, uint256 amount)

setElektroRegistry

Setting Elektro registry in {TokenManager}

function setElektroRegistry(address _registry) external nonpayable onlyRole 

Arguments

NameTypeDescription

_registry

address

address of {ElektroRegistry} contract

setEthereumAddress

Setting ethereum asset address in {TokenManager}

function setEthereumAddress(address _ethereumAddress) external nonpayable onlyRole 

Arguments

NameTypeDescription

_ethereumAddress

address

address of ethereum asset

setWETH9Address

Setting {WETH9} asset address in {TokenManager}

function setWETH9Address(address _weth9Address) external nonpayable onlyRole 

Arguments

NameTypeDescription

_weth9Address

address

address of {WETH9} contract

setTokenWrapper

Setting {TokenWrapper} address in {TokenManager}

function setTokenWrapper(address _wrapper) external nonpayable onlyRole 

Arguments

NameTypeDescription

_wrapper

address

address of {TokenWrapper} contract

collectFundsToFundLock

Function that allows to safely transfer tokens to {FundLock} from an external source. This function is always called by {FundLock}, so msg.sender is address of {FundLock} contract Can be used only by verified Elektro contracts.

function collectFundsToFundLock(address from, address tokenAddress, uint256 amount) external nonpayable onlyAllowedContracts 

Arguments

NameTypeDescription

from

address

address of account to transfer tokens from

tokenAddress

address

address of the token to transfer

amount

uint256

of tokens to be transferred

getEthereumAddress

Getting address of Ether set in {TokenManager}

function getEthereumAddress() external view
returns(address)

Arguments

getWETH9Address

Getting address of WETH9 set in {TokenManager}

function getWETH9Address() external view
returns(address)

Arguments

getTokenWrapper

Getting address of {TokenWrapper} contract set in {TokenManager}

function getTokenWrapper() external view
returns(address)

Arguments

getTokenDecimals

Helper functions that gets decimals property for specified token

function getTokenDecimals(address token) external view
returns(uint256)

Arguments

NameTypeDescription

token

address

address of asset to get decimals

getTokenSymbol

Helper functions that gets symbol property for specified token

function getTokenSymbol(address token) external view
returns(string)

Arguments

NameTypeDescription

token

address

address of asset to get symbol for

getTokenProperties

Helper functions that gets multiple balances and allowances for specified tokens

function getTokenProperties(address[] tokens, address spender) external view
returns(uint256[], uint256[])

Arguments

NameTypeDescription

tokens

address[]

address of assets to get balances and allowances

spender

address

address of account used to get allowance

collectFundsCommon

See {collectFunds}.

function collectFundsCommon(address from, address tokenAddress, uint256 amount) internal nonpayable

Arguments

NameTypeDescription

from

address

tokenAddress

address

amount

uint256

Last updated