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

docs: ERC1155 #302

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

programskillforverification
Copy link
Contributor

Continue #275

Now, erc1155 and its extensions are done. Then add antora docs.

Copy link

netlify bot commented Sep 30, 2024

Deploy Preview for contracts-stylus canceled.

Name Link
🔨 Latest commit ba6e965
🔍 Latest deploy log https://app.netlify.com/sites/contracts-stylus/deploys/673b62f2e404c90008d79c8f

This is why its [balanceOf] function differs from ERC20’s and ERC777’s: it has an additional `id` argument for the identifier of the token that you want to query the balance of.

This is similar to how ERC721 does things, but in that standard a token `id` has no concept of balance: each token is non-fungible and exists or doesn’t.
The ERC721 [balanceOf] function refers to how many different tokens an account has, not how many of each. On the other hand, in ERC1155 accounts have a distinct balance for each token `id`, and non-fungible tokens are implemented by simply minting a single one of them.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bidzyyys @qalisander @ggonzalez94 What's the uri of [balanceOf] should looks like?

Copy link
Member

@qalisander qalisander Sep 30, 2024

Choose a reason for hiding this comment

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

I think you can reference IErc20/IErc721 trait's method like: https://docs.rs/openzeppelin_stylus/token/erc721/trait.IErc721.html#tymethod.balance_of[balanceOf]

@qalisander qalisander changed the title Add ERC1155 docs docs: ERC1155 Oct 2, 2024
@bidzyyys bidzyyys mentioned this pull request Oct 8, 2024
2 tasks
@0xNeshi 0xNeshi mentioned this pull request Nov 8, 2024
3 tasks
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.

3 participants