function setExchange(
        address exchange_
    )
        public
        onlyOperator
    {
        require(
            exchange_ != address(0)
        );
        if(
            exchange_ == exchange &&
            candidateExchange != address(0)
        ) {
            emit eCancelNominatingExchange(candidateExchange);
            candidateExchange = address(0);
            candidateTillExchange = 0;
        } else if(
            exchange == address(0)
        ) {
            
            emit eChangeExchange(address(0), exchange_);
            exchange = exchange_;
            exchangeOldVersion = exchange_;
        } else if(
            exchange_ != candidateExchange &&
            candidateTillExchange + 86400 * 7 < block.timestamp
        ) {
            
            emit eNominatingExchange(exchange_);
            candidateExchange = exchange_;
            candidateTillExchange = block.timestamp + 86400 * 7;
        } else if(
            exchange_ == candidateExchange &&
            candidateTillExchange < block.timestamp
        ) {
            
            emit eChangeExchange(exchange, candidateExchange);
            exchangeOldVersion = exchange;
            exchange = candidateExchange;
            candidateExchange = address(0);
        }
    }