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

examples: add nep5 mint function #823

Merged
merged 1 commit into from
Apr 3, 2020
Merged

examples: add nep5 mint function #823

merged 1 commit into from
Apr 3, 2020

Conversation

AnnaShaleva
Copy link
Member

Add Mint(...) to NEP5 for initial tokens supply.

Add Mint(...) to NEP5 for initial tokens supply.
@AnnaShaleva AnnaShaleva self-assigned this Apr 3, 2020
@codecov
Copy link

codecov bot commented Apr 3, 2020

Codecov Report

Merging #823 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #823   +/-   ##
=======================================
  Coverage   67.65%   67.65%           
=======================================
  Files         141      141           
  Lines       13163    13163           
=======================================
  Hits         8906     8906           
  Misses       3849     3849           
  Partials      408      408           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f64aa20...c84c33d. Read the comment docs.

}

storage.Put(ctx, to, t.TotalSupply)
storage.Put(ctx, []byte("minted"), true)
Copy link
Member Author

Choose a reason for hiding this comment

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

The only difference from your code is in this true value in order to prevent double-initialisation. Tested this contract, actual behaviour now:

  1. Mint token to account AKkkumHbBipZ46UMZJoFynJMXzSRnBvKcs
  2. All available amount of token is on AKkkumHbBipZ46UMZJoFynJMXzSRnBvKcs account (checked with balansOf)
  3. There's no token on AK2nJJpJr6o664CWJKi1QRXjqeic2zRp8y account (checked with balanceOf)
  4. Can not mint one more time (mint returned false to stack)

Copy link
Member

Choose a reason for hiding this comment

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

So it was almost correct, nice.

@roman-khimov roman-khimov added this to the v0.74.1 milestone Apr 3, 2020
@roman-khimov roman-khimov merged commit c0b5271 into master Apr 3, 2020
@roman-khimov roman-khimov deleted the examples/nep5 branch April 3, 2020 10:23
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

2 participants