TwoKey documentation

TwoKey documentation

  • Docs

›2KEY / DONATION-CAMPAIGN-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

TwoKeyDonationLogicHandler

contract TwoKeyDonationLogicHandler

is UpgradeableCampaign, TwoKeyCampaignLogicHandler

Source: contracts/2key/donation-campaign-contracts/TwoKeyDonationLogicHandler.sol

Index

  • calculateRaisedFundsIncludingNewConversion
  • canConversionBeCreatedInTermsOfCampaignGoal
  • canConversionBeCreatedInTermsOfMinMaxContribution
  • checkAllRequirementsForConversionAndTotalRaised
  • checkHowMuchUserCanSpend
  • getAddressStatistic
  • getConstantInfo
  • getHowMuchLeftForUserToSpend
  • isCampaignEnded
  • setInitialParamsDonationLogicHandler
  • updateRaisedFundsAndValidateConversionInTermsOfCampaignGoal

Reference

Functions

  • calculateRaisedFundsIncludingNewConversion

    function calculateRaisedFundsIncludingNewConversion(uint conversionAmount) internal view returns (uint)

    Function which will calculate how much will be raised including the conversion which try to be created.

    Parameters:
    conversionAmount - is the amount of conversion
    Returns:
    uint
  • canConversionBeCreatedInTermsOfCampaignGoal

    function canConversionBeCreatedInTermsOfCampaignGoal(uint campaignRaisedIncludingConversion) internal view returns (bool)

    Function which will validate if conversion can be created if endCampaignOnceGoalReached is selected.

    Parameters:
    campaignRaisedIncludingConversion - is how much will be total campaign raised with new conversion
    Returns:
    bool
  • canConversionBeCreatedInTermsOfMinMaxContribution

    function canConversionBeCreatedInTermsOfMinMaxContribution(address converter, uint conversionAmountEthWEI) internal view returns (bool)
    Parameters:
    converter - address
    conversionAmountEthWEI - uint
    Returns:
    bool
  • checkAllRequirementsForConversionAndTotalRaised

    function checkAllRequirementsForConversionAndTotalRaised(address converter, uint conversionAmount) external returns (bool)
    Parameters:
    converter - address
    conversionAmount - uint
    Returns:
    bool
  • checkHowMuchUserCanSpend

    function checkHowMuchUserCanSpend(address _converter) public view returns (uint)
    Parameters:
    _converter - address
    Returns:
    uint
  • getAddressStatistic

    function getAddressStatistic(address _address, bool plasma, bool flag, address referrer) internal view returns (bytes)

    Function to fetch stats for the address.

    Parameters:
    _address - address
    plasma - bool
    flag - bool
    referrer - address
    Returns:
    bytes
  • getConstantInfo

    function getConstantInfo() public view returns (uint, uint, uint, uint, uint)
    Returns:
    uint
    uint
    uint
    uint
    uint
  • getHowMuchLeftForUserToSpend

    function getHowMuchLeftForUserToSpend(uint alreadyDonatedEthWEI) internal view returns (uint)

    Function to check for some user how much he can donate.

    Parameters:
    alreadyDonatedEthWEI - uint
    Returns:
    uint
  • isCampaignEnded

    function isCampaignEnded() internal view returns (bool)

    Function to check if campaign has ended.

    Returns:
    bool
  • setInitialParamsDonationLogicHandler

    function setInitialParamsDonationLogicHandler(uint[] numberValues, string _currency, address _contractor, address _moderator, address _twoKeySingletonRegistry, address _twoKeyDonationCampaign, address _twoKeyDonationConversionHandler) public
    Parameters:
    numberValues - uint[]
    _currency - string
    _contractor - address
    _moderator - address
    _twoKeySingletonRegistry - address
    _twoKeyDonationCampaign - address
    _twoKeyDonationConversionHandler - address
  • updateRaisedFundsAndValidateConversionInTermsOfCampaignGoal

    function updateRaisedFundsAndValidateConversionInTermsOfCampaignGoal(uint conversionAmount) internal returns (bool)

    Function to update total raised funds and validate conversion in terms of campaign goal.

    Parameters:
    conversionAmount - uint
    Returns:
    bool
← TwoKeyDonationConversionHandlerERC20 →
Copyright © 2019 2key.network