ERC20
This contract is an ERC20 token.
Name
Cofoundit
Symbol
CFI
Decimals
18
Total Supply
500,000,000 CFI
About
Stats
Public Functions
13
Event Types
4
Code Size
9,181 bytes
Events (4) keyboard_arrow_up
State Variables (11) keyboard_arrow_up
Functions
transferOwnership keyboard_arrow_up
totalSupply keyboard_arrow_up
balanceOf keyboard_arrow_up
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address _to, uint256 _value) returns (bool success) {
if (block.number < tokenFrozenUntilBlock) throw; // Throw is token is frozen in case of emergency
if (restrictedAddresses[_to]) throw; // Prevent transfer to restricted addresses
if (balances[msg.sender] < _value) throw; // Check if the sender has enough
if (balances[_to] + _value < balances[_to]) throw; // Check for overflows
balances[msg.sender] -= _value; // Subtract from the sender
balances[_to] += _value; // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
return true;
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) returns (bool success) {
if (block.number < tokenFrozenUntilBlock) throw; // Throw is token is frozen in case of emergency
if (restrictedAddresses[_to]) throw; // Prevent transfer to restricted addresses
if (balances[_from] < _value) throw; // Check if the sender has enough
if (balances[_to] + _value < balances[_to]) throw; // Check for overflows
if (_value > allowances[_from][msg.sender]) throw; // Check allowance
balances[_from] -= _value; // Subtract from the sender
balances[_to] += _value; // Add the same to the recipient
allowances[_from][msg.sender] -= _value; // Deduct allowance for this address
Transfer(_from, _to, _value); // Notify anyone listening that this transfer took place
return true;
}
approve keyboard_arrow_up
Requirements help
Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
if (block.number < tokenFrozenUntilBlock) throw; // Throw is token is frozen in case of emergency
allowances[msg.sender][_spender] = _value; // Set allowance
Approval(msg.sender, _spender, _value); // Raise Approval event
return true;
}
allowance keyboard_arrow_up
approveAndCall keyboard_arrow_up
Requirements help
Source Code
function approveAndCall(
address _spender,
uint256 _value,
bytes _extraData
) returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender); // Cast spender to tokenRecipient contract
approve(_spender, _value); // Set approval to contract for _value
spender.receiveApproval(msg.sender, _value, this, _extraData); // Raise method on _spender contract
return true;
}
mintTokens keyboard_arrow_up
Requirements help
Source Code
function mintTokens(
address _to,
uint256 _amount,
string _reason
) {
if (msg.sender != icoContractAddress) throw; // Check if minter is ico Contract address
if (restrictedAddresses[_to]) throw; // Prevent transfer to restricted addresses
if (_amount == 0 || sha3(_reason) == sha3("")) throw; // Check if values are not null;
if (balances[_to] + _amount < balances[_to]) throw; // Check for overflows
supply += _amount; // Update total supply
balances[_to] += _amount; // Set minted coins to target
Mint(_to, _amount); // Create Mint event
Transfer(0x0, _to, _amount); // Create Transfer event from 0x
}
freezeTransfersUntil keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function freezeTransfersUntil(uint256 _frozenUntilBlock, string _reason)
onlyOwner
{
tokenFrozenUntilBlock = _frozenUntilBlock;
TokenFrozen(_frozenUntilBlock, _reason);
}
editRestrictedAddress keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function editRestrictedAddress(address _newRestrictedAddress) onlyOwner {
restrictedAddresses[_newRestrictedAddress] = !restrictedAddresses[
_newRestrictedAddress
];
}
isRestrictedAddress keyboard_arrow_up
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.