TwoKey documentation

TwoKey documentation

  • Docs

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

TwoKeyConversionHandler

contract TwoKeyConversionHandler

is UpgradeableCampaign, TwoKeyCampaignConversionHandler

Source: contracts/2key/acquisition-campaign-contracts/TwoKeyConversionHandler.sol
Author: Nikola Madjarevic

Index

  • converterCancelConversion
  • emitConvertedEvent
  • emitExecutedEvent
  • emitRejectedEvent
  • executeConversion
  • getConversion
  • getConverterPurchasesStats
  • rejectConverter
  • setInitialParamsConversionHandler
  • supportForCreateConversion

Reference

Functions

  • converterCancelConversion

    function converterCancelConversion(uint _conversionId) external

    Returns all the funds to the converter back, Function to cancel conversion and get back money.

    Parameters:
    _conversionId - is the id of the conversion
  • emitConvertedEvent

    function emitConvertedEvent(address converterAddress, uint baseTokens, uint bonusTokens, uint conversionAmount, bool isFiatConversion, uint conversionId) internal view
    Parameters:
    converterAddress - address
    baseTokens - uint
    bonusTokens - uint
    conversionAmount - uint
    isFiatConversion - bool
    conversionId - uint
  • emitExecutedEvent

    function emitExecutedEvent(address _converterAddress, uint conversionId, uint tokens) internal view
    Parameters:
    _converterAddress - address
    conversionId - uint
    tokens - uint
  • emitRejectedEvent

    function emitRejectedEvent(address _campaignAddress, address _converterAddress) internal view
    Parameters:
    _campaignAddress - address
    _converterAddress - address
  • executeConversion

    function executeConversion(uint _conversionId) public

    Function to perform all the logic which has to be done when we're performing conversion.

    Parameters:
    _conversionId - is the id
  • getConversion

    function getConversion(uint conversionId) external view returns (bytes)

    Function to get conversion details by id.

    Parameters:
    conversionId - is the id of conversion
    Returns:
    bytes
  • getConverterPurchasesStats

    function getConverterPurchasesStats(address _converter) public view returns (uint, uint, uint)

    Function to fetch how much user spent money and bought units in total.

    Parameters:
    _converter - is the converter we're checking this information for
    Returns:
    uint
    uint
    uint
  • rejectConverter

    function rejectConverter(address _converter) public

    Only maintainer or contractor can call this function, Function where we can reject converter.

    Modifiers:
    onlyContractorOrMaintainer
    Parameters:
    _converter - is the address of converter
  • setInitialParamsConversionHandler

    function setInitialParamsConversionHandler(uint[] values, address _twoKeyAcquisitionCampaignERC20, address _twoKeyPurchasesHandler, address _contractor, address _assetContractERC20, address _twoKeySingletonRegistry) public
    Parameters:
    values - uint[]
    _twoKeyAcquisitionCampaignERC20 - address
    _twoKeyPurchasesHandler - address
    _contractor - address
    _assetContractERC20 - address
    _twoKeySingletonRegistry - address
  • supportForCreateConversion

    function supportForCreateConversion(address _contractor, address _converterAddress, uint256 _conversionAmount, uint256 _maxReferralRewardETHWei, uint256 baseTokensForConverterUnits, uint256 bonusTokensForConverterUnits, bool isConversionFiat, bool _isAnonymous, bool _isKYCRequired) public returns (uint)

    This function can only be called from TwoKeyAcquisitionCampaign contract address, Support function to create conversion.

    Parameters:
    _contractor - is the address of campaign contractor
    _converterAddress - is the address of the converter
    _conversionAmount - is the amount for conversion in ETH
    _maxReferralRewardETHWei - uint256
    baseTokensForConverterUnits - uint256
    bonusTokensForConverterUnits - uint256
    isConversionFiat - bool
    _isAnonymous - bool
    _isKYCRequired - bool
    Returns:
    uint
← TwoKeyAcquisitionLogicHandlerTwoKeyPurchasesHandler →
Copyright © 2019 2key.network