Blockwell

SwftCoin

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

Events (2) keyboard_arrow_up

FrozenFunds Event

Parameters help
target
address help
frozen
bool help

Transfer Event

Parameters help
from
address help
to
address help
value
uint256 help

sellPrice Variable

uint256 help

buyPrice Variable

uint256 help

owner Variable

address help

standard Variable

string help

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

totalSupply Variable

uint256 help

frozenAccount Variable

mapping(address => bool) help

balanceOf Variable

mapping(address => uint256) help

allowance Variable

mapping(address => mapping(address => uint256)) help
Internal Variable

Functions Expand All Collapse All

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) {
  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
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
  allowance[msg.sender][_spender] = _value;
  return true;
}

approveAndCall keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction
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;
  }
}

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
) 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

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
function() {
  throw; // Prevents accidental sending of ether
}

transferOwnership keyboard_arrow_up

Parameters help

Name Type
newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
function transferOwnership(address newOwner) onlyOwner {
  owner = newOwner;
}

mintToken keyboard_arrow_up

Parameters help

Name Type
target
address help
mintedAmount
uint256 help

Properties

Visibility help public
Mutability help transaction
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

Parameters help

Name Type
target
address help
freeze
bool help

Properties

Visibility help public
Mutability help transaction
Source Code
function freezeAccount(address target, bool freeze) onlyOwner {
  frozenAccount[target] = freeze;
  FrozenFunds(target, freeze);
}

setPrices keyboard_arrow_up

Parameters help

Name Type
newSellPrice
uint256 help
newBuyPrice
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner {
  sellPrice = newSellPrice;
  buyPrice = newBuyPrice;
}

buy keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
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

Parameters help

Name Type
amount
uint256 help

Properties

Visibility help public
Mutability help transaction
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 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.