contract ScotchToken is DetailedERC20, StandardToken, Ownable, PausableToken, StandardBurnableToken {
    uint256 public marketplace   = 2000000000000000000000000000;
    uint256 public devSupply     = 3000000000000000000000000000;
    uint256 public advisorSupply = 1000000000000000000000000000;
    uint256 public airdropSupply = 1280000000000000000000000000;
    uint256 public icoSupply     = 12000000000000000000000000000;
    uint256 public icoBonus      = 720000000000000000000000000;
    uint256 public airdropDist;

    bool public icoClosed = false;
    bool public airdropFinish = false;

    event tokenDelivered(address indexed receiver, uint256 amount);

    constructor(
        string _name,
        string _symbol,
        uint8 _decimals,
        uint256 _amount
    )
    DetailedERC20(_name, _symbol, _decimals)
    public {
        require(_amount > 0, "amount has to be greater than 0");
        totalSupply_ = _amount;
        balances[msg.sender] = totalSupply_;
        emit Transfer(address(0), msg.sender, totalSupply_);
    }

    modifier canDistrAirdrop() {
        require(!airdropFinish);
        _;
    }

    modifier icoFinished() {
        require(icoClosed);
        _;
    }

    function closeICO(bool status) public onlyOwner {
        icoClosed = status;
    }

    /** ICO has closed only */
    function addAirdropSupply(uint256 _amount) public onlyOwner icoFinished {
        _addAirdropSupply(_amount);
    }
    function _addAirdropSupply(uint256 _amount) internal {
        airdropSupply = airdropSupply.add(_amount);
    }

    function doAirdrop(address _beneficiary, uint256 _tokenAmount) internal {
        require(_tokenAmount > 0);
        require(airdropDist.add(_tokenAmount) <= airdropSupply);
        airdropDist = airdropDist.add(_tokenAmount);
        if (airdropDist >= airdropSupply) {
            airdropFinish = true;
        }
        transfer(_beneficiary ,_tokenAmount);
        emit tokenDelivered(_beneficiary, _tokenAmount);
    }

    function adminClaimAirdrop(address _beneficiary, uint _amount) public onlyOwner icoFinished canDistrAirdrop {        
        doAirdrop(_beneficiary, _amount);
    }

    function adminClaimAirdropMultiple(address[] _addresses, uint _amount) public onlyOwner icoFinished canDistrAirdrop {        
        for (uint i = 0; i < _addresses.length; i++) doAirdrop(_addresses[i], _amount);
    }
}
function addAirdropSupply(uint256 _amount) public onlyOwner icoFinished {
    _addAirdropSupply(_amount);
}

/** ICO has closed only */