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
State Variables (23) 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, 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
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 payable onlyManagingWallets {
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);
}
claimTokens keyboard_arrow_up
Modifiers help
onlyFundWallet checks for the following:
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
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
Modifiers help
only_if_controlWallet checks for the following:
require_waited checks for the following:
only_if_increase checks for the following:
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
Requirements help
vestingSet must be true
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
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
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
Requirements help
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
internal SafeMath.safeAdd keyboard_arrow_up
Source Code
function safeAdd(uint256 a, uint256 b) internal returns (uint256) {
uint256 c = a + b;
assert(c >= a && c >= b);
return c;
}