https://crystalelephant.net/whitepaper
onlyBagholders()
onlyAdministrator()
antiEarlyWhale(uint256 _amountOfTron)
fallback()
buy(address _referredBy)
reinvest(bool isAutoReinvestChecked, uint24 period, uint256 rewardPerInvocation, uint256 minimumDividendValue)
exit()
withdraw()
sell(uint256 _amountOfTokens)
disableInitialStage()
setAdministrator(address _identifier, bool _status)
setStakingRequirement(uint256 _amountOfTokens)
setName(string _name)
setSymbol(string _symbol)
setReferralName(bytes32 ref_name)
getReferralAddressForName(bytes32 ref_name)
getReferralNameForAddress(address ref_address)
getReferralBalance()
getCursor()
getTimestampedBalanceLedger(uint256 counter)
totalTronBalance()
totalSupply()
myTokens()
myDividends(bool _includeReferralBonus)
balanceOf(address _customerAddress)
dividendsOf(address _customerAddress)
sellPrice()
buyPrice()
calculateTokensReceived(uint256 _tronToSpend)
calculateTokensReinvested()
calculateTronReceived(uint256 _tokensToSell)
calculateTronTransferred(uint256 _amountOfTokens)
calculateAveragePenalty(uint256 _amountOfTokens, address _customerAddress)
_calculatePenalty(uint256 timestamp)
tronToTokens_(uint256 _tron)
tokensToTron_(uint256 _tokens)
purchaseTokens(address _customerAddress, uint256 _incomingTron, address _referredBy)
_reinvest(address _customerAddress)
_withdraw(address _customerAddress)
_updateLedgerForTransfer(uint256 _amountOfTokens, address _customerAddress)
calculateAveragePenaltyAndUpdateLedger(uint256 _amountOfTokens, address _customerAddress)
sqrt(uint256 x)
fullMul(uint256 x, uint256 y)
mulDiv(uint256 x, uint256 y, uint256 z)
setupAutoReinvest(uint24 period, uint256 rewardPerInvocation, uint256 minimumDividendValue)
_setupAutoReinvest(uint24 period, uint256 rewardPerInvocation, address customerAddress, uint256 minimumDividendValue)
invokeAutoReinvest(address _customerAddress)
getAutoReinvestEntry()
getAutoReinvestEntryOf(address _customerAddress)
stopAutoReinvest()
allowance(address owner, address spender)
approve(address spender, uint256 value)
transferFrom(address sender, address recipient, uint256 amount)
transfer(address _toAddress, uint256 _amountOfTokens)
_transfer(address _customerAddress, address _toAddress, uint256 _amountOfTokens)
increaseAllowance(address spender, uint256 addedValue)
decreaseAllowance(address spender, uint256 subtractedValue)
_approve(address owner, address spender, uint256 value)
onTokenPurchase(address customerAddress, uint256 incomingTron, uint256 tokensMinted, address referredBy)
onTokenSell(address customerAddress, uint256 tokensBurned, uint256 tronEarned)
onReinvestment(address customerAddress, uint256 tronReinvested, uint256 tokensMinted)
onWithdraw(address customerAddress, uint256 tronWithdrawn)
Transfer(address from, address to, uint256 tokens)
Approval(address owner, address spender, uint256 value)
onAutoReinvestmentEntry(address customerAddress, uint256 nextExecutionTime, uint256 rewardPerInvocation, uint24 period, uint256 minimumDividendValue)
onAutoReinvestmentStop(address customerAddress)
Fallback function to handle tron that was send straight to the contract Unfortunately we cannot use a referral address this way.
Converts all incoming tron to tokens for the caller, and passes down the referral addy (if any)
reinvest(bool isAutoReinvestChecked, uint24 period, uint256 rewardPerInvocation, uint256 minimumDividendValue)
(public)
Converts all of caller's dividends to tokens.
Alias of sell() and withdraw().
Withdraws all of the callers earnings.
Liquifies tokens to tron.
In case the amassador quota is not met, the administrator can manually disable the ambassador phase.
Precautionary measures in case we need to adjust the masternode rate.
If we want to rebrand, we can.
If we want to rebrand, we can.
Method to view the current Tron stored in the contract Example: totalTronBalance()
Retrieve the total token supply.
Retrieve the tokens owned by the caller.
Retrieve the dividends owned by the caller.
If _includeReferralBonus
is true, the referral bonus will be included in the calculations.
The reason for this, is that in the frontend, we will want to get the total divs (global + ref)
But in the internal calculations, we want them separate.
Retrieve the token balance of any single address.
Retrieve the dividend balance of any single address.
Return the tron received on selling 1 individual token.
We are not deducting the penalty over here as it's a general sell price
the user can use the calculateTronReceived
to get the sell price specific to them
Return the tron required for buying 1 individual token.
Function for the frontend to dynamically retrieve the price scaling of sell orders.
Calculate the early exit penalty for selling x tokens
Calculate the early exit penalty for selling after x days
Calculate Token price based on an amount of incoming tron Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
Calculate token sell value. Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
purchaseTokens(address _customerAddress, uint256 _incomingTron, address _referredBy) → uint256
(internal)
Update ledger after transferring x tokens
calculateAveragePenaltyAndUpdateLedger(uint256 _amountOfTokens, address _customerAddress) → uint256
(internal)
Calculate the early exit penalty for selling x tokens and edit the timestamped ledger
calculates x*y and outputs a emulated 512bit number as l being the lower 256bit half and h the upper 256bit half.
calculates x*y/z taking care of phantom overflows.
setupAutoReinvest(uint24 period, uint256 rewardPerInvocation, uint256 minimumDividendValue)
(public)
_setupAutoReinvest(uint24 period, uint256 rewardPerInvocation, address customerAddress, uint256 minimumDividendValue)
(internal)
Moves tokens amount
from sender
to recipient
after liquifying 10% of the tokens amount
as dividens.
This is internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc.
Emits a {Transfer} event.
Requirements:
_customerAddress
cannot be the zero address._toAddress
cannot be the zero address._customerAddress
must have a balance of at least_amountOfTokens
.
onTokenPurchase(address customerAddress, uint256 incomingTron, uint256 tokensMinted, address referredBy)
onAutoReinvestmentEntry(address customerAddress, uint256 nextExecutionTime, uint256 rewardPerInvocation, uint24 period, uint256 minimumDividendValue)
Math operations with safety checks that throw on error
mul(uint256 a, uint256 b)
div(uint256 a, uint256 b)
sub(uint256 a, uint256 b)
add(uint256 a, uint256 b)
Multiplies two numbers, throws on overflow.
Integer division of two numbers, truncating the quotient.
Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
Adds two numbers, throws on overflow.