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

TwoKeyRegistry

contract TwoKeyRegistry

is Upgradeable, Utils, ITwoKeySingletonUtils

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

Index

  • UserNameChanged
  • addName
  • addNameAndSetWalletName
  • addNameInternal
  • addNameSigned
  • addPlasma2EthereumByUser
  • address2username
  • address2walletTag
  • checkIfUserExists
  • getEthereumToPlasma
  • getPlasmaToEthereum
  • getUserAddress2UserName
  • getUserData
  • getUserName2UserAddress
  • isMaintainer
  • notes
  • setInitialParams
  • setNoteByUser
  • setPlasma2EthereumAndNoteSigned
  • setWalletName
  • username2currentAddress
  • walletTag2address

Reference

Events

  • UserNameChanged

    event UserNameChanged(address owner, string name)

    Event is emitted when a user's name is changed.

    Parameters:
    owner - address
    name - string

Functions

  • addName

    function addName(string _name, address _sender, string _fullName, string _email, bytes signature) public

    Function where only admin can add a name - address pair.

    Parameters:
    _name - is name of user
    _sender - is address of user
    _fullName - string
    _email - string
    signature - bytes
  • addNameAndSetWalletName

    function addNameAndSetWalletName(string _name, address _sender, string _fullName, string _email, string _username_walletName, bytes _signatureName, bytes _signatureWalletName) public

    Function to concat this 2 functions at once.

    Parameters:
    _name - string
    _sender - address
    _fullName - string
    _email - string
    _username_walletName - string
    _signatureName - bytes
    _signatureWalletName - bytes
  • addNameInternal

    function addNameInternal(string _name, address _sender) internal

    Private function, Function where new name/address pair is added or an old address is updated with new name.

    Parameters:
    _name - is name of user
    _sender - is address of user
  • addNameSigned

    function addNameSigned(string _name, bytes external_sig) public

    Add signed name.

    Parameters:
    _name - is the name
    external_sig - is the external signature
  • addPlasma2EthereumByUser

    function addPlasma2EthereumByUser(bytes sig) public
    Parameters:
    sig - bytes
  • address2username

    function address2username(address keyAddress) public view returns (string)
    Parameters:
    keyAddress - address
    Returns:
    string
  • address2walletTag

    function address2walletTag(address keyAddress) public view returns (bytes32)
    Parameters:
    keyAddress - address
    Returns:
    bytes32
  • checkIfUserExists

    function checkIfUserExists(address _userAddress) external view returns (bool)

    Function to check if the user exists.

    Parameters:
    _userAddress - is the address of the user
    Returns:
    true if exists otherwise false
  • getEthereumToPlasma

    function getEthereumToPlasma(address ethereum) public view returns (address)

    Reading from mapping plasma 2 ethereum.

    Parameters:
    ethereum - is the ethereum address we're searching plasma address for
    Returns:
    plasma address if exist otherwise 0x0 (address(0))
  • getPlasmaToEthereum

    function getPlasmaToEthereum(address plasma) public view returns (address)

    Reading from mapping ethereum 2 plasma.

    Parameters:
    plasma - is the plasma address we're searching eth address for
    Returns:
    ethereum address if exist otherwise 0x0 (address(0))
  • getUserAddress2UserName

    function getUserAddress2UserName(address _sender) external view returns (string)

    View function - doesn't cost any gas to be executed, Function to fetch name that corresponds to the address.

    Parameters:
    _sender - is address of user
    Returns:
    name of the user as type string
  • getUserData

    function getUserData(address _user) external view returns (bytes)
    Parameters:
    _user - address
    Returns:
    bytes
  • getUserName2UserAddress

    function getUserName2UserAddress(string _name) external view returns (address)

    View function - doesn't cost any gas to be executed, Function to fetch address of the user that corresponds to given name.

    Parameters:
    _name - is name of user
    Returns:
    address of the user as type address
  • isMaintainer

    function isMaintainer(address x) internal view returns (bool)
    Parameters:
    x - address
    Returns:
    bool
  • notes

    function notes(address keyAddress) public view returns (bytes)
    Parameters:
    keyAddress - address
    Returns:
    bytes
  • setInitialParams

    function setInitialParams(address _twoKeySingletonesRegistry, address _proxyStorage) external

    Function which can be called only once.

    Parameters:
    _twoKeySingletonesRegistry - address
    _proxyStorage - address
  • setNoteByUser

    function setNoteByUser(bytes note) public
    Parameters:
    note - bytes
  • setPlasma2EthereumAndNoteSigned

    function setPlasma2EthereumAndNoteSigned(bytes sig, bytes note, bytes external_sig) public
    Parameters:
    sig - bytes
    note - bytes
    external_sig - bytes
  • setWalletName

    function setWalletName(string username, address _address, string _username_walletName, bytes signature) public

    Function where TwoKeyMaintainer can add walletname to address.

    Parameters:
    username - is the username of the user we want to update map for
    _address - is the address of the user we want to update map for
    _username_walletName - is the concatenated username + '_' + walletName, since sending from trusted provider no need to validate
    signature - bytes
  • username2currentAddress

    function username2currentAddress(bytes32 _username) public view returns (address)
    Parameters:
    _username - bytes32
    Returns:
    address
  • walletTag2address

    function walletTag2address(bytes32 walletTag) public view returns (address)
    Parameters:
    walletTag - bytes32
    Returns:
    address
← TwoKeyPlasmaSingletoneRegistryTwoKeySignatureValidator →
Copyright © 2019 2key.network