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
84a68e0c
Commit
84a68e0c
authored
Aug 14, 2017
by
Francisco Giordano
Committed by
GitHub
Aug 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #364 from frangio/remove-crowdsale-finish-minting
Remove token.finishMinting() from default finalization
parents
6e66ba32
36452136
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
FinalizableCrowdsale.sol
contracts/crowdsale/FinalizableCrowdsale.sol
+9
-8
FinalizableCrowdsale.js
test/FinalizableCrowdsale.js
+0
-7
MintableToken.js
test/MintableToken.js
+7
-1
No files found.
contracts/crowdsale/FinalizableCrowdsale.sol
View file @
84a68e0c
...
...
@@ -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 @
84a68e0c
...
...
@@ -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
)
})
})
test/MintableToken.js
View file @
84a68e0c
'use strict'
;
const
assertJump
=
require
(
'./helpers/assertJump'
)
;
import
expectThrow
from
'./helpers/expectThrow'
;
var
MintableToken
=
artifacts
.
require
(
'../contracts/Tokens/MintableToken.sol'
);
contract
(
'Mintable'
,
function
(
accounts
)
{
...
...
@@ -37,4 +37,10 @@ contract('Mintable', function(accounts) {
assert
(
totalSupply
,
100
);
})
it
(
'should fail to mint after call to finishMinting'
,
async
function
()
{
await
token
.
finishMinting
();
assert
.
equal
(
await
token
.
mintingFinished
(),
true
);
await
expectThrow
(
token
.
mint
(
accounts
[
0
],
100
));
})
});
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