contract WALLIcoDates is Owned {

    uint public dateMainStart = 1619859600; // 1-MAY-2021 09:00 GMT +0 
    uint public dateMainEnd   = 1620464400; // 8-MAY-2021 09:00 GMT +0 

    uint public constant DATE_LIMIT = 1620464400 + 180 days;

    event IcoDateUpdated(uint id, uint unixts);

    // check dates

    modifier checkDateOrder {
      _ ;
      require ( dateMainStart < dateMainEnd ) ;
      require ( dateMainEnd < DATE_LIMIT ) ;
    }

    constructor() public checkDateOrder() {
        require(now < dateMainStart);
    }

    // set ico dates

    function setDateMainStart(uint _unixts) public onlyOwner checkDateOrder {
        require(now < _unixts && now < dateMainStart);
        dateMainStart = _unixts;
        emit IcoDateUpdated(1, _unixts);
    }

    function setDateMainEnd(uint _unixts) public onlyOwner checkDateOrder {
        require(now < _unixts && now < dateMainEnd);
        dateMainEnd = _unixts;
        emit IcoDateUpdated(2, _unixts);
    }

    // where are we? Passed first day or not?

    function isMainFirstDay() public view returns (bool) {
        if (now > dateMainStart && now <= dateMainStart + 1 days) return true;
        return false;
    }

    function isMain() public view returns (bool) {
        if (now > dateMainStart && now < dateMainEnd) return true;
        return false;
    }

}
// ----------------------------------------------------------------------------
//
// WALLIcoDates
//
// ----------------------------------------------------------------------------
function isMainFirstDay() public view returns (bool) {
    if (now > dateMainStart && now <= dateMainStart + 1 days) return true;
    return false;
}

// where are we? Passed first day or not?