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
State Variables (16) keyboard_arrow_up
Functions
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
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;
}
transferFrom keyboard_arrow_up
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;
}
approve keyboard_arrow_up
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;
}
allowance keyboard_arrow_up
transferOwnership keyboard_arrow_up
startIncentiveDistribution keyboard_arrow_up
Parameters help
This function has no parameters.
Modifiers help
onlyOwner checks for the following:
Source Code
function startIncentiveDistribution() onlyOwner returns (bool success) {
if (!incentiveDistributionStarted) {
incentiveDistributionDate = now + incentiveDistributionInterval;
incentiveDistributionStarted = true;
}
return incentiveDistributionStarted;
}
withdrawIncentives keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
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++;
}
unlock keyboard_arrow_up
issue keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
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;
}
Internal Functions
Internal functions are parts of the contract that can't be used directly, but instead are used by the public functions listed above.