function endCrowdsale(uint256 timestamp)
        external
        onlyOwner
    {
        assert(timestamp > 0 && timestamp <= now);
        assert(endedAt == 0);   
        endedAt = timestamp;
        CrowdsaleEnded(endedAt);
    }