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

CappedSTO price fix #440

Merged
merged 14 commits into from
Dec 4, 2018
Merged

CappedSTO price fix #440

merged 14 commits into from
Dec 4, 2018

Conversation

maxsam4
Copy link
Contributor

@maxsam4 maxsam4 commented Nov 28, 2018

Please check if the PR fulfills these requirements

  • The commit message follows our Submission guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

Capped STO now allows the issuer to set the price of their token higher than 1ETH/token

Does this PR introduce a breaking change?

The rate is now assumed to be multiplied by 10^18 by the smart contracts. So if a user wants to sell 1 unit of their token for 1 unit of poly, they need to set rate as 10^18 rather than 1.

@@ -49,7 +50,7 @@ contract CappedSTO is ISTO, ReentrancyGuard {
* @param _startTime Unix timestamp at which offering get started
* @param _endTime Unix timestamp at which offering get ended
* @param _cap Maximum No. of tokens for sale
* @param _rate Token units a buyer gets per wei / base unit of POLY
* @param _rate Token units multiplied by 10^18 a buyer gets per wei / base unit of POLY

Choose a reason for hiding this comment

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

If you're gonna specify this for this param, you should specify it for the cap as well (same for the function signature comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cap is not multiplied by 10^18. Consider indivisible tokens where decimals = 1. In that case, the cap will not be multiplied by 10^18. To sell max 2 tokens, I'll have to set the cap as 2 only.

cap is to be entered multiplied by 10^decimals like all values of tokens are entered in smart contracts usually.

In the comment regarding rate, the base unit of POLY means 10 to the power minus 18 POLY token. If a user wants 1 POLY = 1 Security Token even then they have to enter rate as 10^18.

To summarize: cap is multiplied according to the security token's decimals like every other number like transfer amount is. On the other hand, rate is multiplied by fixed 10^18.

That being said, you are right, I should make this clearer in the comments, thanks.

Copy link
Contributor

@adamdossa adamdossa left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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.

None yet

5 participants