SEuroCalculator

All public interfaces for the SEuroCalculator contract
SEuroCalculator contract extends Access Control contract.

Deployment

address _bondingCurve address of the BondingCurve dependency
address _eurUsdCl address of the Chainlink data feed for the EUR / USD exchange
uint8 _eurUsdDec decimal value for the given Chainlink data feed

calculate

Uses Chainlink and the BondingCurve contract to calculate how many sEUROs can be minted for the given amount of tokens/coins.
parameters: uint256 _amount, TokenData _token
returns: uint256 seuros
_amount is amount of given token/coin sent in by the user
_token is data about the token/coin that is used to calculate the rate
seuros is the amount of sEUROs the can be minted in exchange for given amount of token/coin
User must have OFFERING role in contract

readOnlyCalculate

Provides a read-only interface to estimate the same value as calculate
This function uses a less intensive BondingCurve function, which allows free price estimations.
parameters: uint256 _amount, TokenData _token
returns: uint256 seuros
_amount is amount of given token/coin sent in by the user
_token is data about the token/coin that is used to calculate the rate
seuros is the amount of sEUROs the can be minted in exchange for given amount of token/coin

setBondingCurve

Update the BondingCurve dependency address
parameters: address _newAddress
User must have admin role in contract

State Variables

address bondingCurve address of the BondingCurve dependency
address EUR_USD_CL address of the Chainlink data feed for the EUR / USD exchange
uint8 EUR_USD_DEC decimals value of the Chainlink data feed
bytes32 OFFERING AccessControl role, controlling which addresses have permission to call calculate