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
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 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;
}
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 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;
}
approve keyboard_arrow_up
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;
}
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) {
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
Modifiers help
onlyOwner checks for the following:
Requirements help
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
Modifiers help
onlyOwner checks for the following:
Source Code
function freezeTransfersUntil(uint256 _frozenUntilBlock, string _reason)
onlyOwner
{
tokenFrozenUntilBlock = _frozenUntilBlock;
TokenFrozen(_frozenUntilBlock, _reason);
}
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.