Blockwell

PlatonCoin

ERC20

This contract is an ERC20 token.

Name PlatonCoin
Symbol PLTC
Decimals 18
Total Supply 21,000,000 PLTC

About

Stats

Public Functions 16
Event Types 5
Code Size 12,605 bytes

Library Use

Uses SafeMath for uint256.

Approval Event

Parameters help
_owner
address help
_spender
address help
_value
uint256 help

Burn Event

Parameters help
_burner
address help
_value
uint256 help

OwnershipRenounced Event

Parameters help
_previousOwner
address help

OwnershipTransferred Event

Parameters help
_previousOwner
address help
_newOwner
address help

Transfer Event

Parameters help
_from
address help
_to
address help
_value
uint256 help

Functions Expand All Collapse All

totalSupply keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help view
Source Code
     function totalSupply() public view returns(uint256 _totalSupply) 
     {
        _totalSupply = totalTokenSupply;
        return _totalSupply;
     }

balanceOf keyboard_arrow_up

Parameters help

Name Type
_owner
address help

Properties

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

transfer keyboard_arrow_up

Parameters help

Name Type
_address
address help
_tokens
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transfer(address _address, uint256 _tokens) public returns(bool)
    {
       require(!stopped);

       if (_tokens == 0) 
       {
           emit Transfer(msg.sender, _address, _tokens);  // Follow the spec to launch the event when tokens are equal to 0
           return true;
       }

       require(_address != address(0x0));
       require(balances[msg.sender] >= _tokens);

       balances[msg.sender] = (balances[msg.sender]).sub(_tokens);
       balances[_address] = (balances[_address]).add(_tokens);

       emit Transfer(msg.sender, _address, _tokens);
       return true;
    }

allowance keyboard_arrow_up

Parameters help

Name Type
_owner
address help
_spender
address help

Properties

Visibility help public
Mutability help view
Source Code
    function allowance(address _owner, address _spender) public view returns(uint256)
    {
       require(!stopped);
       require(_owner != address(0x0) && _spender != address(0x0));

       return allowed[_owner][_spender];
    }

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) public returns (bool)     
    {
       require(!stopped);

       if (_value == 0) 
       {
           emit Transfer(_from, _to, _value);  // Follow the spec to launch the event when value is equal to 0
           return true;
       }

       require(_to != address(0x0));
       require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value && _value >= 0);

       balances[_from] = balances[_from].sub(_value);
       allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
       balances[_to] = balances[_to].add(_value);

       emit Transfer(_from, _to, _value);
       return true;
    }

approve keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_tokens
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
    function approve(address _spender, uint256 _tokens) public returns(bool)
    {
       require(!stopped);
       require(_spender != address(0x0));

       allowed[msg.sender][_spender] = _tokens;

       emit Approval(msg.sender, _spender, _tokens);
       return true;
    }

pauseCrowdSale keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function pauseCrowdSale() external onlyOwner
    {
        stopped = true;
    }

resumeCrowdSale keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction
Source Code
    function resumeCrowdSale() external onlyOwner
    {
        stopped = false;
    }

initWallets keyboard_arrow_up

Parameters help

Name Type
_teamWallet
address help
_advisorWallet
address help
_bountyWallet
address help
_earlyInvWallet
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function initWallets(address _teamWallet, address _advisorWallet, address _bountyWallet, address _earlyInvWallet) public onlyOwner
    {
       require(!stopped);
       require( _teamWallet != address(0x0) && _advisorWallet != address(0x0) && _bountyWallet != address(0x0) && _earlyInvWallet != address(0x0));

       balances[_teamWallet]     = totalTeamSupply;
       balances[_advisorWallet]  = totalAdvisorsSupply;
       balances[_bountyWallet]   = totalBountySupply;
       balances[_earlyInvWallet] = totalEarlyInvSupply;

       emit Transfer(address(0x0), _teamWallet,     balances[_teamWallet]);
       emit Transfer(address(0x0), _advisorWallet,  balances[_advisorWallet]);
       emit Transfer(address(0x0), _bountyWallet,   balances[_bountyWallet]);
       emit Transfer(address(0x0), _earlyInvWallet, balances[_earlyInvWallet]);
    }

burn keyboard_arrow_up

Parameters help

Name Type
_value
uint256 help

Properties

Visibility help public
Mutability help transaction
Source Code
     function burn(uint256 _value) onlyOwner public returns (bool) 
     {
        require(!stopped);
        require(_value <= balances[msg.sender]);

        address burner = msg.sender;

        balances[burner] = balances[burner].sub(_value);
        totalTokenSupply = totalTokenSupply.sub(_value);
        totalBurned      = totalBurned.add(_value);

        emit Burn(burner, _value);
        emit Transfer(burner, address(0x0), _value);
        return true;
     }

transferOwnership keyboard_arrow_up

Parameters help

Name Type
_newOwner
address help

Properties

Visibility help public
Mutability help transaction
Source Code
    function transferOwnership(address _newOwner)public onlyOwner
    {
       require(!stopped);
       require( _newOwner != address(0x0));

       balances[_newOwner] = (balances[_newOwner]).add(balances[owner]);
       balances[owner] = 0;
       owner = _newOwner;

       emit Transfer(msg.sender, _newOwner, balances[_newOwner]);
   }

renounceOwnership keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
   function renounceOwnership() public onlyOwner 
   {
      require(!stopped);

      owner = address(0x0);

      emit OwnershipRenounced(owner);
   }

increaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_addedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
   function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) 
   {
      require(!stopped);

      allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);

      emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
      return true;
   }

decreaseApproval keyboard_arrow_up

Parameters help

Name Type
_spender
address help
_subtractedValue
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
   function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) 
   {
      uint256 oldValue = allowed[msg.sender][_spender];

      require(!stopped);

      if (_subtractedValue > oldValue) 
      {
         allowed[msg.sender][_spender] = 0;
      }
      else 
      {
         allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
      }

      emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
      return true;
   }

transferAnyERC20Token keyboard_arrow_up

Parameters help

Name Type
_tokenAddress
address help
_tokens
uint256 help

Properties

Visibility help public
Mutability help transaction

Requirements help

Source Code
   function transferAnyERC20Token(address _tokenAddress, uint256 _tokens) onlyOwner public returns (bool) 
   {
      require(!stopped);

      return ERC20Interface(_tokenAddress).transfer(owner, _tokens);
   }

constructor keyboard_arrow_up

Parameters help

This function has no parameters.

Properties

Visibility help public
Mutability help payable
Source Code
   function () public payable 
   {
      revert();
   }