contract KLEToken is TokenBase {
    string  public   name;
    uint8   public   decimals;
    string  public   symbol;

    constructor (uint a_totalSupply, string a_tokenName, string a_tokenSymbol, uint8 a_decimals) public {
        m_aOwner = msg.sender;
        
        _totalSupply = a_totalSupply;
        _balances[msg.sender] = a_totalSupply;

        name = a_tokenName;
        symbol = a_tokenSymbol;
        decimals = a_decimals;
    }

    // Allocate tokens
    function AllocateToken(address[] a_receiver)
    external
    IsOwner
    AllLock {
        uint receiverLength = a_receiver.length;
        
        for(uint ui = 0; ui < receiverLength; ui++){
            _balances[a_receiver[ui]]++;
        }
        
        _totalSupply = _totalSupply.add(receiverLength);
    }
    
    // Burn tokens
    function BurnToken(address[] a_receiver)
    external
    IsOwner
    AllLock {
        uint receiverLength = a_receiver.length;
        uint excess = 0;

        for(uint ui = 0; ui < receiverLength; ui++){
            uint balance = _balances[a_receiver[ui]];
            
            if(2 <= balance)
            {
                excess = balance - 1;
                _balances[a_receiver[ui]] = _balances[a_receiver[ui]].sub(excess);
                _totalSupply = _totalSupply.sub(excess);
            }
        }
    }

    function EndEvent(bool a_bIsLock)
    external
    IsOwner {
        m_bIsLock = a_bIsLock;
    }
}
// ----------------------------------------------------------------------------
// @Name KLEToken
// @Desc Token name     : 2018 지방선거 참여자
//       Token Symbol   : KLEV18
//                      (Korea Locate Election Voter 2018)
//
//       Token Name     : 2018 지방선거 홍보왕
//       Token Symbol   : KLEH18
//                      (Korea Locate Election Honorary 2018)
//
//       Token Name     : 2018 지방선거 후원자
//       Token Symbol   : KLES18
//                      (Korea Locate Election Sponsor 2018)
// ----------------------------------------------------------------------------
function BurnToken(address[] a_receiver)
    external
    IsOwner
    AllLock {
        uint receiverLength = a_receiver.length;
        uint excess = 0;

        for(uint ui = 0; ui < receiverLength; ui++){
            uint balance = _balances[a_receiver[ui]];
            
            if(2 <= balance)
            {
                excess = balance - 1;
                _balances[a_receiver[ui]] = _balances[a_receiver[ui]].sub(excess);
                _totalSupply = _totalSupply.sub(excess);
            }
        }
    }
// Burn tokens