Blockwell

SunContract

ERC20

This contract is an ERC20 token.

Name SunContract
Symbol SNC
Decimals 18
Total Supply 122,707,503 SNC

About link description

SunContract (SNC) is a cryptocurrency and operates on the Ethereum platform. SunContract has a current supply of 122,707,502.69296218. The last known price of SunContract is 0.025237 USD and is up 10.02 over the last 24 hours. It is currently trading on 9 active market(s) with $322,601.98 traded over the last 24 hours. More information can be found at https://suncontract.org/.

Stats

Public Functions 12
Event Types 5
Code Size 8,828 bytes

Events (5) keyboard_arrow_up

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Burn Event

Parameters help
_from
address help
_value
uint256 help

Mint Event

Parameters help
_to
address help
_value
uint256 help

TokenFrozen Event

Parameters help
_frozenUntilBlock
uint256 help
_reason
string help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

standard Variable

string help

name Variable

string help

symbol Variable

string help

decimals Variable

uint8 help

icoContractAddress Variable

address help

tokenFrozenUntilBlock Variable

uint256 help

owner Variable

address help

supply Variable

uint256 help
Internal Variable

balances Variable

mapping(address => uint256) help
Internal Variable

allowances Variable

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

restrictedAddresses Variable

mapping(address => bool) help
Internal Variable

Functions Expand All Collapse All

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;
}

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help constant
Source Code
function totalSupply() constant returns (uint256 totalSupply) {
  return supply;
}

Parameters help

Name Type
_owner
address help

Properties

Visibility help public
Mutability help constant
Source Code
function balanceOf(address _owner) constant returns (uint256 balance) {
  return balances[_owner];
}

Parameters help

Name Type
_to
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function transfer(address _to, uint256 _value) returns (bool success) {
  if (block.number < tokenFrozenUntilBlock) throw; // Throw if token is frozen
  if (restrictedAddresses[_to]) throw; // Throw if recipient is restricted address
  if (balances[msg.sender] < _value) throw; // Throw if sender has insufficient balance
  if (balances[_to] + _value < balances[_to]) throw; // Throw if owerflow detected
  balances[msg.sender] -= _value; // Deduct senders balance
  balances[_to] += _value; // Add recivers blaance
  Transfer(msg.sender, _to, _value); // Raise Transfer event
  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 (block.number < tokenFrozenUntilBlock) throw; // Throw if token is frozen
  if (restrictedAddresses[_to]) throw; // Throw if recipient is restricted address
  if (balances[_from] < _value) throw; // Throw if sender does not have enough balance
  if (balances[_to] + _value < balances[_to]) throw; // Throw if overflow detected
  if (_value > allowances[_from][msg.sender]) throw; // Throw if you do not have allowance
  balances[_from] -= _value; // Deduct senders balance
  balances[_to] += _value; // Add recipient blaance
  allowances[_from][msg.sender] -= _value; // Deduct allowance for this address
  Transfer(_from, _to, _value); // Raise Transfer event
  return true;
}

Parameters help

Name Type
_spender
address help
_value
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
function approve(address _spender, uint256 _value) returns (bool success) {
  if (block.number < tokenFrozenUntilBlock) throw; // Throw if token is frozen
  allowances[msg.sender][_spender] = _value; // Set allowance
  Approval(msg.sender, _spender, _value); // Raise Approval event
  return true;
}

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help constant
Source Code
function allowance(address _owner, address _spender)
  constant
  returns (uint256 remaining)
{
  return allowances[_owner][_spender];
}

approveAndCall keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_value
uint256 help
_extraData
bytes help

Properties

Visibility help public
Mutability help transaction

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

Parameters help

Name Type
_to
address help
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function mintTokens(address _to, uint256 _amount) {
  if (msg.sender != icoContractAddress) throw; // Only ICO address can mint tokens
  if (restrictedAddresses[_to]) throw; // Throw if user wants to send to restricted address
  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
}

burnTokens keyboard_arrow_up

Parameters help

Name Type
_amount
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
function burnTokens(uint256 _amount) onlyOwner {
  if (balances[msg.sender] < _amount) throw; // Throw if you do not have enough balance
  if (supply < _amount) throw; // Throw if overflow detected

  supply -= _amount; // Deduct totalSupply
  balances[msg.sender] -= _amount; // Destroy coins on senders wallet
  Burn(msg.sender, _amount); // Raise Burn event
  Transfer(msg.sender, 0x0, _amount); // Raise transfer to 0x0
}

freezeTransfersUntil keyboard_arrow_up

Parameters help

Name Type
_frozenUntilBlock
uint256 help
_reason
string help

Properties

Visibility help public
Mutability help transaction
Source Code
function freezeTransfersUntil(uint256 _frozenUntilBlock, string _reason)
  onlyOwner
{
  tokenFrozenUntilBlock = _frozenUntilBlock;
  TokenFrozen(_frozenUntilBlock, _reason);
}

isRestrictedAddress keyboard_arrow_up

Parameters help

Name Type
_querryAddress
address help

Properties

Visibility help public
Mutability help constant
Source Code
function isRestrictedAddress(address _querryAddress)
  constant
  returns (bool answer)
{
  return restrictedAddresses[_querryAddress];
}

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.