TwoKey documentation

TwoKey documentation

  • Docs

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

TwoKeyEventSource

contract TwoKeyEventSource

is Upgradeable, ITwoKeySingletonUtils

Source: contracts/2key/singleton-contracts/TwoKeyEventSource.sol

Index

  • AcquisitionCampaignCreated
  • Cancelled
  • Converted
  • ConvertedAcquisition
  • ConvertedAcquisitionV2
  • ConvertedDonation
  • ConvertedDonationV2
  • Created
  • DonationCampaignCreated
  • Executed
  • ExecutedV1
  • Joined
  • PriceUpdated
  • ReceivedEther
  • Rejected
  • Rewarded
  • UpdatedData
  • UpdatedPublicMetaHash
  • UserRegistered
  • acquisitionCampaignCreated
  • cancelled
  • converted
  • convertedAcquisition
  • convertedAcquisitionV2
  • convertedDonation
  • convertedDonationV2
  • created
  • donationCampaignCreated
  • ethereumOf
  • executed
  • executedV1
  • getTwoKeyDefaultIntegratorFeeFromAdmin
  • getTwoKeyDefaultNetworkTaxPercent
  • isAddressMaintainer
  • joined
  • onlyAllowedContracts
  • onlyTwoKeyCampaignValidator
  • plasmaOf
  • priceUpdated
  • rejected
  • rewarded
  • setInitialParams
  • userRegistered

Reference

Events

  • AcquisitionCampaignCreated

    event AcquisitionCampaignCreated(address proxyLogicHandler, address proxyConversionHandler, address proxyAcquisitionCampaign, address proxyPurchasesHandler, address contractor)
    Parameters:
    proxyLogicHandler - address
    proxyConversionHandler - address
    proxyAcquisitionCampaign - address
    proxyPurchasesHandler - address
    contractor - address
  • Cancelled

    event Cancelled(address _campaign, address _converter, uint256 _indexOrAmount)
    Parameters:
    _campaign - address
    _converter - address
    _indexOrAmount - uint256
  • Converted

    event Converted(address _campaign, address _converter, uint256 _amount)
    Parameters:
    _campaign - address
    _converter - address
    _amount - uint256
  • ConvertedAcquisition

    event ConvertedAcquisition(address _campaign, address _converter, uint256 _baseTokens, uint256 _bonusTokens, uint256 _conversionAmount, bool _isFiatConversion)
    Parameters:
    _campaign - address
    _converter - address
    _baseTokens - uint256
    _bonusTokens - uint256
    _conversionAmount - uint256
    _isFiatConversion - bool
  • ConvertedAcquisitionV2

    event ConvertedAcquisitionV2(address _campaign, address _converterPlasma, uint256 _baseTokens, uint256 _bonusTokens, uint256 _conversionAmount, bool _isFiatConversion, uint _conversionId)
    Parameters:
    _campaign - address
    _converterPlasma - address
    _baseTokens - uint256
    _bonusTokens - uint256
    _conversionAmount - uint256
    _isFiatConversion - bool
    _conversionId - uint
  • ConvertedDonation

    event ConvertedDonation(address _campaign, address _converter, uint _conversionAmount)
    Parameters:
    _campaign - address
    _converter - address
    _conversionAmount - uint
  • ConvertedDonationV2

    event ConvertedDonationV2(address _campaign, address _converterPlasma, uint _conversionAmount, uint _conversionId)
    Parameters:
    _campaign - address
    _converterPlasma - address
    _conversionAmount - uint
    _conversionId - uint
  • Created

    event Created(address _campaign, address _owner, address _moderator)
    Parameters:
    _campaign - address
    _owner - address
    _moderator - address
  • DonationCampaignCreated

    event DonationCampaignCreated(address proxyDonationCampaign, address proxyDonationConversionHandler, address proxyDonationLogicHandler, address contractor)
    Parameters:
    proxyDonationCampaign - address
    proxyDonationConversionHandler - address
    proxyDonationLogicHandler - address
    contractor - address
  • Executed

    event Executed(address campaignAddress, address converterPlasmaAddress, uint conversionId)
    Parameters:
    campaignAddress - address
    converterPlasmaAddress - address
    conversionId - uint
  • ExecutedV1

    event ExecutedV1(address campaignAddress, address converterPlasmaAddress, uint conversionId, uint tokens)
    Parameters:
    campaignAddress - address
    converterPlasmaAddress - address
    conversionId - uint
    tokens - uint
  • Joined

    event Joined(address _campaign, address _from, address _to)
    Parameters:
    _campaign - address
    _from - address
    _to - address
  • PriceUpdated

    event PriceUpdated(bytes32 _currency, uint newRate, uint _timestamp, address _updater)
    Parameters:
    _currency - bytes32
    newRate - uint
    _timestamp - uint
    _updater - address
  • ReceivedEther

    event ReceivedEther(address _sender, uint value)
    Parameters:
    _sender - address
    value - uint
  • Rejected

    event Rejected(address _campaign, address _converter)
    Parameters:
    _campaign - address
    _converter - address
  • Rewarded

    event Rewarded(address _campaign, address _to, uint256 _amount)
    Parameters:
    _campaign - address
    _to - address
    _amount - uint256
  • UpdatedData

    event UpdatedData(uint timestamp, uint value, string action)
    Parameters:
    timestamp - uint
    value - uint
    action - string
  • UpdatedPublicMetaHash

    event UpdatedPublicMetaHash(uint timestamp, string value)
    Parameters:
    timestamp - uint
    value - string
  • UserRegistered

    event UserRegistered(string _name, address _address, string _fullName, string _email, string _username_walletName)
    Parameters:
    _name - string
    _address - address
    _fullName - string
    _email - string
    _username_walletName - string

Modifiers

  • onlyAllowedContracts

    modifier onlyAllowedContracts()

    Modifier which will allow only completely verified and validated contracts to call some functions.

  • onlyTwoKeyCampaignValidator

    modifier onlyTwoKeyCampaignValidator()

    Modifier which will allow only TwoKeyCampaignValidator to make some calls.

Functions

  • acquisitionCampaignCreated

    function acquisitionCampaignCreated(address proxyLogicHandler, address proxyConversionHandler, address proxyAcquisitionCampaign, address proxyPurchasesHandler, address contractor) external

    Function to emit event every time someone starts new Acquisition campaign.

    Parameters:
    proxyLogicHandler - is the address of TwoKeyAcquisitionLogicHandler proxy deployed by TwoKeyFactory
    proxyConversionHandler - is the address of TwoKeyConversionHandler proxy deployed by TwoKeyFactory
    proxyAcquisitionCampaign - is the address of TwoKeyAcquisitionCampaign proxy deployed by TwoKeyFactory
    proxyPurchasesHandler - is the address of TwoKeyPurchasesHandler proxy deployed by TwoKeyFactory
    contractor - address
  • cancelled

    function cancelled(address _campaign, address _converter, uint256 _indexOrAmount) external

    Function to emit created event every time campaign is cancelled.

    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - is the address of the cancelled campaign
    _converter - is the address of the converter
    _indexOrAmount - is the amount of campaign
  • converted

    function converted(address _campaign, address _converter, uint256 _conversionAmount) external

    Function to emit converted event.

    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - is the address of main campaign contract
    _converter - is the address of converter during the conversion
    _conversionAmount - is conversion amount
  • convertedAcquisition

    function convertedAcquisition(address _campaign, address _converter, uint256 _baseTokens, uint256 _bonusTokens, uint256 _conversionAmount, bool _isFiatConversion) external
    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - address
    _converter - address
    _baseTokens - uint256
    _bonusTokens - uint256
    _conversionAmount - uint256
    _isFiatConversion - bool
  • convertedAcquisitionV2

    function convertedAcquisitionV2(address _campaign, address _converterPlasma, uint256 _baseTokens, uint256 _bonusTokens, uint256 _conversionAmount, bool _isFiatConversion, uint _conversionId) external

    This function updates values in TwoKeyRegistry contract, Function to emit created event every time conversion happened under AcquisitionCampaign.

    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - is the address of the deployed campaign
    _converterPlasma - is the converter address
    _baseTokens - is the amount of tokens bought
    _bonusTokens - is the amount of bonus tokens received
    _conversionAmount - is the amount of conversion
    _isFiatConversion - is flag representing if conversion is either FIAT or ETHER
    _conversionId - is the id of conversion
  • convertedDonation

    function convertedDonation(address _campaign, address _converter, uint256 _conversionAmount) external
    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - address
    _converter - address
    _conversionAmount - uint256
  • convertedDonationV2

    function convertedDonationV2(address _campaign, address _converterPlasma, uint256 _conversionAmount, uint256 _conversionId) external

    Function to emit created event every time conversion happened under DonationCampaign.

    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - is the address of main campaign contract
    _converterPlasma - is the address of the converter
    _conversionAmount - is the amount of conversion
    _conversionId - is the id of conversion
  • created

    function created(address _campaign, address _owner, address _moderator) external

    This function updates values in TwoKeyRegistry contract, Function to emit created event every time campaign is created.

    Modifiers:
    onlyTwoKeyCampaignValidator
    Parameters:
    _campaign - is the address of the deployed campaign
    _owner - is the contractor address of the campaign
    _moderator - is the address of the moderator in campaign
  • donationCampaignCreated

    function donationCampaignCreated(address proxyDonationCampaign, address proxyDonationConversionHandler, address proxyDonationLogicHandler, address contractor) external

    Function to emit event every time someone starts new Donation campaign.

    Parameters:
    proxyDonationCampaign - is the address of TwoKeyDonationCampaign proxy deployed by TwoKeyFactory
    proxyDonationConversionHandler - is the address of TwoKeyDonationConversionHandler proxy deployed by TwoKeyFactory
    proxyDonationLogicHandler - is the address of TwoKeyDonationLogicHandler proxy deployed by TwoKeyFactory
    contractor - address
  • 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
  • executed

    function executed(address _campaignAddress, address _converterPlasmaAddress, uint _conversionId) external

    Function to emit event every time conversion gets executed.

    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaignAddress - is the main campaign contract address
    _converterPlasmaAddress - is the address of converter plasma
    _conversionId - is the ID of conversion, unique per campaign
  • executedV1

    function executedV1(address _campaignAddress, address _converterPlasmaAddress, uint _conversionId, uint tokens) external

    Function to emit event every time conversion gets executed.

    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaignAddress - is the main campaign contract address
    _converterPlasmaAddress - is the address of converter plasma
    _conversionId - is the ID of conversion, unique per campaign
    tokens - uint
  • getTwoKeyDefaultIntegratorFeeFromAdmin

    function getTwoKeyDefaultIntegratorFeeFromAdmin() public view returns (uint)

    In default TwoKeyAdmin will be moderator and his fee percentage per conversion is predefined.

    Returns:
    uint
  • getTwoKeyDefaultNetworkTaxPercent

    function getTwoKeyDefaultNetworkTaxPercent() public view returns (uint)

    Function to get default network tax percentage.

    Returns:
    uint
  • isAddressMaintainer

    function isAddressMaintainer(address _maintainer) public view returns (bool)

    Address to check if an address is maintainer in TwoKeyMaintainersRegistry.

    Parameters:
    _maintainer - is the address we're checking this for
    Returns:
    bool
  • joined

    function joined(address _campaign, address _from, address _to) external

    This function updates values in TwoKeyRegistry contract, Function to emit created event every time someone has joined to campaign.

    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - is the address of the deployed campaign
    _from - is the address of the referrer
    _to - is the address of person who has joined
  • plasmaOf

    function plasmaOf(address me) public view returns (address)

    Function to check adequate plasma address for submitted eth address.

    Parameters:
    me - is the ethereum address we request corresponding plasma address for
    Returns:
    address
  • priceUpdated

    function priceUpdated(bytes32 _currency, uint _newRate, uint _timestamp, address _updater) external

    Function which will emit event PriceUpdated every time that happens under TwoKeyExchangeRateContract.

    Parameters:
    _currency - is the hexed string of currency name
    _newRate - is the new rate
    _timestamp - is the time of updating
    _updater - is the maintainer address which performed this call
  • rejected

    function rejected(address _campaign, address _converter) external
    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - address
    _converter - address
  • rewarded

    function rewarded(address _campaign, address _to, uint256 _amount) external

    Function to emit created event every time bounty is distributed between influencers.

    Modifiers:
    onlyAllowedContracts
    Parameters:
    _campaign - is the address of the deployed campaign
    _to - is the reward receiver
    _amount - is the reward amount
  • setInitialParams

    function setInitialParams(address _twoKeySingletonesRegistry, address _proxyStorage) external

    Function to set initial params in the contract.

    Parameters:
    _twoKeySingletonesRegistry - is the address of TWO_KEY_SINGLETON_REGISTRY contract
    _proxyStorage - is the address of proxy of storage contract
  • userRegistered

    function userRegistered(string _name, address _address, string _fullName, string _email, string _username_walletName) external

    Function to emit event every time user is registered.

    Parameters:
    _name - is the name of the user
    _address - is the address of the user
    _fullName - is the full user name
    _email - is users email
    _username_walletName - is = concat(username,'_',walletName)
← TwoKeyEconomyTwoKeyExchangeRateContract →
Copyright © 2019 2key.network