TwoKeyDonationCampaign
contract TwoKeyDonationCampaign
is UpgradeableCampaign, TwoKeyCampaign, TwoKeyCampaignIncentiveModels
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 signaturereceiver
- 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
- addressnumberValues
- 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