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

UPDATED: BuyTokens getting the token amount from a function instead of just multiplication. Useful for making Crowdsales with bonus periods #638

Merged
merged 8 commits into from
Jan 15, 2018

Conversation

Perseverance
Copy link
Contributor

@Perseverance Perseverance commented Jan 3, 2018

I've changed the buyTokens method to get the rate from getTokenAmount function. This function can later be overridden to make crowdsales with different rate periods based on some business logic.

This is an update pull request as the previous one was too messy due to conflicts
Fixes #302

shrugs
shrugs previously approved these changes Jan 3, 2018
Copy link
Contributor

@shrugs shrugs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "zeppelin-solidity",
"version": "1.5.0",
"version": "1.5.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change the version? The version is changed only on each release I think and by the maintainers of the repo, please remove this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Perseverance
Copy link
Contributor Author

The build is failing with "Error: Could not connect to your Ethereum client. Please check that your Ethereum client:" after my commit changing back the lib version. I do not think the error is related to my changes :)

@AugustoL
Copy link
Contributor

AugustoL commented Jan 4, 2018

@Perseverance it is not! Is a problem in travis that happens randomly. Im going to restart it.

Copy link
Contributor

@AugustoL AugustoL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove all changes in packaje.json file, there still one line break left in the last line.

@Perseverance
Copy link
Contributor Author

@AugustoL done, should have reverted the first time :) Please squash them if you have such option when merging

AugustoL
AugustoL previously approved these changes Jan 4, 2018
// fallback function can be used to buy tokens
function () external payable {
buyTokens(msg.sender);
}

// Override this function to create logic for periodization
function getTokenAmount(uint256 weiAmount) internal constant returns(uint256) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change constant for view? They're aliases but we use view throughout the codebase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@Perseverance
Copy link
Contributor Author

@frangio Changed constant to view ;)

@Perseverance
Copy link
Contributor Author

@frangio Is it good to go now?

@frangio frangio merged commit beea818 into OpenZeppelin:master Jan 15, 2018
@frangio
Copy link
Contributor

frangio commented Jan 15, 2018

Thank you @Perseverance!

@frangio frangio removed the review label Jan 15, 2018
ProphetDaniel pushed a commit to classicdelta/Smart-Contracts that referenced this pull request Mar 9, 2018
BuyTokens getting the token amount from a function instead of just multiplication. Useful for making Crowdsales with bonus periods
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