Blockwell

DADI

ERC20

This contract is an ERC20 token.

Name DADI
Symbol DADI
Decimals 18
Total Supply 100,000,000 DADI

About link

Edge networking describes itself as a distributed computing paradigm which aims to bring data storage and computation as close to the point of need as possible, pushing applications, data, and computing power away from centralized data centers. It was designed to reduce the volumes of data that must be moved, the consequent traffic, and the distance the data must travel, providing lower latency and reduced transmission costs. The Edge network aims to provide serverless infrastructure that is built using the spare capacity around its users. The $EDGE token enables the transfer of value from the consumers of network services to contributors to the network on a proof of work basis. The Edge network is maintained by Edge Network Technologies, a limited company registered and headquartered in London, England.

Stats

Public Functions 37
Event Types 9
Code Size 34,479 bytes

Library Use

Uses SafeMath for uint256.

Approval Event

Parameters help
owner
address help
spender
address help
value
uint256 help

LogClaimTokens Event

Parameters help
recipient
address help
tokens
uint256 help

LogFundTransfer Event

Parameters help
wallet
address help
value
uint256 help

LogRedistributeTokens Event

Parameters help
recipient
address help
state
SaleState help
tokens
uint256 help

LogRefundFailed Event

Parameters help
recipient
address help
value
uint256 help

LogRefundProcessed Event

Parameters help
recipient
address help
value
uint256 help

LogTokenPurchase Event

Parameters help
purchaser
address help
beneficiary
address help
value
uint256 help
tokens
uint256 help

OwnershipTransferred Event

Parameters help
previousOwner
address help
newOwner
address help

Transfer Event

Parameters help
from
address help
to
address 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) onlyOwner public {
    require(newOwner != address(0));
    OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

balanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
  function balanceOf(address _owner) public constant returns (uint256 balance) {
    return balances[_owner];
  }

transfer keyboard_arrow_up

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
  function transfer(address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));

    // SafeMath.sub will throw if there is not enough balance.
    balances[msg.sender] = balances[msg.sender].sub(_value);
    balances[_to] = balances[_to].add(_value);
    Transfer(msg.sender, _to, _value);
    return true;
  }

allowance keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
  function allowance(address _owner, address _spender) public constant returns (uint256 remaining) {
    return allowed[_owner][_spender];
  }

transferFrom keyboard_arrow_up

Parameters help

Name Type
_from
address help
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));

    uint256 _allowance = allowed[_from][msg.sender];

    // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
    // require (_value <= _allowance);

    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = _allowance.sub(_value);
    Transfer(_from, _to, _value);
    return 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) {
    allowed[msg.sender][_spender] = _value;
    Approval(msg.sender, _spender, _value);
    return true;
  }

increaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_addedValue
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
  function increaseApproval (address _spender, uint _addedValue)
    returns (bool success) {
    allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

decreaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_subtractedValue
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
  function decreaseApproval (address _spender, uint _subtractedValue)
    returns (bool success) {
    uint oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue > oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
    function () payable {
        require(
            state == SaleState.PartnerSale || 
            state == SaleState.PreSale || 
            state == SaleState.PublicSale
        );

        buyTokens(msg.sender, msg.value);
    }

offlineTransaction keyboard_arrow_up

Parameters help

Name Type
_recipient
address help
_tokens
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function offlineTransaction (address _recipient, uint256 _tokens) public onlyOwner returns (bool) {
        require(state == SaleState.PartnerSale);
        require(_tokens > 0);

        // Convert to a token with decimals 
        uint256 tokens = _tokens * (uint256(10) ** decimals);

        purchasedTokens[_recipient] = purchasedTokens[_recipient].add(tokens);

        // Use original _token argument to increase the count of tokens purchased in the PartnerSale
        partnerSaleTokensPurchased = partnerSaleTokensPurchased.add(_tokens);

        // Finalize the PartnerSale if necessary
        if (partnerSaleTokensPurchased >= partnerSaleTokensAvailable) {
            state = SaleState.PartnerSaleFinalized;
        }

        LogTokenPurchase(msg.sender, _recipient, 0, tokens);

        return true;
    }

updateEthRate keyboard_arrow_up

Parameters help

Name Type
rate
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function updateEthRate (uint256 rate) public onlyOwner returns (bool) {
        require(rate >= 100000);
        
        ethRate = rate;
        return true;
    }

addPartnerSaleWallet keyboard_arrow_up

Parameters help

Name Type
_wallet
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function addPartnerSaleWallet (address _wallet) public onlyOwner returns (bool) {
        require(state < SaleState.PartnerSaleFinalized);
        require(_wallet != address(0));
        partnerSaleWallets.push(_wallet);
        return true;
    }

addPreSaleWallet keyboard_arrow_up

Parameters help

Name Type
_wallet
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function addPreSaleWallet (address _wallet) public onlyOwner returns (bool) {
        require(state != SaleState.PreSale);
        require(_wallet != address(0));
        preSaleWallets.push(_wallet);
        return true;
    }

addPublicSaleWallet keyboard_arrow_up

Parameters help

Name Type
_wallet
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function addPublicSaleWallet (address _wallet) public onlyOwner returns (bool) {
        require(state != SaleState.PublicSale);
        require(_wallet != address(0));
        publicSaleWallets.push(_wallet);
        return true;
    }

calculateTokens keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function calculateTokens (uint256 _amount) public returns (uint256 tokens) {
        if (isStatePartnerSale()) {
            tokens = _amount * ethRate / partnerSaleTokenPrice;
        } else if (isStatePreSale()) {
            tokens = _amount * ethRate / preSaleTokenPrice;
        } else if (isStatePublicSale()) {
            tokens = _amount * ethRate / publicSaleTokenPrice;
        } else {
            tokens = 0;
        }

        return tokens;
    }

setPhase keyboard_arrow_up

Parameters help

Name Type
phase
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function setPhase (uint256 phase) public onlyOwner {
        state = SaleState(uint(phase));
    }

startPartnerSale keyboard_arrow_up

Parameters help

Name Type
rate
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function startPartnerSale (uint256 rate) public onlyOwner {
        state = SaleState.PartnerSale;
        updateEthRate(rate);
    }

startPreSale keyboard_arrow_up

Parameters help

Name Type
rate
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function startPreSale (uint256 rate) public onlyOwner {
        state = SaleState.PreSale;
        updateEthRate(rate);
    }

startPublicSale keyboard_arrow_up

Parameters help

Name Type
rate
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function startPublicSale (uint256 rate) public onlyOwner {
        state = SaleState.PublicSale;
        updateEthRate(rate);
    }

finalizePartnerSale keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function finalizePartnerSale () public onlyOwner {
        require(state == SaleState.PartnerSale);
        
        state = SaleState.PartnerSaleFinalized;
    }

finalizePreSale keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function finalizePreSale () public onlyOwner {
        require(state == SaleState.PreSale);
        
        state = SaleState.PreSaleFinalized;
    }

finalizePublicSale keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function finalizePublicSale () public onlyOwner {
        require(state == SaleState.PublicSale);
        
        state = SaleState.PublicSaleFinalized;
    }

finalizeIco keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function finalizeIco () public onlyOwner {
        require(state == SaleState.PublicSaleFinalized);

        state = SaleState.Success;

        // 2.5% of total goes to DADI ecosystem
        distribute(ecosystemWallet, ecosystemPercentOfTotal);

        // 2.5% of total goes to DADI+ operations
        distribute(operationsWallet, operationsPercentOfTotal);

        // 5% of total goes to referral programme
        distribute(referralProgrammeWallet, referralPercentOfTotal);
        
        // 20% of total goes to the founding team wallets
        distributeFoundingTeamTokens(foundingTeamWallets);

        // redistribute unsold tokens to DADI ecosystem
        uint256 remainingPreSaleTokens = getPreSaleTokensAvailable();
        preSaleTokensAvailable = 0;
        
        uint256 remainingPublicSaleTokens = getPublicSaleTokensAvailable();
        publicSaleTokensAvailable = 0;

        // we need to represent the tokens with included decimals
        // `2640 ** (10 ^ 18)` not `2640`
        if (remainingPreSaleTokens > 0) {
            remainingPreSaleTokens = remainingPreSaleTokens * (uint256(10) ** decimals);
            balances[owner] = balances[owner].sub(remainingPreSaleTokens);
            balances[ecosystemWallet] = balances[ecosystemWallet].add(remainingPreSaleTokens);
            Transfer(0, ecosystemWallet, remainingPreSaleTokens);
        }

        if (remainingPublicSaleTokens > 0) {
            remainingPublicSaleTokens = remainingPublicSaleTokens * (uint256(10) ** decimals);
            balances[owner] = balances[owner].sub(remainingPublicSaleTokens);
            balances[ecosystemWallet] = balances[ecosystemWallet].add(remainingPublicSaleTokens);
            Transfer(0, ecosystemWallet, remainingPublicSaleTokens);
        }

        // Transfer ETH to the funding wallet.
        if (!fundsWallet.send(this.balance)) {
            revert();
        }
    }

closeIco keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function closeIco () public onlyOwner {
        state = SaleState.Closed;
    }

claimTokens keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function claimTokens () public returns (bool) {
        require(state == SaleState.Success);
        
        // get the tokens available for the sender
        uint256 tokens = purchasedTokens[msg.sender];
        require(tokens > 0);

        purchasedTokens[msg.sender] = 0;

        balances[owner] = balances[owner].sub(tokens);
        balances[msg.sender] = balances[msg.sender].add(tokens);
      
        LogClaimTokens(msg.sender, tokens);
        Transfer(owner, msg.sender, tokens);
        return true;
    }

refund keyboard_arrow_up

Parameters help

Name Type
_recipient
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function refund (address _recipient) public onlyOwner returns (bool) {
        require(state == SaleState.Refunding);

        uint256 value = partnerSaleWei[_recipient];
        
        require(value > 0);

        partnerSaleWei[_recipient] = 0;

        if(!_recipient.send(value)) {
            partnerSaleWei[_recipient] = value;
            LogRefundFailed(_recipient, value);
        }

        LogRefundProcessed(_recipient, value);
        return true;
    }

withdrawFunds keyboard_arrow_up

Parameters help

Name Type
_address
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function withdrawFunds (address _address, uint256 _amount) public onlyOwner {
        _address.transfer(_amount);
    }

getRandom keyboard_arrow_up

Parameters help

Name Type
max
uint help

Properties

Visibility help public
Mutability help constant
Source Code
    function getRandom(uint max) public constant returns (uint randomNumber) {
        return (uint(sha3(block.blockhash(block.number - 1))) % max) + 1;
    }

setRefunding keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function setRefunding () public onlyOwner {
        require(state == SaleState.PartnerSaleFinalized);
        
        state = SaleState.Refunding;
    }

isSuccessful keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function isSuccessful () public constant returns (bool) {
        return state == SaleState.Success;
    }

getPreSaleTokensAvailable keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function getPreSaleTokensAvailable () public constant returns (uint256) {
        if (preSaleTokensAvailable == 0) {
            return 0;
        }

        return preSaleTokensAvailable - preSaleTokensPurchased;
    }

getPublicSaleTokensAvailable keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function getPublicSaleTokensAvailable () public constant returns (uint256) {
        if (publicSaleTokensAvailable == 0) {
            return 0;
        }

        return publicSaleTokensAvailable - publicSaleTokensPurchased;
    }

getTokensPurchased keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function getTokensPurchased () public constant returns (uint256) {
        return partnerSaleTokensPurchased + preSaleTokensPurchased + publicSaleTokensPurchased;
    }

getTotalRaised keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function getTotalRaised () public constant returns (uint256) {
        return preSaleRaised + publicSaleRaised;
    }

getBalance keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function getBalance () public constant returns (uint256) {
        return this.balance;
    }

getFundsWalletBalance keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function getFundsWalletBalance () public constant onlyOwner returns (uint256) {
        return fundsWallet.balance;
    }

getInvestorCount keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
    function getInvestorCount () public constant returns (uint256) {
        return investorCount;
    }