Skip to content

Commit

Permalink
ERC1155 docs (#920)
Browse files Browse the repository at this point in the history
* Add ERC1155 module, dual and interface

* Implement ERC1155 and update token_id variable names

* Add ERC1155 receiver mocks and test dual1155 receiver

* apply linter

* Update token_uri variable and remove IERC1155MetadataCamelOnly support

* Add ERC1155 mocks and tests and add ERC1155 preset

* update CHANGELOG

* adding PR number (#852)

* reset changlog

* Update ERC1155Component Event and add batch_burn

* Add batch minting functions for ERC1155 tokens

* Refactor code for better readability
Update error testing and remove tests failing from erc1155

* feat: finish first version with 2.5.3

* feat: apply review updates

* feat: add tests

* feat: bump version and add entry to CHANGELOG

* feat: add more tests

* fix: remove print

* feat: add preset tests

* fix: format

* feat: uncomment test

* refactor: shortening test names

* feat: finish docs

* fix: test

* feat: move assertion

* Update src/token/erc1155/erc1155.cairo

Co-authored-by: Martín Triay <[email protected]>

* fix: comments

* featL apply review updates

* Update docs/modules/ROOT/pages/erc1155.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/erc1155.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* Update docs/modules/ROOT/pages/api/erc1155.adoc

Co-authored-by: Andrew Fleming <[email protected]>

* docs: update

* feat: apply review updates

* feat: add sub-indexes

* feat: remove IAccount

* feat: apply review update

* fix: merge conflicts

* feat: apply review updates

* feat: apply review updates

* Update src/token/erc1155/erc1155.cairo

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/erc1155.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/erc1155.adoc

Co-authored-by: Martín Triay <[email protected]>

* fix: docs

* feat: apply review updates

* docs: add mixins link to common

* feat: apply update reviews

* fix: tests

* Update docs/modules/ROOT/pages/api/erc1155.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/erc1155.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/erc1155.adoc

Co-authored-by: Martín Triay <[email protected]>

* Update docs/modules/ROOT/pages/api/erc1155.adoc

Co-authored-by: Martín Triay <[email protected]>

---------

Co-authored-by: Arn0d <[email protected]>
Co-authored-by: Martín Triay <[email protected]>
Co-authored-by: Andrew Fleming <[email protected]>
  • Loading branch information
4 people authored Mar 5, 2024
1 parent a1700d8 commit bf780e6
Show file tree
Hide file tree
Showing 18 changed files with 987 additions and 565 deletions.
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ nav:
- modules/ROOT/nav.adoc
asciidoc:
attributes:
page-sidebar-collapse-default: 'Access,Accounts,Introspection,Security,ERC20,ERC721,Upgrades'
page-sidebar-collapse-default: 'Access,Accounts,Introspection,Security,ERC20,ERC721,ERC1155,Upgrades'
3 changes: 2 additions & 1 deletion docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
**** xref:/api/erc20.adoc[API Reference]
*** xref:erc721.adoc[ERC721]
**** xref:/api/erc721.adoc[API Reference]
// *** xref:erc1155.adoc[ERC1155]
*** xref:erc1155.adoc[ERC1155]
**** xref:/api/erc1155.adoc[API Reference]

** xref:upgrades.adoc[Upgrades]
*** xref:/api/upgrades.adoc[API Reference]
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/ROOT/pages/api/access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
:src5: https://github.com/starknet-io/SNIPs/blob/main/SNIPS/snip-5.md[SRC5]
:inner-src5: xref:api/introspection.adoc#ISRC5[SRC5 ID]
:_set_role_admin: xref:#AccessControlComponent-_set_role_admin[_set_role_admin]
:mixin-impls: xref:components.adoc#mixins[Embeddable Mixin Implementations]

= Access Control

include::../utils/_common.adoc[]

This directory provides ways to restrict who can access the functions of a contract or when they can do it.

- {Ownable} is a simple mechanism with a single "owner" role that can be assigned to a single account.
Expand Down Expand Up @@ -405,7 +406,6 @@ Emitted when `account` is revoked `role`.
:assert_only_role: xref:#AccessControlComponent-assert_only_role
:grant_role: xref:#AccessControlComponent-grant_role[grant_role]
:revoke_role: xref:#AccessControlComponent-revoke_role[revoke_role]
:mixin-impl: xref:components.adoc#mixins[Embeddable Mixin Implementation]

```javascript
use openzeppelin::access::accesscontrol::AccessControlComponent;
Expand Down Expand Up @@ -446,7 +446,7 @@ grant and revoke this role. Extra precautions should be taken to secure
accounts that have been granted it.

[.contract-index#AccessControl-Mixin-Impl]
.{mixin-impl}
.{mixin-impls}

--
.AccessControlMixinImpl
Expand Down
11 changes: 6 additions & 5 deletions docs/modules/ROOT/pages/api/account.adoc
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
:snip6: https://github.com/ericnordelo/SNIPs/blob/feat/standard-account/SNIPS/snip-6.md[SNIP-6]
:inner-src5: xref:api/introspection.adoc#ISRC5[SRC5 ID]
:mixin-impl: xref:components.adoc#mixins[Embeddable Mixin Implementation]

= Account

Reference of interfaces, presets, and utilities related to account contracts.

== Core

include::../utils/_common.adoc[]

[.contract]
[[ISRC6]]
=== `++ISRC6++` link:https://github.com/OpenZeppelin/cairo-contracts/blob/release-v0.9.0/src/account/interface.cairo[{github-icon},role=heading-link]
Expand Down Expand Up @@ -75,10 +76,10 @@ use openzeppelin::account::AccountComponent;
```
Account component implementing xref:ISRC6[`ISRC6`] for signatures over the {starknet-curve}.

NOTE: Implementing xref:api/introspection.adoc#SRC5Component[SRC5Component] is a requirement for this component to be implemented.
NOTE: {src5-component-required-note}

[.contract-index#AccountComponent-Embeddable-Mixin-Impl]
.{mixin-impl}
.{mixin-impls}

--
.AccountMixinImpl
Expand Down Expand Up @@ -292,12 +293,12 @@ use openzeppelin::account::eth_account::EthAccountComponent;
```
Account component implementing xref:ISRC6[`ISRC6`] for signatures over the {secp256k1-curve}.

NOTE: Implementing xref:api/introspection.adoc#SRC5Component[SRC5Component] is a requirement for this component to be implemented.
NOTE: {src5-component-required-note}

NOTE: The `EthPublicKey` type is an alias for `starknet::secp256k1::Secp256k1Point`.

[.contract-index#EthAccountComponent-Embeddable-Mixin-Impl]
.{mixin-impl}
.{mixin-impls}

--
.EthAccountMixinImpl
Expand Down
Loading

0 comments on commit bf780e6

Please sign in to comment.