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

TwoKeyFactory

contract TwoKeyFactory

is Upgradeable, ITwoKeySingletonUtils

Source: contracts/2key/singleton-contracts/TwoKeyFactory.sol
Author: Nikola Madjarevic

Index

  • ProxyForCampaign
  • ProxyForDonationCampaign
  • addressToCampaignType
  • createProxiesForAcquisitions
  • createProxiesForDonationCampaign
  • getLatestContractVersion
  • plasmaOf
  • setAddressToCampaignType
  • setInitialParams

Reference

Events

  • ProxyForCampaign

    event ProxyForCampaign(address proxyLogicHandler, address proxyConversionHandler, address proxyAcquisitionCampaign, address proxyPurchasesHandler, address contractor)
    Parameters:
    proxyLogicHandler - address
    proxyConversionHandler - address
    proxyAcquisitionCampaign - address
    proxyPurchasesHandler - address
    contractor - address
  • ProxyForDonationCampaign

    event ProxyForDonationCampaign(address proxyDonationCampaign, address proxyDonationConversionHandler, address proxyDonationLogicHandler, address contractor)
    Parameters:
    proxyDonationCampaign - address
    proxyDonationConversionHandler - address
    proxyDonationLogicHandler - address
    contractor - address

Functions

  • addressToCampaignType

    function addressToCampaignType(address _key) public view returns (string)

    Function working as a getter.

    Parameters:
    _key - is the address of campaign
    Returns:
    string
  • createProxiesForAcquisitions

    function createProxiesForAcquisitions(address[] addresses, uint[] valuesConversion, uint[] valuesLogicHandler, uint[] values, string _currency, string _nonSingletonHash) public payable

    This function will handle all necessary actions which should be done on the contract in order to make them ready to work. Also, we've been unfortunately forced to use arrays as arguments since the stack is not deep enough to handle this amount of input information since this method handles kick-start of 3 contracts, Function used to deploy all necessary proxy contracts in order to use the campaign.

    Parameters:
    addresses - is array of addresses needed [assetContractERC20,moderator]
    valuesConversion - is array containing necessary values to start conversion handler contract
    valuesLogicHandler - is array of values necessary to start logic handler contract
    values - is array containing values necessary to start campaign contract
    _currency - is the main currency token price is set
    _nonSingletonHash - is the hash of non-singleton contracts active with responding 2key-protocol version at the moment
  • createProxiesForDonationCampaign

    function createProxiesForDonationCampaign(address _moderator, uint[] numberValues, bool[] booleanValues, string _currency, string tokenName, string tokenSymbol, string nonSingletonHash) public

    Function to deploy proxy contracts for donation campaigns.

    Parameters:
    _moderator - address
    numberValues - uint[]
    booleanValues - bool[]
    _currency - string
    tokenName - string
    tokenSymbol - string
    nonSingletonHash - string
  • getLatestContractVersion

    function getLatestContractVersion(string contractName) internal view returns (string)
    Parameters:
    contractName - string
    Returns:
    string
  • plasmaOf

    function plasmaOf(address _address) internal view returns (address)
    Parameters:
    _address - address
    Returns:
    address
  • setAddressToCampaignType

    function setAddressToCampaignType(address _campaignAddress, string _campaignType) internal

    Internal function to set address to campaign type.

    Parameters:
    _campaignAddress - is the address of campaign
    _campaignType - is the type of campaign (String)
  • setInitialParams

    function setInitialParams(address _twoKeySingletonRegistry, address _proxyStorage) public

    Function to set initial parameters for the contract.

    Parameters:
    _twoKeySingletonRegistry - is the address of singleton registry contract
    _proxyStorage - address
← TwoKeyExchangeRateContractTwoKeyMaintainersRegistry →
Copyright © 2019 2key.network