Blockwell

Crypto20

ERC20

This contract is an ERC20 token.

Name Crypto20
Symbol C20
Decimals 18
Total Supply 40,656,082 C20

About link description

CRYPTO20 (C20) is a cryptocurrency and operates on the Ethereum platform. CRYPTO20 has a current supply of 40,656,081.98016719 with 39,951,865.79841501 in circulation. The last known price of CRYPTO20 is 2.48330118 USD and is up 2.19 over the last 24 hours. It is currently trading on 5 active market(s) with $16,888.55 traded over the last 24 hours. More information can be found at https://invictuscapital.com/en/crypto20.

Stats

Public Functions 29
Event Types 10
Code Size 17,419 bytes

Events (10) keyboard_arrow_up

AddLiquidity Event

Parameters help
ethAmount
uint256 help

AllocatePresale Event

Parameters help
participant
address help
amountTokens
uint256 help

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Buy Event

Parameters help
participant
address help
beneficiary
address help
ethValue
uint256 help
amountTokens
uint256 help

PriceUpdate Event

Parameters help
numerator
uint256 help
denominator
uint256 help

RemoveLiquidity Event

Parameters help
ethAmount
uint256 help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Whitelist Event

Parameters help
participant
address help

Withdraw Event

Parameters help
participant
address help
amountTokens
uint256 help
etherAmount
uint256 help

WithdrawRequest Event

Parameters help
participant
address help
amountTokens
uint256 help

Price Struct

Members
numerator
uint256 help
denominator
uint256 help

Withdrawal Struct

Members
tokens
uint256 help
time
uint256 help

name Variable

string help

symbol Variable

string help

decimals Variable

uint256 help

version Variable

string help

tokenCap Variable

uint256 help

fundingStartBlock Variable

uint256 help

fundingEndBlock Variable

uint256 help

vestingContract Variable

address help

fundWallet Variable

address help

controlWallet Variable

address help

waitTime Variable

uint256 help

halted Variable

bool help

tradeable Variable

bool help

previousUpdateTime Variable

uint256 help

currentPrice Variable

Price help

minAmount Variable

uint256 help

totalSupply Variable

uint256 help

whitelist Variable

mapping(address => bool) help

vestingSet Variable

bool help
Internal Variable

withdrawals Variable

mapping(address => Withdrawal) help
Internal Variable

prices Variable

mapping(uint256 => Price) 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
Source Code
function transfer(address _to, uint256 _value)
  isTradeable
  returns (bool success)
{
  return super.transfer(_to, _value);
}

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

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Requirements help

One or more of the following:
Source Code
function approve(address _spender, uint256 _value)
  onlyPayloadSize(2)
  returns (bool success)
{
  require((_value == 0) || (allowed[msg.sender][_spender] == 0));
  allowed[msg.sender][_spender] = _value;
  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];
}

changeApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_oldValue
uint256 help
_newValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Modifiers help

Source Code
function changeApproval(
  address _spender,
  uint256 _oldValue,
  uint256 _newValue
) onlyPayloadSize(3) returns (bool success) {
  require(allowed[msg.sender][_spender] == _oldValue);
  allowed[msg.sender][_spender] = _newValue;
  Approval(msg.sender, _spender, _newValue);

  return true;
}

setVestingContract keyboard_arrow_up

Parameters help

Name Type
vestingContractInput
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function setVestingContract(address vestingContractInput)
  external
  onlyFundWallet
{
  require(vestingContractInput != address(0));
  vestingContract = vestingContractInput;
  whitelist[vestingContract] = true;
  vestingSet = true;
}

updatePrice keyboard_arrow_up

Parameters help

Name Type
newNumerator
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function updatePrice(uint256 newNumerator) external onlyManagingWallets {
  require(newNumerator > 0);
  require_limited_change(newNumerator);
  // either controlWallet command is compliant or transaction came from fundWallet
  currentPrice.numerator = newNumerator;
  // maps time to new Price (if not during ICO)
  prices[previousUpdateTime] = currentPrice;
  previousUpdateTime = now;
  PriceUpdate(newNumerator, currentPrice.denominator);
}

updatePriceDenominator keyboard_arrow_up

Parameters help

Name Type
newDenominator
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function updatePriceDenominator(uint256 newDenominator)
  external
  onlyFundWallet
{
  require(block.number > fundingEndBlock);
  require(newDenominator > 0);
  currentPrice.denominator = newDenominator;
  // maps time to new Price
  prices[previousUpdateTime] = currentPrice;
  previousUpdateTime = now;
  PriceUpdate(currentPrice.numerator, newDenominator);
}

allocatePresaleTokens keyboard_arrow_up

Parameters help

Name Type
participant
address help
amountTokens
uint help

Properties

Visibility help public
Mutability help transaction
Source Code
function allocatePresaleTokens(address participant, uint256 amountTokens)
  external
  onlyFundWallet
{
  require(block.number < fundingEndBlock);
  require(participant != address(0));
  whitelist[participant] = true; // automatically whitelist accepted presale
  allocateTokens(participant, amountTokens);
  Whitelist(participant);
  AllocatePresale(participant, amountTokens);
}

verifyParticipant keyboard_arrow_up

Parameters help

Name Type
participant
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function verifyParticipant(address participant) external onlyManagingWallets {
  whitelist[participant] = true;
  Whitelist(participant);
}

buy keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
function buy() external payable {
  buyTo(msg.sender);
}

buyTo keyboard_arrow_up

Parameters help

Name Type
participant
address help

Properties

Visibility help public
Mutability help payable

Modifiers help

onlyWhitelist checks for the following:

Requirements help

Source Code
function buyTo(address participant) public payable onlyWhitelist {
  require(!halted);
  require(participant != address(0));
  require(msg.value >= minAmount);
  require(block.number >= fundingStartBlock && block.number < fundingEndBlock);
  uint256 icoDenominator = icoDenominatorPrice();
  uint256 tokensToBuy = safeMul(msg.value, currentPrice.numerator) /
    icoDenominator;
  allocateTokens(participant, tokensToBuy);
  // send ether to fundWallet
  fundWallet.transfer(msg.value);
  Buy(msg.sender, participant, msg.value, tokensToBuy);
}

icoDenominatorPrice keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function icoDenominatorPrice() public constant returns (uint256) {
  uint256 icoDuration = safeSub(block.number, fundingStartBlock);
  uint256 denominator;
  if (icoDuration < 2880) {
    // #blocks = 24*60*60/30 = 2880
    return currentPrice.denominator;
  } else if (icoDuration < 80640) {
    // #blocks = 4*7*24*60*60/30 = 80640
    denominator = safeMul(currentPrice.denominator, 105) / 100;
    return denominator;
  } else {
    denominator = safeMul(currentPrice.denominator, 110) / 100;
    return denominator;
  }
}

requestWithdrawal keyboard_arrow_up

Parameters help

Name Type
amountTokensToWithdraw
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function requestWithdrawal(uint256 amountTokensToWithdraw)
  external
  isTradeable
  onlyWhitelist
{
  require(block.number > fundingEndBlock);
  require(amountTokensToWithdraw > 0);
  address participant = msg.sender;
  require(balanceOf(participant) >= amountTokensToWithdraw);
  require(withdrawals[participant].tokens == 0); // participant cannot have outstanding withdrawals
  balances[participant] = safeSub(
    balances[participant],
    amountTokensToWithdraw
  );
  withdrawals[participant] = Withdrawal({
    tokens: amountTokensToWithdraw,
    time: previousUpdateTime
  });
  WithdrawRequest(participant, amountTokensToWithdraw);
}

withdraw keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function withdraw() external {
  address participant = msg.sender;
  uint256 tokens = withdrawals[participant].tokens;
  require(tokens > 0); // participant must have requested a withdrawal
  uint256 requestTime = withdrawals[participant].time;
  // obtain the next price that was set after the request
  Price price = prices[requestTime];
  require(price.numerator > 0); // price must have been set
  uint256 withdrawValue = safeMul(tokens, price.denominator) / price.numerator;
  // if contract ethbal > then send + transfer tokens to fundWallet, otherwise give tokens back
  withdrawals[participant].tokens = 0;
  if (this.balance >= withdrawValue)
    enact_withdrawal_greater_equal(participant, withdrawValue, tokens);
  else enact_withdrawal_less(participant, withdrawValue, tokens);
}

checkWithdrawValue keyboard_arrow_up

Parameters help

Name Type
amountTokensToWithdraw
uint256 help

Properties

Visibility help public
Mutability help constant
Source Code
function checkWithdrawValue(uint256 amountTokensToWithdraw)
  constant
  returns (uint256 etherValue)
{
  require(amountTokensToWithdraw > 0);
  require(balanceOf(msg.sender) >= amountTokensToWithdraw);
  uint256 withdrawValue = safeMul(
    amountTokensToWithdraw,
    currentPrice.denominator
  ) / currentPrice.numerator;
  require(this.balance >= withdrawValue);
  return withdrawValue;
}

addLiquidity keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
function addLiquidity() external payable onlyManagingWallets {
  require(msg.value > 0);
  AddLiquidity(msg.value);
}

removeLiquidity keyboard_arrow_up

Parameters help

Name Type
amount
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function removeLiquidity(uint256 amount) external onlyManagingWallets {
  require(amount <= this.balance);
  fundWallet.transfer(amount);
  RemoveLiquidity(amount);
}

changeFundWallet keyboard_arrow_up

Parameters help

Name Type
newFundWallet
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function changeFundWallet(address newFundWallet) external onlyFundWallet {
  require(newFundWallet != address(0));
  fundWallet = newFundWallet;
}

changeControlWallet keyboard_arrow_up

Parameters help

Name Type
newControlWallet
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function changeControlWallet(address newControlWallet) external onlyFundWallet {
  require(newControlWallet != address(0));
  controlWallet = newControlWallet;
}

changeWaitTime keyboard_arrow_up

Parameters help

Name Type
newWaitTime
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function changeWaitTime(uint256 newWaitTime) external onlyFundWallet {
  waitTime = newWaitTime;
}

updateFundingStartBlock keyboard_arrow_up

Parameters help

Name Type
newFundingStartBlock
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function updateFundingStartBlock(uint256 newFundingStartBlock)
  external
  onlyFundWallet
{
  require(block.number < fundingStartBlock);
  require(block.number < newFundingStartBlock);
  fundingStartBlock = newFundingStartBlock;
}

updateFundingEndBlock keyboard_arrow_up

Parameters help

Name Type
newFundingEndBlock
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function updateFundingEndBlock(uint256 newFundingEndBlock)
  external
  onlyFundWallet
{
  require(block.number < fundingEndBlock);
  require(block.number < newFundingEndBlock);
  fundingEndBlock = newFundingEndBlock;
}

halt keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function halt() external onlyFundWallet {
  halted = true;
}

unhalt keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function unhalt() external onlyFundWallet {
  halted = false;
}

enableTrading keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function enableTrading() external onlyFundWallet {
  require(block.number > fundingEndBlock);
  tradeable = true;
}

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable

Requirements help

Source Code
function() payable {
  require(tx.origin == msg.sender);
  buyTo(msg.sender);
}

claimTokens keyboard_arrow_up

Parameters help

Name Type
_token
address help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function claimTokens(address _token) external onlyFundWallet {
  require(_token != address(0));
  Token token = Token(_token);
  uint256 balance = token.balanceOf(this);
  token.transfer(fundWallet, balance);
}

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.

internal C20.require_limited_change keyboard_arrow_up

Parameters help

Name Type
newNumerator
uint256 help

Properties

Visibility help private
Mutability help transaction

Requirements help

Source Code
function require_limited_change(uint256 newNumerator)
  private
  only_if_controlWallet
  require_waited
  only_if_increase(newNumerator)
{
  uint256 percentage_diff = 0;
  percentage_diff = safeMul(newNumerator, 100) / currentPrice.numerator;
  percentage_diff = safeSub(percentage_diff, 100);
  // controlWallet can only increase price by max 20% and only every waitTime
  require(percentage_diff <= 20);
}

internal C20.allocateTokens keyboard_arrow_up

Parameters help

Name Type
participant
address help
amountTokens
uint256 help

Properties

Visibility help private
Mutability help transaction
Source Code
function allocateTokens(address participant, uint256 amountTokens) private {
  require(vestingSet);
  // 13% of total allocated for PR, Marketing, Team, Advisors
  uint256 developmentAllocation = safeMul(amountTokens, 14942528735632185) /
    100000000000000000;
  // check that token cap is not exceeded
  uint256 newTokens = safeAdd(amountTokens, developmentAllocation);
  require(safeAdd(totalSupply, newTokens) <= tokenCap);
  // increase token supply, assign tokens to participant
  totalSupply = safeAdd(totalSupply, newTokens);
  balances[participant] = safeAdd(balances[participant], amountTokens);
  balances[vestingContract] = safeAdd(
    balances[vestingContract],
    developmentAllocation
  );
}

internal C20.enact_withdrawal_greater_equal keyboard_arrow_up

Parameters help

Name Type
participant
address help
withdrawValue
uint256 help
tokens
uint256 help

Properties

Visibility help private
Mutability help transaction

Requirements help

Source Code
function enact_withdrawal_greater_equal(
  address participant,
  uint256 withdrawValue,
  uint256 tokens
) private {
  assert(this.balance >= withdrawValue);
  balances[fundWallet] = safeAdd(balances[fundWallet], tokens);
  participant.transfer(withdrawValue);
  Withdraw(participant, tokens, withdrawValue);
}

internal C20.enact_withdrawal_less keyboard_arrow_up

Parameters help

Name Type
participant
address help
withdrawValue
uint256 help
tokens
uint256 help

Properties

Visibility help private
Mutability help transaction

Requirements help

Source Code
function enact_withdrawal_less(
  address participant,
  uint256 withdrawValue,
  uint256 tokens
) private {
  assert(this.balance < withdrawValue);
  balances[participant] = safeAdd(balances[participant], tokens);
  Withdraw(participant, tokens, 0); // indicate a failed withdrawal
}

internal SafeMath.safeMul keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeMul(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a * b;
  assert(a == 0 || c / a == b);
  return c;
}

internal SafeMath.safeSub keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction

Requirements help

Source Code
function safeSub(uint256 a, uint256 b) internal returns (uint256) {
  assert(b <= a);
  return a - b;
}

internal SafeMath.safeAdd keyboard_arrow_up

Parameters help

Name Type
a
uint help
b
uint help

Properties

Visibility help internal
Mutability help transaction
Source Code
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
  uint256 c = a + b;
  assert(c >= a && c >= b);
  return c;
}