ERC20
This contract is an ERC20 token.
Name
SwftCoin
Symbol
SWFTC
Decimals
8
Total Supply
10,000,000,000 SWFTC
About link description
SwftCoin (SWFTC) is a cryptocurrency and operates on the Ethereum platform. SwftCoin has a current supply of 10,000,000,000 with 4,004,999,999 in circulation. The last known price of SwftCoin is 0.00131581 USD and is down -2.84 over the last 24 hours. It is currently trading on 22 active market(s) with $2,712,978.50 traded over the last 24 hours. More information can be found at http://www.swft.pro/.
Stats
Public Functions
11
Event Types
2
Code Size
7,718 bytes
State Variables (11) keyboard_arrow_up
Functions
transfer keyboard_arrow_up
Requirements help
Source Code
function transfer(address _to, uint256 _value) {
if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
if (frozenAccount[msg.sender]) throw; // Check if frozen
balanceOf[msg.sender] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
Transfer(msg.sender, _to, _value); // Notify anyone listening that this transfer took place
}
approve keyboard_arrow_up
approveAndCall keyboard_arrow_up
Source Code
function approveAndCall(
address _spender,
uint256 _value,
bytes _extraData
) returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
transferFrom keyboard_arrow_up
Requirements help
Source Code
function transferFrom(
address _from,
address _to,
uint256 _value
) returns (bool success) {
if (frozenAccount[_from]) throw; // Check if frozen
if (balanceOf[_from] < _value) throw; // Check if the sender has enough
if (balanceOf[_to] + _value < balanceOf[_to]) throw; // Check for overflows
if (_value > allowance[_from][msg.sender]) throw; // Check allowance
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
allowance[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
constructor keyboard_arrow_up
transferOwnership keyboard_arrow_up
mintToken keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function mintToken(address target, uint256 mintedAmount) onlyOwner {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
Transfer(0, this, mintedAmount);
Transfer(this, target, mintedAmount);
}
freezeAccount keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function freezeAccount(address target, bool freeze) onlyOwner {
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
}
setPrices keyboard_arrow_up
Modifiers help
onlyOwner checks for the following:
Source Code
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
buy keyboard_arrow_up
Parameters help
This function has no parameters.
Requirements help
Source Code
function buy() payable {
uint256 amount = msg.value / buyPrice; // calculates the amount
if (balanceOf[this] < amount) throw; // checks if it has enough to sell
balanceOf[msg.sender] += amount; // adds the amount to buyer's balance
balanceOf[this] -= amount; // subtracts amount from seller's balance
Transfer(this, msg.sender, amount); // execute an event reflecting the change
}
sell keyboard_arrow_up
Requirements help
Source Code
function sell(uint256 amount) {
if (balanceOf[msg.sender] < amount) throw; // checks if the sender has enough to sell
balanceOf[this] += amount; // adds the amount to owner's balance
balanceOf[msg.sender] -= amount; // subtracts the amount from seller's balance
if (!msg.sender.send(amount * sellPrice)) {
// sends ether to the seller. It's important
throw; // to do this last to avoid recursion attacks
} else {
Transfer(msg.sender, this, amount); // executes an event reflecting on the change
}
}
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.