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
4fc6bb79
Commit
4fc6bb79
authored
Aug 12, 2017
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove token.finishMinting() from default finalization
parent
e6a7a978
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
15 deletions
+9
-15
FinalizableCrowdsale.sol
contracts/crowdsale/FinalizableCrowdsale.sol
+9
-8
FinalizableCrowdsale.js
test/FinalizableCrowdsale.js
+0
-7
No files found.
contracts/crowdsale/FinalizableCrowdsale.sol
View file @
4fc6bb79
...
...
@@ -16,8 +16,10 @@ contract FinalizableCrowdsale is Crowdsale, Ownable {
event Finalized();
// should be called after crowdsale ends, to do
// some extra finalization work
/**
* @dev Must be called after crowdsale ends, to do some extra finalization
* work. Calls the contract's finalization function.
*/
function finalize() onlyOwner {
require(!isFinalized);
require(hasEnded());
...
...
@@ -28,12 +30,11 @@ contract FinalizableCrowdsale is Crowdsale, Ownable {
isFinalized = true;
}
// end token minting on finalization
// override this with custom logic if needed
/**
* @dev Can be overriden to add finalization logic. The overriding function
* should call super.finalization() to ensure the chain of finalization is
* executed entirely.
*/
function finalization() internal {
token.finishMinting();
}
}
test/FinalizableCrowdsale.js
View file @
4fc6bb79
...
...
@@ -60,11 +60,4 @@ contract('FinalizableCrowdsale', function ([_, owner, wallet, thirdparty]) {
should
.
exist
(
event
)
})
it
(
'finishes minting of token'
,
async
function
()
{
await
increaseTimeTo
(
this
.
afterEndTime
)
await
this
.
crowdsale
.
finalize
({
from
:
owner
})
const
finished
=
await
this
.
token
.
mintingFinished
()
finished
.
should
.
equal
(
true
)
})
})
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