Skip to content

ceto-code/ceto-contract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt text

Crystal Elephant Token

Whitepaper

https://crystalelephant.net/whitepaper

Documentation

Hourglass

onlyBagholders()

onlyAdministrator()

antiEarlyWhale(uint256 _amountOfTron)

fallback() (external)

Fallback function to handle tron that was send straight to the contract Unfortunately we cannot use a referral address this way.

buy(address _referredBy) (public)

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.

exit() (public)

Alias of sell() and withdraw().

withdraw() (public)

Withdraws all of the callers earnings.

sell(uint256 _amountOfTokens) (public)

Liquifies tokens to tron.

disableInitialStage() (public)

In case the amassador quota is not met, the administrator can manually disable the ambassador phase.

setAdministrator(address _identifier, bool _status) (public)

setStakingRequirement(uint256 _amountOfTokens) (public)

Precautionary measures in case we need to adjust the masternode rate.

setName(string _name) (public)

If we want to rebrand, we can.

setSymbol(string _symbol) (public)

If we want to rebrand, we can.

setReferralName(bytes32 ref_name) → bool (public)

getReferralAddressForName(bytes32 ref_name) → address (public)

getReferralNameForAddress(address ref_address) → bytes32 (public)

getReferralBalance() → uint256, uint256 (public)

getCursor() → uint256, uint256 (public)

getTimestampedBalanceLedger(uint256 counter) → uint256, uint256, uint256 (public)

totalTronBalance() → uint256 (public)

Method to view the current Tron stored in the contract Example: totalTronBalance()

totalSupply() → uint256 (public)

Retrieve the total token supply.

myTokens() → uint256 (public)

Retrieve the tokens owned by the caller.

myDividends(bool _includeReferralBonus) → uint256 (public)

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.

balanceOf(address _customerAddress) → uint256 (public)

Retrieve the token balance of any single address.

dividendsOf(address _customerAddress) → uint256 (public)

Retrieve the dividend balance of any single address.

sellPrice() → uint256 (public)

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

buyPrice() → uint256 (public)

Return the tron required for buying 1 individual token.

calculateTokensReceived(uint256 _tronToSpend) → uint256 (public)

calculateTokensReinvested() → uint256 (public)

calculateTronReceived(uint256 _tokensToSell) → uint256 (public)

Function for the frontend to dynamically retrieve the price scaling of sell orders.

calculateTronTransferred(uint256 _amountOfTokens) → uint256 (public)

calculateAveragePenalty(uint256 _amountOfTokens, address _customerAddress) → uint256 (public)

Calculate the early exit penalty for selling x tokens

_calculatePenalty(uint256 timestamp) → uint256 (public)

Calculate the early exit penalty for selling after x days

tronToTokens_(uint256 _tron) → uint256 (public)

Calculate Token price based on an amount of incoming tron Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.

tokensToTron_(uint256 _tokens) → uint256 (public)

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)

_reinvest(address _customerAddress) (internal)

_withdraw(address _customerAddress) (internal)

_updateLedgerForTransfer(uint256 _amountOfTokens, address _customerAddress) (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

sqrt(uint256 x) → uint256 y (internal)

fullMul(uint256 x, uint256 y) → uint256 l, uint256 h (public)

calculates x*y and outputs a emulated 512bit number as l being the lower 256bit half and h the upper 256bit half.

mulDiv(uint256 x, uint256 y, uint256 z) → uint256 (public)

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)

invokeAutoReinvest(address _customerAddress) → uint256 (external)

getAutoReinvestEntry() → uint256, uint256, uint24, uint256 (public)

getAutoReinvestEntryOf(address _customerAddress) → uint256, uint256, uint24, uint256 (public)

stopAutoReinvest() (external)

allowance(address owner, address spender) → uint256 (public)

approve(address spender, uint256 value) → bool (public)

transferFrom(address sender, address recipient, uint256 amount) → bool (public)

transfer(address _toAddress, uint256 _amountOfTokens) → bool (public)

_transfer(address _customerAddress, address _toAddress, uint256 _amountOfTokens) (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.

increaseAllowance(address spender, uint256 addedValue) → bool (public)

decreaseAllowance(address spender, uint256 subtractedValue) → bool (public)

_approve(address owner, address spender, uint256 value) (internal)

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)

SafeMath

Math operations with safety checks that throw on error

mul(uint256 a, uint256 b) → uint256 (internal)

Multiplies two numbers, throws on overflow.

div(uint256 a, uint256 b) → uint256 (internal)

Integer division of two numbers, truncating the quotient.

sub(uint256 a, uint256 b) → uint256 (internal)

Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).

add(uint256 a, uint256 b) → uint256 (internal)

Adds two numbers, throws on overflow.

About

Profitability through patience

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published