BondingCurve

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

Deployment

uint256 _initialPrice starting price for the bonding curve
uint256 _maxSupply the IBCO supply at which sEURO should reach full price
uint256 _bucketSize the size of each price bucket, used to make calculations more efficient

calculatePrice

Calculates exactly how much sEUROs should be minted for the given number of euros.
parameters: uint256 _euroAmount
returns: uint256 seuros
_euroAmount is the number of euros to convert into sEUROS
seuros is the number of sEUROs that should be minted for given euros
User must have CALCULATOR role in contract

readOnlyCalculatePrice

Estimates how many sEUROs roughly should be minted in exchange for the given amount of euros
parameters: uint256 _euroAmount
returns: uint256 seuros
_euroAmount is the number of euros to estimate the conversion into sEUROS
seuros is the estimated number of sEUROs to be minted for given euros

updateCurrentBucket

Updates the IBCO total supply, and by extension the current price bucket
parameters: uint256 _minted
_minted is the number of euros to estimate the conversion into sEUROS
User must have UPDATER role in contract

State Variables

Bucket currentBucket the price bucket that is currently being used to calculate sEURO price
uint256 ibcoTotalSupply the amount of tokens that have been supplied via the BondingCurve
uint256 maxSupply the amount of tokens that should be supplied by the BondingCurve before reaching final price
uint256 FINAL_PRICE the price which the IBCO should reach when at max supply
bytes32 UPDATER role to control which addresses can call updateCurrentBucket
bytes32 CALCULATOR role to control which addresses can call calculatePrice

Structs

Bucket
  • uint32 index index of the price bucket
  • uint256 price price determined by the bucket