TwoKey documentation

TwoKey documentation

  • Docs

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

TwoKeyCampaignConversionHandler

contract TwoKeyCampaignConversionHandler

is TwoKeyConversionStates, TwoKeyConverterStates

Source: contracts/2key/campaign-mutual-contracts/TwoKeyCampaignConversionHandler.sol

Index

  • ConversionCreated
  • approveConverter
  • calculateModeratorFee
  • getAddressFromTwoKeySingletonRegistry
  • getAllConvertersPerState
  • getCampaignSummary
  • getConverterConversionIds
  • getLastConverterConversionId
  • getNumberOfConversions
  • getStateForConverter
  • moveFromPendingOrRejectedToApprovedState
  • moveFromPendingToRejectedState
  • moveFromStateAToStateB
  • onlyContractorOrMaintainer
  • rejectConverterInternal

Reference

Events

  • ConversionCreated

    event ConversionCreated(uint conversionId)
    Parameters:
    conversionId - uint

Modifiers

  • onlyContractorOrMaintainer

    modifier onlyContractorOrMaintainer()

Functions

  • approveConverter

    function approveConverter(address _converter) public

    Only maintainer or contractor can call this method, Function where we are approving converter.

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

    function calculateModeratorFee(uint256 _conversionAmountETHWei) internal view returns (uint256)

    Given the total payout, calculates the moderator fee.

    Parameters:
    _conversionAmountETHWei - total payout for escrow
    Returns:
    moderator fee
  • getAddressFromTwoKeySingletonRegistry

    function getAddressFromTwoKeySingletonRegistry(string contractName) internal view returns (address)
    Parameters:
    contractName - string
    Returns:
    address
  • getAllConvertersPerState

    function getAllConvertersPerState(bytes32 state) public view returns (address[])
    Parameters:
    state - bytes32
    Returns:
    address[]
  • getCampaignSummary

    function getCampaignSummary() public view returns (uint, uint, uint, uint[])

    Get's number of converters per type, and returns tuple, as well as total raised funds.

    Returns:
    uint
    uint
    uint
    uint[]
  • getConverterConversionIds

    function getConverterConversionIds(address _converter) public view returns (uint[])

    Can only be called by converter itself or maintainer/contractor, Function to get all conversion ids for the converter.

    Parameters:
    _converter - is the address of the converter
    Returns:
    array of conversion ids
  • getLastConverterConversionId

    function getLastConverterConversionId(address _converter) public view returns (uint)
    Parameters:
    _converter - address
    Returns:
    uint
  • getNumberOfConversions

    function getNumberOfConversions() external view returns (uint)

    Can only be called by contractor or maintainer, Function to get number of conversions.

    Returns:
    uint
  • getStateForConverter

    function getStateForConverter(address _converter) external view returns (bytes32)

    Function to get converter state.

    Parameters:
    _converter - is the address of the requested converter
    Returns:
    hexed string of the state
  • moveFromPendingOrRejectedToApprovedState

    function moveFromPendingOrRejectedToApprovedState(address _converter) internal

    Converter can only be approved if his previous state is pending or rejected, Function where we can change state of converter to Approved.

    Parameters:
    _converter - is the address of converter
  • moveFromPendingToRejectedState

    function moveFromPendingToRejectedState(address _converter) internal

    Private function, will be executed in another one, Function where we're going to move state of conversion from pending to rejected.

    Parameters:
    _converter - is the address of converter
  • moveFromStateAToStateB

    function moveFromStateAToStateB(address _converter, bytes32 destinationState) internal

    Function to move converter address from stateA to stateB.

    Parameters:
    _converter - is the address of converter
    destinationState - is the state we'd like to move converter to
  • rejectConverterInternal

    function rejectConverterInternal(address _converter) internal
    Parameters:
    _converter - address
← TwoKeyCampaignTwoKeyCampaignIncentiveModels →
Copyright © 2019 2key.network