Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
1c5f16ae
Unverified
Commit
1c5f16ae
authored
Oct 18, 2018
by
Nicolás Venturo
Committed by
GitHub
Oct 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closing time must be strictly after opening time. (#1440)
parent
d9fdffe8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
TimedCrowdsale.sol
contracts/crowdsale/validation/TimedCrowdsale.sol
+1
-1
TimedCrowdsale.test.js
test/crowdsale/TimedCrowdsale.test.js
+8
-2
No files found.
contracts/crowdsale/validation/TimedCrowdsale.sol
View file @
1c5f16ae
...
...
@@ -29,7 +29,7 @@ contract TimedCrowdsale is Crowdsale {
constructor(uint256 openingTime, uint256 closingTime) internal {
// solium-disable-next-line security/no-block-members
require(openingTime >= block.timestamp);
require(closingTime >
=
openingTime);
require(closingTime > openingTime);
_openingTime = openingTime;
_closingTime = closingTime;
...
...
test/crowdsale/TimedCrowdsale.test.js
View file @
1c5f16ae
...
...
@@ -29,18 +29,24 @@ contract('TimedCrowdsale', function ([_, investor, wallet, purchaser]) {
this
.
token
=
await
SimpleToken
.
new
();
});
it
(
're
jects an opening time
in the past'
,
async
function
()
{
it
(
're
verts if the opening time is
in the past'
,
async
function
()
{
await
shouldFail
.
reverting
(
TimedCrowdsaleImpl
.
new
(
(
await
time
.
latest
())
-
time
.
duration
.
days
(
1
),
this
.
closingTime
,
rate
,
wallet
,
this
.
token
.
address
));
});
it
(
're
jects a closing time
before the opening time'
,
async
function
()
{
it
(
're
verts if the closing time is
before the opening time'
,
async
function
()
{
await
shouldFail
.
reverting
(
TimedCrowdsaleImpl
.
new
(
this
.
openingTime
,
this
.
openingTime
-
time
.
duration
.
seconds
(
1
),
rate
,
wallet
,
this
.
token
.
address
));
});
it
(
'reverts if the closing time equals the opening time'
,
async
function
()
{
await
shouldFail
.
reverting
(
TimedCrowdsaleImpl
.
new
(
this
.
openingTime
,
this
.
openingTime
,
rate
,
wallet
,
this
.
token
.
address
));
});
context
(
'with crowdsale'
,
function
()
{
beforeEach
(
async
function
()
{
this
.
crowdsale
=
await
TimedCrowdsaleImpl
.
new
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment