-
Notifications
You must be signed in to change notification settings - Fork 152
adjustCheckpoints after mint or burn #517
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
Comments
@AlexejShevchenko Thanks for trying out our Security token!
If you think none of the above caused this Issue, please share the address of your security token and I'll look into what went wrong. If you used a private network then maybe share the script or exact steps you took? Thanks! |
I'm not testing token yet, I'm just read a code of contracts.
As I understand, this function should be called AFTER totalSupply changes
|
@AlexejShevchenko When a checkpoint is created, total supply and balances are not snapshotted instantly. They are stored in the next transaction and hence they need to be stored before the total supply is updated by that transaction. We'll update the code comment to reflect this. Thanks for pointing this out! |
Thanks @AlexejShevchenko for reviewing this. We have fixed the comments in 2.1 version of the code! |
Uh oh!
There was an error while loading. Please reload this page.
In SecurityToken.sol line 504 (adjusts totalSupply at checkpoint AFTER minting or burning tokens) but it is called on lines 683 and 726 BEFORE change totalSupply_
For example,
checkpoint = 0
checkpoint value = 0
total supply = 0
Somebody buy 100 tokens. checkpoint value = 0, total supply = 100
Somebody buy 200 tokens. checkpoint value = 100, total supply = 300
We create a new checkpoin. Remember, total supply is 300 now!!!
checkpoint = 1
checkpoint value = 100
total supply = 300
Somebody buy 300 tokens. checkpoint value = 300, total supply = 600
We want to see total supply at checkpoint 0. It returns 100, but should return 300.
The text was updated successfully, but these errors were encountered: