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
950b6a5e
Commit
950b6a5e
authored
Jul 14, 2017
by
Jakub Wojciechowski
Committed by
Francisco Giordano
Jul 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sanity check for RefundableCrowdsale: goal > 0
parent
db40fd31
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
RefundableCrowdsale.sol
contracts/crowdsale/RefundableCrowdsale.sol
+1
-0
RefundableCrowdsale.js
test/RefundableCrowdsale.js
+9
-0
No files found.
contracts/crowdsale/RefundableCrowdsale.sol
View file @
950b6a5e
...
...
@@ -22,6 +22,7 @@ contract RefundableCrowdsale is FinalizableCrowdsale {
RefundVault public vault;
function RefundableCrowdsale(uint256 _goal) {
require(_goal > 0);
vault = new RefundVault(wallet);
goal = _goal;
}
...
...
test/RefundableCrowdsale.js
View file @
950b6a5e
...
...
@@ -17,6 +17,15 @@ contract('RefundableCrowdsale', function ([_, owner, wallet, investor]) {
const
goal
=
ether
(
800
)
const
lessThanGoal
=
ether
(
750
)
describe
(
'creating a valid crowdsale'
,
function
()
{
it
(
'should fail with zero goal'
,
async
function
()
{
await
RefundableCrowdsale
.
new
(
this
.
startBlock
,
this
.
endBlock
,
rate
,
wallet
,
0
,
{
from
:
owner
}).
should
.
be
.
rejectedWith
(
EVMThrow
);
})
});
beforeEach
(
async
function
()
{
this
.
startBlock
=
web3
.
eth
.
blockNumber
+
10
this
.
endBlock
=
web3
.
eth
.
blockNumber
+
20
...
...
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