-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove token.finishMinting() from default finalization #364
Remove token.finishMinting() from default finalization #364
Conversation
bfba316
to
4fc6bb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, with one small question for you to consider before merging.
function finalization() internal { | ||
token.finishMinting(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't finalization be abstract now that it's empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it. If it's left abstract you can't call super.finalization()
in the deriving contract, which we want everyone to do to make sure the whole finalization
chain runs.
AFter this PR OpenZeppelin#364 the comment was left.
AFter this PR OpenZeppelin#364 the comment was left.
…ish-minting Remove token.finishMinting() from default finalization
AFter this PR OpenZeppelin#364 the comment was left.
AFter this PR OpenZeppelin/openzeppelin-contracts#364 the comment was left.
AFter this PR OpenZeppelin/openzeppelin-contracts#364 the comment was left.
The default
finalization
implementation inFinalizableCrowdsale
callstoken.finishMinting()
. This is orthogonal to having finalization logic. If one wants to be able to mint further tokens in the future, the defaultfinalization
function cannot be called. See decentraland/mana and how they worked around this:Since we want to make sure that all contracts deriving from
FinalizableCrowdsale
callsuper.finalization()
, to ensure all of the finalization logic is executed, we have to remove the call tofinishMinting
.The caveat here is that if a custom finalization transfers ownership of the token to an address, that address will be able to mint tokens unless the custom logic also calls
finishMinting
. This is something that will come up in an audit, however.