contract ATMToken is StandardToken, Owned {
    // metadata
    string public constant name = "Attention Token of Media";
    string public constant symbol = "ATM";
    string public version = "1.0";
    uint256 public constant decimals = 8;
    bool public disabled;
    mapping(address => bool) public isATMHolder;
    address[] public ATMHolders;
    // constructor
    function ATMToken(uint256 _amount) {
        totalSupply = _amount; //设置当前ATM发行总量
        balances[msg.sender] = _amount;
    }
    function getATMTotalSupply() external constant returns(uint256) {
        return totalSupply;
    }
    function getATMHoldersNumber() external constant returns(uint256) {
        return ATMHolders.length;
    }
    //在数据迁移时,需要先停止ATM交易
    function setDisabled(bool flag) external onlyOwner {
        disabled = flag;
    }
    function transfer(address _to, uint256 _value) returns (bool success) {
        require(!disabled);
        if(isATMHolder[_to] == false){
            isATMHolder[_to] = true;
            ATMHolders.push(_to);
        }
        return super.transfer(_to, _value);
    }
    function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
        require(!disabled);
        if(isATMHolder[_to] == false){
            isATMHolder[_to] = true;
            ATMHolders.push(_to);
        }
        return super.transferFrom(_from, _to, _value);
    }
    function kill() external onlyOwner {
        selfdestruct(owner);
    }
}
function setDisabled(bool flag) external onlyOwner {
    disabled = flag;
}

//在数据迁移时,需要先停止ATM交易