I am probably missing something very obvious but I cannot get the simplest assert statement to work! What am I doing wrong?
My goal is to simply confirm that I am within a start date and end date range using "now".
I cannot even get assert (1==1); to return true!
Please assist!
pragma solidity ^0.4.18;
contract TestAssert {
// Unix timestamp converter used = https://www.unixtimestamp.com/
uint256 public constant startDate = 1517907600; // 02/06/2018 09:00:00
uint256 public constant endDate = 1522659600; // 04/02/2018 09:00:00
//This is the Constructor
function TestAssert() {
}
function assertOneEqualsOne () returns (bool) {
assert(1 == 1);
}
function assertStartDate () constant returns(bool){
assert(now >= startDate);
}
function assertEndDate () constant returns(bool){
assert(now <= endDate);
}
function returnNow() returns (uint256) {
return now;
}
function () payable {
// this is the fallback function.
}
}