Skip to content
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

Create CappedToken, a capped MintableToken #515

Merged
merged 4 commits into from
Nov 22, 2017

Conversation

cwhinfrey
Copy link
Contributor

This PR implements CappedToken, a capped MintableToken. This token will allow tokens to be minted up until the cap is reached.

@Qqwy
Copy link

Qqwy commented Oct 26, 2017

What would the advantage of this be over using the CappedCrowdsale contract?

@cwhinfrey
Copy link
Contributor Author

@Qqwy The CappedCrowdsale sets a cap on the amount of funds raised, not on the number of tokens. A token sale may have a rate that adjusts over time and want to set the cap of the sale by the number of tokens not the amount of funds raised.

@cwhinfrey
Copy link
Contributor Author

@Qqwy This could also be used in conjunction with CappedCrowdsale. One example of this would be if a crowdsale distributed tokens to contributors up to a set funding amount and then any additional tokens would be minted for an airdrop up to a set token cap.

@eternauta1337
Copy link
Contributor

Looks great.

One small thing tho:
Can you change L28 to return super.mint(_to, _amount);? (use super)

See http://solidity.readthedocs.io/en/develop/contracts.html#inheritance
Directly calling a method on of the members of the inheritance chain can cause undesired results (i.e. skipping parts of the chain), and even though it wouldn't particularly hurt in this case, we want to encourage the use of super as best practice.

@cwhinfrey
Copy link
Contributor Author

@ajsantander Thanks for taking a look. :) Good to know. Just fixed it.

frangio added a commit to frangio/openzeppelin-contracts that referenced this pull request Nov 22, 2017
@frangio frangio merged commit 8765e2a into OpenZeppelin:master Nov 22, 2017
frangio added a commit that referenced this pull request Nov 22, 2017
Create CappedToken, a capped MintableToken
@frangio
Copy link
Contributor

frangio commented Nov 22, 2017

Thanks @cwhinfrey! I added an extra commit (12303ce) fixing the comparison of bignumbers. See #204.

ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this pull request Mar 9, 2018
Create CappedToken, a capped MintableToken
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants