Blockwell

Cajutel

ERC20

This contract is an ERC20 token.

Name Cajutel
Symbol CAJ
Decimals 18
Total Supply 1,780,000 CAJ

About link description

Cajutel (CAJ) is a cryptocurrency token and operates on the Ethereum platform. Cajutel has a current supply of 1,780,000 with 1,352,388.808 in circulation. The last known price of Cajutel is $2.81 USD and is up 57.86% over the last 24 hours. It is currently trading on 3 active market(s) with $4,801.62 traded over the last 24 hours. More information can be found at https://cajutel.io.

Stats

Public Functions 17
Event Types 5
Code Size 55,663 bytes

DividendClaimed Event

Parameters help
id
uint256 help
_address
address help
_claim
uint256 help

DividendRecycled Event

Parameters help
id
uint256 help
_recycler
address help
_blockNumber
uint256 help
_amount
uint256 help
_totalSupply
uint256 help

DividendTransfered Event

Parameters help
id
uint256 help
_address
address help
_block
uint256 help
_amount
uint256 help
_totalSupply
uint256 help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

UnclaimedDividendTransfer Event

Parameters help
id
uint256 help
_value
uint256 help

Functions Expand All Collapse All

transferOwnership keyboard_arrow_up

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function transferOwnership(address _newOwner) public onlyOwner {
        require(_newOwner != address(0));
        newOwner = _newOwner;

    }

acceptOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function acceptOwnership() public {
        if (msg.sender == newOwner) {
            owner = newOwner;
        }
    }

transfer keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

Source Code
    function transfer(address _to, uint256 _value) public onlyPayloadSize(2) {
        require(locked == false);

        bool status = transferInternal(msg.sender, _to, _value);

        require(status == true);
    }

approve keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function approve(address _spender, uint256 _value) public returns (bool success) {
        if (locked) {
            return false;
        }

        allowance[msg.sender][_spender] = _value;

        return true;
    }

transferFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
        if (locked) {
            return false;
        }

        if (allowance[_from][msg.sender] < _value) {
            return false;
        }

        bool _success = transferInternal(_from, _to, _value);

        if (_success) {
            allowance[_from][msg.sender] -= _value;
        }

        return _success;
    }

addDividend keyboard_arrow_up

Parameters help

Name Type
recycleTime
uint256 help

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
    function addDividend(uint256 recycleTime) public payable onlyOwner {
        require(msg.value > 0);

        uint256 id = dividends.length;
        uint256 _totalSupply = totalSupply;

        dividends.push(
            Dividend(
                id,
                block.number,
                now,
                msg.value,
                0,
                0,
                _totalSupply,
                recycleTime,
                false
            )
        );

        DividendTransfered(id, msg.sender, block.number, msg.value, _totalSupply);
    }

claimDividend keyboard_arrow_up

Parameters help

Name Type
dividendId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function claimDividend(uint256 dividendId) public returns (bool) {
        if ((dividends.length).sub(1) < dividendId) {
            return false;
        }

        Dividend storage dividend = dividends[dividendId];

        if (dividend.claimed[msg.sender] == true) {
            return false;
        }

        if (dividend.recycled == true) {
            return false;
        }

        if (now >= dividend.time.add(dividend.recycleTime)) {
            return false;
        }

        uint256 balance = valueAt(loggedBalances[msg.sender], dividend.block);

        if (balance == 0) {
            return false;
        }

        uint256 claim = balance.mul(dividend.amount).div(dividend.totalSupply);

        dividend.claimed[msg.sender] = true;

        dividend.claimedAmount = dividend.claimedAmount.add(claim);

        if (claim > 0) {
            msg.sender.transfer(claim);
            DividendClaimed(dividendId, msg.sender, claim);

            return true;
        }

        return false;
    }

claimDividends keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function claimDividends() public {
        require(dividendsClaimed[msg.sender] < dividends.length);
        for (uint i = dividendsClaimed[msg.sender]; i < dividends.length; i++) {
            if ((dividends[i].claimed[msg.sender] == false) && (dividends[i].recycled == false)) {
                dividendsClaimed[msg.sender] = i.add(1);
                claimDividend(i);
            }
        }
    }

recycleDividend keyboard_arrow_up

Parameters help

Name Type
dividendId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function recycleDividend(uint256 dividendId) public onlyOwner returns (bool success) {
        if (dividends.length.sub(1) < dividendId) {
            return false;
        }

        Dividend storage dividend = dividends[dividendId];

        if (dividend.recycled) {
            return false;
        }

        dividend.recycled = true;

        return true;
    }

refundUnclaimedEthers keyboard_arrow_up

Parameters help

Name Type
dividendId
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function refundUnclaimedEthers(uint256 dividendId) public onlyOwner returns (bool success) {
        if ((dividends.length).sub(1) < dividendId) {
            return false;
        }

        Dividend storage dividend = dividends[dividendId];

        if (dividend.recycled == false) {
            if (now < (dividend.time).add(dividend.recycleTime)) {
                return false;
            }
        }

        uint256 claimedBackAmount = (dividend.amount).sub(dividend.claimedAmount);

        dividend.transferedBack = claimedBackAmount;

        if (claimedBackAmount > 0) {
            owner.transfer(claimedBackAmount);

            UnclaimedDividendTransfer(dividendId, claimedBackAmount);

            return true;
        }

        return false;
    }

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
    function() public payable {
        bool status = buy(msg.sender, now, msg.value);

        require(status == true);
    }

getIcoTokensAmount keyboard_arrow_up

Parameters help

Name Type
_collectedEthers
uint256 help
value
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
    function getIcoTokensAmount(uint256 _collectedEthers, uint256 value) public  constant returns (uint256) {
        uint256 amount;

        uint256 newCollectedEthers = _collectedEthers;
        uint256 remainingValue = value;
        
        for (uint i = 0; i < phases.length; i++) {
            Phase storage phase = phases[i];

            if (phase.maxAmount > newCollectedEthers) {
                if (newCollectedEthers.add(remainingValue) > phase.maxAmount) {
                    uint256 diff = phase.maxAmount.sub(newCollectedEthers);

                    amount = amount.add(diff.mul(1 ether).div(phase.price));

                    remainingValue = remainingValue.sub(diff);
                    newCollectedEthers = newCollectedEthers.add(diff);
                } else {
                    amount += remainingValue * 1 ether / phase.price;

                    newCollectedEthers += remainingValue;

                    remainingValue = 0;
                }
            }

            if (remainingValue == 0) {
                break;
            }
        }
        
        if (remainingValue > 0) {
            return 0;
        }

        return amount;
    }

setMigrateAddress keyboard_arrow_up

Parameters help

Name Type
_address
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setMigrateAddress(address _address) public onlyOwner {
        migrateAddress = _address;
    }

transferEthers keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function transferEthers() public onlyOwner {
        owner.transfer(this.balance);
    }

setLocked keyboard_arrow_up

Parameters help

Name Type
_locked
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setLocked(bool _locked) public onlyOwner {
        locked = _locked;
    }

setIcoDates keyboard_arrow_up

Parameters help

Name Type
_icoSince
uint256 help
_icoTill
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setIcoDates(uint256 _icoSince, uint256 _icoTill) public onlyOwner {
        icoSince = _icoSince;
        icoTill = _icoTill;
    }

setMigratedBalance keyboard_arrow_up

Parameters help

Name Type
_holderAddress
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

UNKNOWN VALUE must be greater than or equal to 0
Source Code
    function setMigratedBalance(address _holderAddress, uint256 _value) public onlyMigrate {
        require(balanceOf[this].sub(_value) >= 0);
        setBalance(_holderAddress, _value);
        setBalance(this, balanceOf[this].sub(_value));
        Transfer(this, _holderAddress, _value);
    }