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 is a blockchain-based company that aims to decentralize the energy sector, with the goal of tailoring it to maximize the welfare of the common man. The company’s business model directly connects peers in an open energy marketplace, eliminating intermediaries, enabling P2P electricity trading. The SunContract platform aims to empower individuals, with an emphasis on homeowners, to freely buy, sell or trade electricity. The project is being implemented in Slovenia and plans to expand into other countries. Through the platform, Slovenian households are currently witnessing electricity cost reductions while also choosing sustainable energy sources of energy.

Stats

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

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

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

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

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

balanceOf keyboard_arrow_up

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

transfer keyboard_arrow_up

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

transferFrom keyboard_arrow_up

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

approve keyboard_arrow_up

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

allowance keyboard_arrow_up

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