Blockwell

DCORP

ERC20

This contract is an ERC20 token.

Name DCORP
Symbol DRP
Decimals 2
Total Supply 8,911,497 DRP

About

Stats

Public Functions 11
Event Types 2
Code Size 12,265 bytes

Events (2) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Incentive Struct

Members
recipient
address help
percentage
uint8 help

standard Variable

string help

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

incentiveDistributionStarted Variable

bool help

incentiveDistributionDate Variable

uint256 help

incentiveDistributionRound Variable

uint256 help

incentiveDistributionMaxRounds Variable

uint256 help

incentiveDistributionInterval Variable

uint256 help

incentiveDistributionRoundDenominator Variable

uint256 help

owner Variable

address help

locked Variable

bool help

totalSupply Variable

uint256 help

incentives Variable

Incentive[] help
Internal Variable

balances Variable

mapping(address => uint256) help
Internal Variable

allowed Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

Functions Expand All Collapse All

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];
}

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) returns (bool success) {
  // Unable to transfer while still locked
  if (locked) {
    throw;
  }

  // Check if the sender has enough tokens
  if (balances[msg.sender] < _value) {
    throw;
  }

  // Check for overflows
  if (balances[_to] + _value < balances[_to]) {
    throw;
  }

  // Transfer tokens
  balances[msg.sender] -= _value;
  balances[_to] += _value;

  // Notify listners
  Transfer(msg.sender, _to, _value);
  return true;
}

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
) returns (bool success) {
  // Unable to transfer while still locked
  if (locked) {
    throw;
  }

  // Check if the sender has enough
  if (balances[_from] < _value) {
    throw;
  }

  // Check for overflows
  if (balances[_to] + _value < balances[_to]) {
    throw;
  }

  // Check allowance
  if (_value > allowed[_from][msg.sender]) {
    throw;
  }

  // Transfer tokens
  balances[_to] += _value;
  balances[_from] -= _value;

  // Update allowance
  allowed[_from][msg.sender] -= _value;

  // Notify listners
  Transfer(_from, _to, _value);
  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
  // Unable to approve while still locked
  if (locked) {
    throw;
  }

  // Update allowance
  allowed[msg.sender][_spender] = _value;

  // Notify listners
  Approval(msg.sender, _spender, _value);
  return true;
}

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];
}

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferOwnership(address _newOwner) onlyOwner {
  owner = _newOwner;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function startIncentiveDistribution() onlyOwner returns (bool success) {
  if (!incentiveDistributionStarted) {
    incentiveDistributionDate = now + incentiveDistributionInterval;
    incentiveDistributionStarted = true;
  }

  return incentiveDistributionStarted;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function withdrawIncentives() {
  // Crowdsale triggers incentive distribution
  if (!incentiveDistributionStarted) {
    throw;
  }

  // Enforce max distribution rounds
  if (incentiveDistributionRound > incentiveDistributionMaxRounds) {
    throw;
  }

  // Enforce time interval
  if (now < incentiveDistributionDate) {
    throw;
  }

  uint256 totalSupplyToDate = totalSupply;
  uint256 denominator = 1;

  // Incentive decreased each round
  if (incentiveDistributionRound > 1) {
    denominator =
      incentiveDistributionRoundDenominator**(incentiveDistributionRound - 1);
  }

  for (uint256 i = 0; i < incentives.length; i++) {
    // totalSupplyToDate * (percentage * 10^3) / 10^3 / denominator
    uint256 amount = (totalSupplyToDate * incentives[i].percentage) /
      10**3 /
      denominator;
    address recipient = incentives[i].recipient;

    // Create tokens
    balances[recipient] += amount;
    totalSupply += amount;

    // Notify listners
    Transfer(0, this, amount);
    Transfer(this, recipient, amount);
  }

  // Next round
  incentiveDistributionDate = now + incentiveDistributionInterval;
  incentiveDistributionRound++;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unlock() onlyOwner returns (bool success) {
  locked = false;
  return true;
}

Parameters help

Name Type
_recipient
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function issue(address _recipient, uint256 _value)
  onlyOwner
  returns (bool success)
{
  // Guarantee positive
  if (_value < 0) {
    throw;
  }

  // Create tokens
  balances[_recipient] += _value;
  totalSupply += _value;

  // Notify listners
  Transfer(0, owner, _value);
  Transfer(owner, _recipient, _value);

  return true;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function() {
  throw;
}

Internal Functions Expand All Collapse All

Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.