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

Moved adjust total supply checkpoints inside of create checkpoint #520 #523

Conversation

dev1644
Copy link
Contributor

@dev1644 dev1644 commented Jan 15, 2019

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?

(Bug fix, feature, docs update, ...)

What is the current behavior?

(You can also link to an open issue here)
#520

What is the new behavior?

(Define and describe any new functionality. Clarify if this is a feature change)

Does this PR introduce a breaking change?

(What changes might users need to make in their application due to this PR?)
No

Any Other information:

@maxsam4 maxsam4 changed the base branch from master to dev-3.0.0 January 15, 2019 08:00
Copy link
Contributor

@maxsam4 maxsam4 left a comment

Choose a reason for hiding this comment

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

@dev1644 Thanks for the PR!
The changes in SecurityToken look good.
These changes allow us to remove a couple of edge case checks from TokenLib. To avoid spoilers in the learning process, I am not gonna mention which :P.

If you need help finding them, you know where to find me :)

@F-OBrien
Copy link
Contributor

The description for the adjustTotalSupplyCheckpoints() function should now be changed to remove reference to minting or burning also. I guess it's also now questionable if this even needs to be a separate function as it's only called in one place when the checkpoint is created?

/** * @notice Internal - adjusts totalSupply at checkpoint after minting or burning tokens */ function _adjustTotalSupplyCheckpoints() internal { TokenLib.adjustCheckpoints(checkpointTotalSupply, totalSupply(), currentCheckpointId); }

…al conditions were not needed and only one statement was happening in the function
@maxsam4
Copy link
Contributor

maxsam4 commented Jan 15, 2019

@dev1644 I guess we need the function in the tokenLib for adjusting checkpoints of user balance. Updating total supply with a single statement is fine, just don't remove the function from tokenLib.

The other optimization I was talking about was getValueAt for total supply. You can directly return totalSupply from checkpoint here if checkpointID is within the limit.

@pabloruiz55 pabloruiz55 merged commit c339f52 into PolymathNetwork:dev-3.0.0 Jan 16, 2019
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