TwoKeyCampaignLogicHandler
contract TwoKeyCampaignLogicHandler
Index
- checkIsCampaignActiveInTermsOfTime
- ethereumOf
- getAddressFromRegistry
- getAddressJoinedStatus
- getAddressStatistic
- getIncentiveModel
- getRateFromExchange
- getReferrerBalanceAndTotalEarningsAndNumberOfConversions
- getReferrerPlasmaTotalEarnings
- getReferrers
- getReferrersBalancesAndTotalEarnings
- getSuperStatistics
- onlyContractor
- plasmaOf
- recover
- updateMaxContributionETHorUSD
- updateMinContributionETHOrUSD
- updateRefchainRewards
- updateReferrerMappings
- updateTotalRaisedFunds
Reference
Modifiers
onlyContractor
modifier onlyContractor()
Functions
checkIsCampaignActiveInTermsOfTime
function checkIsCampaignActiveInTermsOfTime() internal view returns (bool)Requirement for the checking if the campaign is active or not.
- Returns:
- bool
ethereumOf
function ethereumOf(address me) public view returns (address)Function to determine ethereum address of plasma address.
- Parameters:
me- is the plasma address of the user- Returns:
- ethereum address
getAddressFromRegistry
function getAddressFromRegistry(string contractName) internal view returns (address)- Parameters:
contractName- string- Returns:
- address
getAddressJoinedStatus
function getAddressJoinedStatus(address _address) public view returns (bool)Function to check if the msg.sender has already joined.
- Parameters:
_address- address- Returns:
- true/false depending of joined status
getAddressStatistic
abstract function getAddressStatistic(address _address, bool plasma, bool flag, address referrer) internal view returns (bytes)- Parameters:
_address- addressplasma- boolflag- boolreferrer- address- Returns:
- bytes
getIncentiveModel
function getIncentiveModel() public view returns (IncentiveModel)Function to get rewards model present in contract for referrers.
- Returns:
- position of the model inside enum IncentiveModel
getRateFromExchange
function getRateFromExchange() internal view returns (uint)- Returns:
- uint
getReferrerBalanceAndTotalEarningsAndNumberOfConversions
function getReferrerBalanceAndTotalEarningsAndNumberOfConversions(address _referrerAddress, bytes _sig, uint[] _conversionIds) public view returns (uint, uint, uint, uint[], address)Only referrer by himself, moderator, or contractor can call this, Function to fetch for the referrer his balance, his total earnings, and how many conversions he participated in.
- Parameters:
_referrerAddress- is the address of referrer we're checking for_sig- is the signature if calling functions from FE without ETH address_conversionIds- ar e the ids of conversions this referrer participated in- Returns:
- tuple containing this 3 information
getReferrerPlasmaTotalEarnings
function getReferrerPlasmaTotalEarnings(address _referrer) public view returns (uint)Gets total earnings for referrer plasma address.
- Parameters:
_referrer- is the address of influencer- Returns:
- uint
getReferrers
function getReferrers(address customer) public view returns (address[])Function to return referrers participated in the referral chain.
- Parameters:
customer- is the one who converted (bought tokens)- Returns:
- array of referrer addresses
getReferrersBalancesAndTotalEarnings
function getReferrersBalancesAndTotalEarnings(address[] _referrerPlasmaList) public view returns (uint256[], uint256[])Function to get balance and total earnings for all referrer addresses passed in arg.
- Parameters:
_referrerPlasmaList- is the array of plasma addresses of referrer- Returns:
- two arrays. 1st contains current plasma balance and 2nd contains total plasma balances
getSuperStatistics
function getSuperStatistics(address _user, bool plasma, bytes signature) public view returns (bytes)Function to get super statistics.
- Parameters:
_user- is the user address we want stats forplasma- is if that address is plasma or notsignature- in case we're calling this from referrer who doesn't have yet opened wallet- Returns:
- bytes
plasmaOf
function plasmaOf(address me) public view returns (address)Function to determine plasma address of ethereum address.
- Parameters:
me- is the address (ethereum) of the user- Returns:
- an address
recover
function recover(bytes signature) internal view returns (address)Internal helper function.
- Parameters:
signature- bytes- Returns:
- address
updateMaxContributionETHorUSD
function updateMaxContributionETHorUSD(uint value) publicOnly Contractor can call this method, otherwise it will revert - emits Event when updated, Function to update maxContributionETH.
- Modifiers:
- onlyContractor
- Parameters:
value- is the new maxContribution value
updateMinContributionETHOrUSD
function updateMinContributionETHOrUSD(uint value) publicOnly Contractor can call this method, otherwise it will revert - emits Event when updated, Function to update MinContributionETH.
- Modifiers:
- onlyContractor
- Parameters:
value- is the new value we are going to set for minContributionETH
updateRefchainRewards
function updateRefchainRewards(uint256 _maxReferralRewardETHWei, address _converter, uint _conversionId, uint totalBounty2keys) publicThis function can only be called by TwoKeyConversionHandler contract, Update refferal chain with rewards (update state variables).
- Parameters:
_maxReferralRewardETHWei- is the max referral reward set_converter- is the address of the converter_conversionId- uinttotalBounty2keys- uint
updateReferrerMappings
function updateReferrerMappings(address referrerPlasma, uint reward, uint conversionId) internal- Parameters:
referrerPlasma- addressreward- uintconversionId- uint
updateTotalRaisedFunds
function updateTotalRaisedFunds(uint newAmount) internalFunction which will update total raised funds which will be always compared with hard cap.
- Parameters:
newAmount- is the value including the new conversion amount