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 token and operates on the Ethereum platform. CRYPTO20 has a current supply of 40,656,081.98 with 40,355,202.559 in circulation. The last known price of CRYPTO20 is $0.708856 USD and is up 3.90% over the last 24 hours. It is currently trading on 4 active market(s) with $108.86 traded over the last 24 hours. More information can be found at https://crypto20.com/.
Stats
Public Functions
29
Event Types
10
Code Size
17,419 bytes
Events (10) keyboard_arrow_up
Structs (2) keyboard_arrow_up
Functions
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Modifiers help
isTradeable checks for the following:
One or more of the following:
-
vestingContract
must be equal to
the sender's address
- OR
fundWallet
must be equal to
the sender's address
- ORtradeable must be true
Requirements help
Source Code
function transfer(address _to, uint256 _value) isTradeable returns (bool success) {
return super.transfer(_to, _value);
}
transferFrom keyboard_arrow_up
Modifiers help
isTradeable checks for the following:
One or more of the following:
-
vestingContract
must be equal to
the sender's address
- OR
fundWallet
must be equal to
the sender's address
- ORtradeable must be true
Requirements help
Source Code
function transferFrom(address _from, address _to, uint256 _value) isTradeable returns (bool success) {
return super.transferFrom(_from, _to, _value);
}
approve keyboard_arrow_up
Modifiers help
onlyPayloadSize checks for the following:
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;
}
allowance keyboard_arrow_up
changeApproval keyboard_arrow_up
Modifiers help
onlyPayloadSize checks for the following:
Requirements 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
Modifiers help
onlyFundWallet checks for the following:
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
Modifiers help
onlyManagingWallets checks for the following:
One or more of the following:
-
fundWallet
must be equal to
the sender's address
- OR
controlWallet
must be equal to
the sender's address
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
Modifiers help
onlyFundWallet checks for the following:
Requirements help
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
Modifiers help
onlyFundWallet checks for the following:
Requirements help
vestingSet must be true
Source Code
function allocatePresaleTokens(address participant, uint 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
Modifiers help
onlyManagingWallets checks for the following:
One or more of the following:
-
fundWallet
must be equal to
the sender's address
- OR
controlWallet
must be equal to
the sender's address
Source Code
function verifyParticipant(address participant) external onlyManagingWallets {
whitelist[participant] = true;
Whitelist(participant);
}
buy keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
vestingSet must be true
Source Code
function buy() external payable {
buyTo(msg.sender);
}
buyTo keyboard_arrow_up
Modifiers help
onlyWhitelist checks for the following:
Requirements help
vestingSet must be true
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.
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
Modifiers help
isTradeable checks for the following:
One or more of the following:
-
vestingContract
must be equal to
the sender's address
- OR
fundWallet
must be equal to
the sender's address
- ORtradeable must be true
onlyWhitelist checks for the following:
Requirements help
amountTokensToWithdraw
must be less than or equal to
the result of calling balanceOf with participant
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.
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
Requirements help
amountTokensToWithdraw
must be less than or equal to
the result of calling balanceOf with the sender's address
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.
Modifiers help
onlyManagingWallets checks for the following:
One or more of the following:
-
fundWallet
must be equal to
the sender's address
- OR
controlWallet
must be equal to
the sender's address
Source Code
function addLiquidity() external onlyManagingWallets payable {
require(msg.value > 0);
AddLiquidity(msg.value);
}
removeLiquidity keyboard_arrow_up
Modifiers help
onlyManagingWallets checks for the following:
One or more of the following:
-
fundWallet
must be equal to
the sender's address
- OR
controlWallet
must be equal to
the sender's address
Requirements help
Source Code
function removeLiquidity(uint256 amount) external onlyManagingWallets {
require(amount <= this.balance);
fundWallet.transfer(amount);
RemoveLiquidity(amount);
}
changeFundWallet keyboard_arrow_up
changeControlWallet keyboard_arrow_up
changeWaitTime keyboard_arrow_up
Modifiers help
onlyFundWallet checks for the following:
Source Code
function changeWaitTime(uint256 newWaitTime) external onlyFundWallet {
waitTime = newWaitTime;
}
updateFundingStartBlock keyboard_arrow_up
Modifiers help
onlyFundWallet checks for the following:
Requirements help
Source Code
function updateFundingStartBlock(uint256 newFundingStartBlock) external onlyFundWallet {
require(block.number < fundingStartBlock);
require(block.number < newFundingStartBlock);
fundingStartBlock = newFundingStartBlock;
}
updateFundingEndBlock keyboard_arrow_up
halt keyboard_arrow_up
unhalt keyboard_arrow_up
enableTrading keyboard_arrow_up
constructor keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
vestingSet must be true
Source Code
function() payable {
require(tx.origin == msg.sender);
buyTo(msg.sender);
}