TwoKey documentation

TwoKey documentation

  • Docs

›2KEY / CAMPAIGN-MUTUAL-CONTRACTS

2KEY

  • Migrations
  • Ownable
  • TwoKeyConversionStates
  • TwoKeyConverterStates
  • TwoKeyTypes
  • UpgradabilityProxyAcquisition

2KEY / ACQUISITION-CAMPAIGN-CONTRACTS

  • TwoKeyAcquisitionCampaignERC20
  • TwoKeyAcquisitionLogicHandler
  • TwoKeyConversionHandler
  • TwoKeyPurchasesHandler

2KEY / CAMPAIGN-MUTUAL-CONTRACTS

  • ArcERC20
  • TwoKeyCampaign
  • TwoKeyCampaignConversionHandler
  • TwoKeyCampaignIncentiveModels
  • TwoKeyCampaignLogicHandler

2KEY / DONATION-CAMPAIGN-CONTRACTS

  • InvoiceTokenERC20
  • TwoKeyDonationCampaign
  • TwoKeyDonationCampaignType
  • TwoKeyDonationConversionHandler
  • TwoKeyDonationLogicHandler

2KEY / ERC20

  • ERC20

2KEY / INTERFACES

  • IBancorContract
  • IERC20
  • IGetImplementation
  • IHandleCampaignDeployment
  • IKyberNetworkProxy
  • IMaintainingPattern
  • IStructuredStorage
  • ITwoKeyAcquisitionCampaignERC20
  • ITwoKeyAcquisitionLogicHandler
  • ITwoKeyAdmin
  • ITwoKeyBaseReputationRegistry
  • ITwoKeyCampaign
  • ITwoKeyCampaignGetReferrers
  • ITwoKeyCampaignPublicAddresses
  • ITwoKeyCampaignValidator
  • ITwoKeyConversionHandler
  • ITwoKeyConversionHandlerGetConverterState
  • ITwoKeyDonationCampaign
  • ITwoKeyDonationCampaignFetchAddresses
  • ITwoKeyDonationConversionHandler
  • ITwoKeyDonationLogicHandler
  • ITwoKeyEventSource
  • ITwoKeyEventSourceEvents
  • ITwoKeyExchangeRateContract
  • ITwoKeyMaintainersRegistry
  • ITwoKeyPlasmaEvents
  • ITwoKeyPlasmaRegistry
  • ITwoKeyPurchasesHandler
  • ITwoKeyReg
  • ITwoKeyRegistry
  • ITwoKeyRegistryEvents
  • ITwoKeySingletoneAddressStorage
  • ITwoKeySingletoneRegistryFetchAddress
  • ITwoKeySingletonesRegistry
  • ITwoKeyWeightedVoteContract
  • IUpgradableExchange

2KEY / INTERFACES / STORAGE-CONTRACTS

  • ITwoKeyAdminStorage
  • ITwoKeyBaseReputationRegistryStorage
  • ITwoKeyCampaignValidatorStorage
  • ITwoKeyCommunityTokenPoolStorage
  • ITwoKeyDeepFreezeTokenPoolStorage
  • ITwoKeyEventSourceStorage
  • ITwoKeyExchangeRateContractStorage
  • ITwoKeyFactoryStorage
  • ITwoKeyLongTermTokenPoolStorage
  • ITwoKeyMaintainersRegistryStorage
  • ITwoKeyPlasmaEventsStorage
  • ITwoKeyPlasmaMaintainersRegistryStorage
  • ITwoKeyPlasmaRegistryStorage
  • ITwoKeyRegistryStorage
  • ITwoKeySignatureValidatorStorage
  • ITwoKeyUpgradableExchangeStorage

2KEY / LIBRARIES

  • Call
  • GetCode
  • IncentiveModels
  • SafeMath
  • Utils

2KEY / SINGLETON-CONTRACTS

  • ITwoKeySingletonUtils
  • StandardTokenModified
  • TwoKeyAdmin
  • TwoKeyBaseReputationRegistry
  • TwoKeyCampaignValidator
  • TwoKeyCongress
  • TwoKeyEconomy
  • TwoKeyEventSource
  • TwoKeyExchangeRateContract
  • TwoKeyFactory
  • TwoKeyMaintainersRegistry
  • TwoKeyPlasmaEvents
  • TwoKeyPlasmaMaintainersRegistry
  • TwoKeyPlasmaRegistry
  • TwoKeyPlasmaSingletoneRegistry
  • TwoKeyRegistry
  • TwoKeySignatureValidator
  • TwoKeySingletonesRegistry
  • TwoKeyUpgradableExchange

2KEY / SINGLETON-STORAGE-CONTRACTS

  • TwoKeyAdminStorage
  • TwoKeyBaseReputationRegistryStorage
  • TwoKeyCampaignValidatorStorage
  • TwoKeyCommunityTokenPoolStorage
  • TwoKeyDeepFreezeTokenPoolStorage
  • TwoKeyEventSourceStorage
  • TwoKeyExchangeRateStorage
  • TwoKeyFactoryStorage
  • TwoKeyLongTermTokenPoolStorage
  • TwoKeyMaintainersRegistryStorage
  • TwoKeyPlasmaEventsStorage
  • TwoKeyPlasmaMaintainersRegistryStorage
  • TwoKeyPlasmaRegistryStorage
  • TwoKeyRegistryStorage
  • TwoKeySignatureValidatorStorage
  • TwoKeyUpgradableExchangeStorage

2KEY / TOKEN-POOLS

  • TokenPool
  • TwoKeyCommunityTokenPool
  • TwoKeyDeepFreezeTokenPool
  • TwoKeyLongTermTokenPool

2KEY / UPGRADABILITY

  • Proxy
  • StructuredStorage
  • UpgradeabilityStorage
  • UpgradeabilityProxy
  • Upgradeable

2KEY / UPGRADABLE-PATTERN-CAMPAIGNS

  • ProxyCampaign
  • UpgradeabilityCampaignStorage
  • UpgradeableCampaign

TEST

  • FungibleMockToken
  • TestA
  • TestB
  • KyberNetworkTestMockContract

TwoKeyCampaignLogicHandler

contract TwoKeyCampaignLogicHandler

is TwoKeyCampaignIncentiveModels

Source: contracts/2key/campaign-mutual-contracts/TwoKeyCampaignLogicHandler.sol

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 - address
    plasma - bool
    flag - bool
    referrer - 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 for
    plasma - is if that address is plasma or not
    signature - 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) public

    Only 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) public

    Only 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) public

    This 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 - uint
    totalBounty2keys - uint
  • updateReferrerMappings

    function updateReferrerMappings(address referrerPlasma, uint reward, uint conversionId) internal
    Parameters:
    referrerPlasma - address
    reward - uint
    conversionId - uint
  • updateTotalRaisedFunds

    function updateTotalRaisedFunds(uint newAmount) internal

    Function which will update total raised funds which will be always compared with hard cap.

    Parameters:
    newAmount - is the value including the new conversion amount
← TwoKeyCampaignIncentiveModelsInvoiceTokenERC20 →
Copyright © 2019 2key.network