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

TwoKeyBaseReputationRegistry

contract TwoKeyBaseReputationRegistry

is Upgradeable, ITwoKeySingletonUtils

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

Index

  • getConversionHandlerAddress
  • getLogicHandlerAddress
  • getReferrers
  • getRewardsByAddress
  • setInitialParams
  • updateOnConversionExecutedEvent
  • updateOnConversionRejectedEvent
  • validateCall

Reference

Functions

  • getConversionHandlerAddress

    function getConversionHandlerAddress(address acquisitionCampaign) internal view returns (address)

    Internal getter from Acquisition campaign to fetch conersion handler address.

    Parameters:
    acquisitionCampaign - address
    Returns:
    address
  • getLogicHandlerAddress

    function getLogicHandlerAddress(address acquisitionCampaign) internal view returns (address)

    Internal getter from Acquisition campaign to fetch logic handler address.

    Parameters:
    acquisitionCampaign - address
    Returns:
    address
  • getReferrers

    function getReferrers(address converter, address acquisitionCampaign) internal view returns (address[])

    Function to get all referrers in the chain for specific converter.

    Parameters:
    converter - is the converter we want to get referral chain
    acquisitionCampaign - is the acquisition campaign contract
    Returns:
    array of addresses (referrers)
  • getRewardsByAddress

    function getRewardsByAddress(address _address) public view returns (int, int, int)

    Function to fetch reputation points per address.

    Parameters:
    _address - is the address of the user we want to check points for
    Returns:
    encoded values in type bytes, unpackable by slices of 66,2,64,2,64,2 parsed to int / bool
  • setInitialParams

    function setInitialParams(address _twoKeySingletoneRegistry, address _proxyStorage) public

    Since using singletone pattern, this is replacement for the constructor.

    Parameters:
    _twoKeySingletoneRegistry - is the address of registry of all singleton contracts
    _proxyStorage - address
  • updateOnConversionExecutedEvent

    function updateOnConversionExecutedEvent(address converter, address contractor, address acquisitionCampaign) public

    This function can only be called by TwoKeyConversionHandler contract assigned to the Acquisition from method param, If the conversion executed event occured, 10 points for the converter and contractor + 10/distance to referrer.

    Parameters:
    converter - is the address of the converter
    contractor - is the address of the contractor
    acquisitionCampaign - is the address of the acquisition campaign so we can get referrers from there
  • updateOnConversionRejectedEvent

    function updateOnConversionRejectedEvent(address converter, address contractor, address acquisitionCampaign) public

    This function can only be called by TwoKeyConversionHandler contract assigned to the Acquisition from method param, If the conversion rejected event occured, giving penalty points.

    Parameters:
    converter - is the address of the converter
    contractor - is the address of the contractor
    acquisitionCampaign - is the address of the acquisition campaign so we can get referrers from there
  • validateCall

    function validateCall() internal view

    Function to validate that the call is comming from validated campaign.

← TwoKeyAdminTwoKeyCampaignValidator →
Copyright © 2019 2key.network