View Source: contracts/modules/STO/USDTiered/USDTieredSTO.sol
↗ Extends: USDTieredSTOStorage , STO
USDTieredSTO
Contract Members
Constants & Variables
Copy string internal constant POLY_ORACLE ;
string internal constant ETH_ORACLE ;
Events
Copy event SetAllowBeneficialInvestments (bool _allowed);
event SetNonAccreditedLimit (address _investor , uint256 _limit);
event TokenPurchase(address indexed _purchaser, address indexed _beneficiary, uint256 _tokens, uint256 _usdAmount, uint256 _tierPrice, uint256 _tier);
event FundsReceived(address indexed _purchaser, address indexed _beneficiary, uint256 _usdAmount, enum ISTO.FundRaiseType _fundRaiseType, uint256 _receivedValue, uint256 _spentValue, uint256 _rate);
event ReserveTokenMint (address indexed _owner , address indexed _wallet , uint256 _tokens , uint256 _latestTier);
event SetAddresses (address indexed _wallet , IERC20 [] _usdTokens);
event SetLimits (uint256 _nonAccreditedLimitUSD , uint256 _minimumInvestmentUSD);
event SetTimes (uint256 _startTime , uint256 _endTime);
event SetTiers(uint256[] _ratePerTier, uint256[] _ratePerTierDiscountPoly, uint256[] _tokensPerTierTotal, uint256[] _tokensPerTierDiscountPoly);
event SetTreasuryWallet (address _oldWallet , address _newWallet);
Modifiers
validETH
Copy modifier validETH () internal
Arguments
validPOLY
Copy modifier validPOLY () internal
Arguments
validSC
Copy modifier validSC (address _usdToken) internal
Arguments
Functions
configure(uint256 _startTime, uint256 _endTime, uint256[] _ratePerTier, uint256[] _ratePerTierDiscountPoly, uint256[] _tokensPerTierTotal, uint256[] _tokensPerTierDiscountPoly, uint256 _nonAccreditedLimitUSD, uint256 _minimumInvestmentUSD, enum ISTO.FundRaiseType[] _fundRaiseTypes, address payable _wallet, address _treasuryWallet, IERC20[] _usdTokens)
Copy function (address _securityToken , address _polyAddress) public nonpayable Module
Arguments
configure
Function used to intialize the contract variables
Copy function configure(uint256 _startTime, uint256 _endTime, uint256[] _ratePerTier, uint256[] _ratePerTierDiscountPoly, uint256[] _tokensPerTierTotal, uint256[] _tokensPerTierDiscountPoly, uint256 _nonAccreditedLimitUSD, uint256 _minimumInvestmentUSD, enum ISTO.FundRaiseType[] _fundRaiseTypes, address payable _wallet, address _treasuryWallet, IERC20[] _usdTokens) public nonpayable onlyFactory
Arguments
modifyFunding
Modifies fund raise types
Copy function modifyFunding (enum ISTO.FundRaiseType[] _fundRaiseTypes) external nonpayable withPerm
Arguments
modifyLimits
modifies max non accredited invets limit and overall minimum investment limit
Copy function modifyLimits (uint256 _nonAccreditedLimitUSD , uint256 _minimumInvestmentUSD) external nonpayable withPerm
Arguments
modifyTiers
modifiers STO tiers. All tiers must be passed, can not edit specific tiers.
Copy function modifyTiers(uint256[] _ratePerTier, uint256[] _ratePerTierDiscountPoly, uint256[] _tokensPerTierTotal, uint256[] _tokensPerTierDiscountPoly) external nonpayable withPerm
Arguments
modifyTimes
Modifies STO start and end times
Copy function modifyTimes (uint256 _startTime , uint256 _endTime) external nonpayable withPerm
Arguments
_isSTOStarted
Copy function _isSTOStarted () internal view
Arguments
modifyAddresses
Modifies addresses used as wallet, reserve wallet and usd token
Copy function modifyAddresses (address payable _wallet , address _treasuryWallet , IERC20[] _usdTokens) external nonpayable
Arguments
modifyOracle
Modifies Oracle address. By default, Polymath oracles are used but issuer can overide them using this function Set _oracleAddress to 0x0 to fallback to using Polymath oracles
Copy function modifyOracle (enum ISTO.FundRaiseType _fundRaiseType , address _oracleAddress) external nonpayable
Arguments
_modifyLimits
Copy function _modifyLimits (uint256 _nonAccreditedLimitUSD , uint256 _minimumInvestmentUSD) internal nonpayable
Arguments
_modifyTiers
Copy function _modifyTiers(uint256[] _ratePerTier, uint256[] _ratePerTierDiscountPoly, uint256[] _tokensPerTierTotal, uint256[] _tokensPerTierDiscountPoly) internal nonpayable
Arguments
_modifyTimes
Copy function _modifyTimes (uint256 _startTime , uint256 _endTime) internal nonpayable
Arguments
_modifyAddresses
Copy function _modifyAddresses (address payable _wallet , address _treasuryWallet , IERC20[] _usdTokens) internal nonpayable
Arguments
_modifyUSDTokens
Copy function _modifyUSDTokens (IERC20[] _usdTokens) internal nonpayable
Arguments
finalize
Finalizes the STO and mint remaining tokens to treasury address
Copy function finalize () external nonpayable withPerm
Arguments
changeNonAccreditedLimit
Modifies the list of overrides for non-accredited limits in USD
Copy function changeNonAccreditedLimit (address[] _investors , uint256[] _nonAccreditedLimit) external nonpayable withPerm
Arguments
getAccreditedData
Returns investor accredited & non-accredited override informatiomn
Copy function getAccreditedData () external view
returns (investors address[] , accredited bool[] , overrides uint256[])
Returns
investors list of all configured investors
Arguments
changeAllowBeneficialInvestments
Function to set allowBeneficialInvestments (allow beneficiary to be different to funder)
Copy function changeAllowBeneficialInvestments (bool _allowBeneficialInvestments) external nonpayable withPerm
Arguments
fallback function - assumes ETH being invested
Copy function () external payable
Arguments
buyWithETH
Copy function buyWithETH (address _beneficiary) external payable
returns (uint256 , uint256 , uint256)
Arguments
buyWithPOLY
Copy function buyWithPOLY (address _beneficiary , uint256 _investedPOLY) external nonpayable
returns (uint256 , uint256 , uint256)
Arguments
buyWithUSD
Copy function buyWithUSD (address _beneficiary , uint256 _investedSC , IERC20 _usdToken) external nonpayable
returns (uint256 , uint256 , uint256)
Arguments
buyWithETHRateLimited
Purchase tokens using ETH
Copy function buyWithETHRateLimited (address _beneficiary , uint256 _minTokens) public payable validETH
returns (uint256 , uint256 , uint256)
Arguments
buyWithPOLYRateLimited
Purchase tokens using POLY
Copy function buyWithPOLYRateLimited(address _beneficiary, uint256 _investedPOLY, uint256 _minTokens) public nonpayable validPOLY
returns (uint256 , uint256 , uint256)
Arguments
buyWithUSDRateLimited
Purchase tokens using Stable coins
Copy function buyWithUSDRateLimited(address _beneficiary, uint256 _investedSC, uint256 _minTokens, IERC20 _usdToken) public nonpayable validSC
returns (uint256 , uint256 , uint256)
Arguments
_buyWithTokens
Copy function _buyWithTokens(address _beneficiary, uint256 _tokenAmount, enum ISTO.FundRaiseType _fundRaiseType, uint256 _minTokens, IERC20 _token) internal nonpayable
returns (uint256 , uint256 , uint256)
Arguments
_getSpentvalues
Copy function _getSpentvalues(address _beneficiary, uint256 _amount, enum ISTO.FundRaiseType _fundRaiseType, uint256 _minTokens) internal nonpayable
returns (rate uint256 , spentUSD uint256 , spentValue uint256 , initialMinted uint256)
Arguments
_buyTokens
Low level token purchase
Copy function _buyTokens(address _beneficiary, uint256 _investmentValue, uint256 _rate, enum ISTO.FundRaiseType _fundRaiseType) internal nonpayable whenNotPaused
returns (spentUSD uint256 , spentValue uint256)
Arguments
_buyTokensChecks
Copy function _buyTokensChecks (address _beneficiary , uint256 _investmentValue , uint256 investedUSD) internal view
returns (netInvestedUSD uint256)
Arguments
_calculateTier
Copy function _calculateTier(address _beneficiary, uint256 _tier, uint256 _investedUSD, enum ISTO.FundRaiseType _fundRaiseType) internal nonpayable
returns (spentUSD uint256 , gotoNextTier bool)
Arguments
_purchaseTier
Copy function _purchaseTier(address _beneficiary, uint256 _tierPrice, uint256 _tierRemaining, uint256 _investedUSD, uint256 _tier) internal nonpayable
returns (spentUSD uint256 , purchasedTokens uint256 , gotoNextTier bool)
Arguments
_isAccredited
Copy function _isAccredited (address _investor) internal view
returns (bool)
Arguments
_getIsAccredited
Copy function _getIsAccredited (address _investor , IDataStore dataStore) internal view
returns (bool)
Arguments
isOpen
This function returns whether or not the STO is in fundraising mode (open)
Copy function isOpen () public view
returns (bool)
Returns
bool Whether the STO is accepting investments
Arguments
capReached
Checks whether the cap has been reached.
Copy function capReached () public view
returns (bool)
Returns
bool Whether the cap was reached
Arguments
getRate
returns current conversion rate of funds
Copy function getRate (enum ISTO.FundRaiseType _fundRaiseType) public nonpayable
returns (uint256)
Arguments
convertToUSD
This function converts from ETH or POLY to USD
Copy function convertToUSD (enum ISTO.FundRaiseType _fundRaiseType , uint256 _amount) public nonpayable
returns (uint256)
Returns
uint256 Value in USD
Arguments
convertFromUSD
This function converts from USD to ETH or POLY
Copy function convertFromUSD (enum ISTO.FundRaiseType _fundRaiseType , uint256 _amount) public nonpayable
returns (uint256)
Returns
uint256 Value in ETH or POLY
Arguments
getTokensSold
⤾ overrides STO.getTokensSold
Return the total no. of tokens sold
Copy function getTokensSold () public view
returns (uint256)
Returns
uint256 Total number of tokens sold
Arguments
getTokensMinted
Return the total no. of tokens minted
Copy function getTokensMinted () public view
returns (tokensMinted uint256)
Returns
uint256 Total number of tokens minted
Arguments
getTokensSoldFor
Return the total no. of tokens sold for the given fund raise type param _fundRaiseType The fund raising currency (e.g. ETH, POLY, SC) to calculate sold tokens for
Copy function getTokensSoldFor (enum ISTO.FundRaiseType _fundRaiseType) external view
returns (tokensSold uint256)
Returns
uint256 Total number of tokens sold for ETH
Arguments
getTokensMintedByTier
Return array of minted tokens in each fund raise type for given tier param _tier The tier to return minted tokens for
Copy function getTokensMintedByTier (uint256 _tier) external view
returns (uint256[])
Returns
uint256[] array of minted tokens in each fund raise type
Arguments
getTokensSoldByTier
Return the total no. of tokens sold in a given tier param _tier The tier to calculate sold tokens for
Copy function getTokensSoldByTier (uint256 _tier) external view
returns (uint256)
Returns
uint256 Total number of tokens sold in the tier
Arguments
getNumberOfTiers
Return the total no. of tiers
Copy function getNumberOfTiers () external view
returns (uint256)
Returns
uint256 Total number of tiers
Arguments
getUsdTokens
Return the usd tokens accepted by the STO
Copy function getUsdTokens() external view
returns(contract IERC20[])
Returns
address[] usd tokens
Arguments
getPermissions
⤾ overrides IModule.getPermissions
Return the permissions flag that are associated with STO
Copy function getPermissions() public view
returns(allPermissions bytes32[])
Arguments
getSTODetails
Return the STO details
Copy function getSTODetails() external view
returns(uint256, uint256, uint256, uint256[], uint256[], uint256, uint256, uint256, bool[])
Returns
Unixtimestamp at which offering gets start.
Arguments
getInitFunction
⤾ overrides IModule.getInitFunction
This function returns the signature of configure function
Copy function getInitFunction() public pure
returns(bytes4)
Returns
bytes4 Configure function signature
Arguments
_getOracle
Copy function _getOracle(bytes32 _currency, bytes32 _denominatedCurrency) internal view
returns(oracleAddress address)
Arguments