TwoKey documentation

TwoKey documentation

  • Docs

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

TwoKeyDonationCampaign

contract TwoKeyDonationCampaign

is UpgradeableCampaign, TwoKeyCampaign, TwoKeyCampaignIncentiveModels

Source: contracts/2key/donation-campaign-contracts/TwoKeyDonationCampaign.sol
Author: Nikola Madjarevic Created at 2/19/19

Index

  • buyTokensAndDistributeReferrerRewards
  • buyTokensForModeratorRewards
  • convert
  • getReferrerBalance
  • getReferrerCuts
  • getReservedAmount2keyForRewards
  • joinAndShareARC
  • onlyTwoKeyDonationConversionHandler
  • sendBackEthWhenConversionRejected
  • setCut
  • setCutOf
  • setInitialParamsDonationCampaign
  • updateContractorProceeds
  • withdrawContractor

Reference

Modifiers

  • onlyTwoKeyDonationConversionHandler

    modifier onlyTwoKeyDonationConversionHandler()

Functions

  • buyTokensAndDistributeReferrerRewards

    function buyTokensAndDistributeReferrerRewards(uint256 _maxReferralRewardETHWei, address _converter, uint _conversionId) public returns (uint)

    Function to delegate call to logic handler and update data, and buy tokens.

    Parameters:
    _maxReferralRewardETHWei - total reward in ether wei
    _converter - is the converter address
    _conversionId - is the ID of conversion
    Returns:
    uint
  • buyTokensForModeratorRewards

    function buyTokensForModeratorRewards(uint moderatorFee) public

    Function which will buy tokens from upgradable exchange for moderator.

    Modifiers:
    onlyTwoKeyDonationConversionHandler
    Parameters:
    moderatorFee - is the fee in tokens moderator earned
  • convert

    function convert(bytes signature) public payable

    Payable function, Function where converter can convert.

    Parameters:
    signature - bytes
  • getReferrerBalance

    function getReferrerBalance(address _referrer) public view returns (uint)
    Parameters:
    _referrer - we want to check earnings for
    Returns:
    uint
  • getReferrerCuts

    function getReferrerCuts(address last_influencer) public view returns (uint256[])

    Function which acts like getter for all cuts in array.

    Parameters:
    last_influencer - is the last influencer
    Returns:
    array of integers containing cuts respectively
  • getReservedAmount2keyForRewards

    function getReservedAmount2keyForRewards() public view returns (uint)

    Function to get reserved amount of rewards.

    Returns:
    uint
  • joinAndShareARC

    function joinAndShareARC(bytes signature, address receiver) public

    Function to join with signature and share 1 arc to the receiver.

    Parameters:
    signature - is the signature
    receiver - is the address we're sending ARCs to
  • sendBackEthWhenConversionRejected

    function sendBackEthWhenConversionRejected(address _rejectedConverter, uint _conversionAmount) public

    This function can be called only by conversion handler, Function to send ether back to converter if his conversion is cancelled.

    Modifiers:
    onlyTwoKeyDonationConversionHandler
    Parameters:
    _rejectedConverter - is the address of cancelled converter
    _conversionAmount - is the amount he sent to the contract
  • setCut

    function setCut(uint256 cut) public

    Executes internal setCutOf method, Function to set cut.

    Parameters:
    cut - is the cut value
  • setCutOf

    function setCutOf(address me, uint256 cut) internal

    Function to set cut of.

    Parameters:
    me - is the address (ethereum)
    cut - is the cut value
  • setInitialParamsDonationCampaign

    function setInitialParamsDonationCampaign(address _contractor, address _moderator, address _twoKeySingletonRegistry, address _twoKeyDonationConversionHandler, address _twoKeyDonationLogicHandler, uint[] numberValues, bool[] booleanValues) public
    Parameters:
    _contractor - address
    _moderator - address
    _twoKeySingletonRegistry - address
    _twoKeyDonationConversionHandler - address
    _twoKeyDonationLogicHandler - address
    numberValues - uint[]
    booleanValues - bool[]
  • updateContractorProceeds

    function updateContractorProceeds(uint value) public

    Can be called only from TwoKeyConversionHandler contract, Option to update contractor proceeds.

    Parameters:
    value - it the value we'd like to add to total contractor proceeds and contractor balance
  • withdrawContractor

    function withdrawContractor() public

    Contractor can withdraw funds only if criteria is satisfied.

    Modifiers:
    onlyContractor
← InvoiceTokenERC20TwoKeyDonationCampaignType →
Copyright © 2019 2key.network