Blockwell

Divi Exchange Token

ERC20

This contract is an ERC20 token.

Name Divi Exchange Token
Symbol DIVX
Decimals 18
Total Supply 6,171,607 DIVX

About

Stats

Public Functions 13
Event Types 5
Code Size 11,184 bytes

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

LogCreate Event

Parameters help
_to
address help
_value
uint256 help
_tokenValue
uint256 help

LogRedeem Event

Parameters help
_to
address help
_value
uint256 help
_diviAddress
bytes32 help

LogRefund Event

Parameters help
_to
address help
_value
uint256 help
_tokenValue
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Functions Expand All Collapse All

balanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
    function balanceOf(address _owner) 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
Source Code
    function transfer(address _to, uint256 _value) returns (bool success) {
      require(totalReceivedWei >= receivedWeiMin);
      return super.transfer(_to, _value);
    }

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) returns (bool success) {
      require(totalReceivedWei >= receivedWeiMin);
      return super.transferFrom(_from, _to, _value);
    }

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) returns (bool success) {
        allowed[msg.sender][_spender] = _value;
        Approval(msg.sender, _spender, _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) constant returns (uint256 remaining) {
      return allowed[_owner][_spender];
    }

createTokens keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Modifiers help

Source Code
    function createTokens() payable external isNotPaused {
      require(block.number >= fundingStartBlock);
      require(block.number <= fundingEndBlock);
      require(msg.value > 0);

      // Check that this transaction wouldn't exceed the ETH cap
      uint256 checkedReceivedWei = safeAdd(totalReceivedWei, msg.value);
      require(checkedReceivedWei <= receivedWeiCap);

      // Calculate how many tokens (in units of Wei) should be awarded
      // on this transaction
      uint256 tokens = safeMult(msg.value, getCurrentTokenPrice());

      // Calculate how many tokens (in units of Wei) should be awarded to the project (20%)
      uint256 projectTokens = safeDiv(tokens, 5);

      // Increment the total received ETH
      totalReceivedWei = checkedReceivedWei;

      // Only update our accounting of how much ETH this contributor has sent us if
      // we're already on the public sale (since private sale contributions are going
      // to be used before the end of end of the sale period, they don't get a refund)
      if (block.number >= firstXRChangeBlock) weiBalances[msg.sender] += msg.value;

      // Increment the total supply of tokens and then deposit the tokens
      // to the contributor
      totalSupply = safeAdd(totalSupply, tokens);
      balances[msg.sender] += tokens;

      // Increment the total supply of tokens and then deposit the tokens
      // to the project
      totalSupply = safeAdd(totalSupply, projectTokens);
      balances[fundDeposit] += projectTokens;

      LogCreate(msg.sender, msg.value, tokens);  // logs token creation
    }

withdrawWei keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
    function withdrawWei(uint256 _value) external onlyOwner isNotPaused {
      require(_value <= this.balance);

      // Allow withdrawal during the private sale, but after that, only allow
      // withdrawal if we already met the minimum
      require((block.number < firstXRChangeBlock) || (totalReceivedWei >= receivedWeiMin));

      // send the eth to the project multisig wallet
      fundDeposit.transfer(_value);
    }

pause keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function pause() external onlyOwner isNotPaused {
      // Move the contract to Paused state
      isPaused = true;
    }

resume keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function resume() external onlyOwner {
      // Move the contract out of the Paused state
      isPaused = false;
    }

startRedeeming keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function startRedeeming() external onlyOwner isNotPaused {
      // Move the contract to Redeeming state
      isRedeeming = true;
    }

stopRedeeming keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function stopRedeeming() external onlyOwner isNotPaused {
      // Move the contract out of the Redeeming state
      isRedeeming = false;
    }

refund keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function refund() external {
      // prevents refund until sale period is over
      require(block.number > fundingEndBlock);
      // Refunds are only available if the minimum was not reached
      require(totalReceivedWei < receivedWeiMin);

      // Retrieve how much DIVX (in units of Wei) this account has
       uint256 divxVal = balances[msg.sender];
       require(divxVal > 0);

      // Retrieve how much ETH (in units of Wei) this account contributed
      uint256 weiVal = weiBalances[msg.sender];
      require(weiVal > 0);

      // Destroy this contributor's tokens and reduce the total supply
      balances[msg.sender] = 0;
      totalSupply = safeSubtract(totalSupply, divxVal);

      // Log this refund operation
      LogRefund(msg.sender, weiVal, divxVal);

      // Send the money back
      msg.sender.transfer(weiVal);
    }

redeem keyboard_arrow_up

Parameters help

Name Type
diviAddress
bytes32 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function redeem(bytes32 diviAddress) external {
      // Only allow this function to be called when on the redeeming state
      require(isRedeeming);

      // Retrieve how much DIVX (in units of Wei) this account has
      uint256 divxVal = balances[msg.sender];
       require(divxVal > 0);

      // Move the tokens of the caller to the project's address
      assert(super.transfer(fundDeposit, divxVal));

      // Log the redeeming of this tokens
      LogRedeem(msg.sender, divxVal, diviAddress);
    }