TwoKeyCampaign
contract TwoKeyCampaign
is ArcERC20
Index
- buyTokensFromUpgradableExchange
- getConstantInfo
- getContractProxyAddress
- getContractorBalanceAndTotalProceeds
- getInfluencersKeysAndWeightsFromSignature
- getModeratorTotalEarnings
- getReceivedFrom
- getReferrerCut
- getReferrerPlasmaBalance
- onlyContractor
- publicLinkKeyOf
- referrerWithdraw
- setPublicLinkKey
- setPublicLinkKeyOf
- startCampaignWithInitialParams
- transferFrom
- updateIpfsHashOfCampaign
- updateReferrerPlasmaBalance
- withdrawContractorInternal
Reference
Modifiers
onlyContractor
modifier onlyContractor()
Functions
buyTokensFromUpgradableExchange
function buyTokensFromUpgradableExchange(uint amountOfMoney, address receiver) internal returns (uint)
Private function which will be executed at the withdraw time to buy 2key tokens from upgradable exchange contract.
- Parameters:
amountOfMoney
- is the ether balance person has on the contractreceiver
- is the address of the person who withdraws money- Returns:
- uint
getConstantInfo
function getConstantInfo() public view returns (uint, uint, bool)
Function to return the constants from the contract.
- Returns:
- uint
- uint
- bool
getContractProxyAddress
function getContractProxyAddress(string contractName) internal view returns (address)
- Parameters:
contractName
- string- Returns:
- address
getContractorBalanceAndTotalProceeds
function getContractorBalanceAndTotalProceeds() external view returns (uint, uint)
Only contractor can call this function, otherwise it will revert, Function to fetch contractor balance in ETH.
- Returns:
- value of contractor balance in ETH WEI
getInfluencersKeysAndWeightsFromSignature
function getInfluencersKeysAndWeightsFromSignature(bytes sig, address _converter) internal view returns (address[], address[], uint8[], address)
Function which will unpack signature and get referrers, keys, and weights from it.
- Parameters:
sig
- is signature_converter
- address- Returns:
- address[]
- address[]
- uint8[]
- address
getModeratorTotalEarnings
function getModeratorTotalEarnings() public view returns (uint)
Only contractor or moderator are eligible to call this function, Function to fetch moderator balance in ETH and his total earnings.
- Returns:
- value of his balance in ETH
getReceivedFrom
function getReceivedFrom(address _receiver) public view returns (address)
Getter for the referral chain.
- Parameters:
_receiver
- is address we want to check who he has received link from- Returns:
- address
getReferrerCut
function getReferrerCut(address me) public view returns (uint256)
Function to get cut for an (ethereum) address.
- Parameters:
me
- is the ethereum address- Returns:
- uint256
getReferrerPlasmaBalance
function getReferrerPlasmaBalance(address _influencer) public view returns (uint)
Function to get balance of influencer for his plasma address.
- Parameters:
_influencer
- is the plasma address of influencer- Returns:
- balance in wei's
publicLinkKeyOf
function publicLinkKeyOf(address me) public view returns (address)
Function to get public link key of an address.
- Parameters:
me
- is the address we're checking public link key- Returns:
- address
referrerWithdraw
function referrerWithdraw(address _address, bool _withdrawAsStable) public
It can be called by the address specified in the param or by the one of two key maintainers, Function where moderator or referrer can withdraw their available funds.
- Parameters:
_address
- is the address we're withdrawing funds to_withdrawAsStable
- bool
setPublicLinkKey
function setPublicLinkKey(address new_public_key) public
Function to set public link key.
- Parameters:
new_public_key
- is the new public key
setPublicLinkKeyOf
function setPublicLinkKeyOf(address me, address new_public_key) internal
Private function to set public link key to plasma address.
- Parameters:
me
- is the ethereum addressnew_public_key
- is the new key user want's to set as his public key
startCampaignWithInitialParams
function startCampaignWithInitialParams(string _publicMetaHash, string _privateMetaHash, address new_public_key) public
Only contractor can call this, Function to set or update public meta hash.
- Modifiers:
- onlyContractor
- Parameters:
_publicMetaHash
- is the hash of the campaign_privateMetaHash
- stringnew_public_key
- address
transferFrom
function transferFrom(address _from, address _to, uint256 _value) internal returns (bool)
Transfer tokens from one address to another.
- Parameters:
_from
- address The address which you want to send tokens from ALREADY converted to plasma_to
- address The address which you want to transfer to ALREADY converted to plasma_value
- uint256 the amount of tokens to be transferred- Returns:
- bool
updateIpfsHashOfCampaign
function updateIpfsHashOfCampaign(string _newPublicMetaHash) public
Function to allow updating public meta hash.
- Modifiers:
- onlyContractor
- Parameters:
_newPublicMetaHash
- is the new meta hash
updateReferrerPlasmaBalance
function updateReferrerPlasmaBalance(address _influencer, uint _balance) public
Function to update referrer plasma balance.
- Parameters:
_influencer
- is the plasma address of referrer_balance
- is the new balance
withdrawContractorInternal
function withdrawContractorInternal() internal
OnlyContractor can call this method, Function where contractor can withdraw his funds.
- Returns:
- true if successful otherwise will 'revert'