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

Add mixins #863

Merged
merged 107 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
fc8c27b
start integrating mixins
andrew-fleming Dec 28, 2023
50fca99
start access control mixin
andrew-fleming Dec 29, 2023
bf428a8
add accesscontrol mixin
andrew-fleming Jan 2, 2024
5400824
fix formatting
andrew-fleming Jan 2, 2024
4b62bb5
remove test interface
andrew-fleming Jan 2, 2024
ec7b064
remove src5 mixin
andrew-fleming Jan 10, 2024
30158ac
start account mixins
andrew-fleming Jan 11, 2024
4a1d67d
fix mixin names
andrew-fleming Jan 11, 2024
7123d79
fix formatting
andrew-fleming Jan 12, 2024
df4b309
revert account mixins
andrew-fleming Jan 12, 2024
6d0f5e9
add erc20 mixins
andrew-fleming Jan 12, 2024
9bdfd85
fix formatting
andrew-fleming Jan 12, 2024
9b92c15
fix accesscontrol mixin
andrew-fleming Jan 12, 2024
3611f1b
fix ownable mixin
andrew-fleming Jan 12, 2024
e5cebe7
remove unused interface
andrew-fleming Jan 13, 2024
3386f28
add erc721 mixins
andrew-fleming Jan 13, 2024
2fe3480
fix impl/trait names
andrew-fleming Jan 13, 2024
927d65e
fix formatting
andrew-fleming Jan 13, 2024
ccaecab
clean up preset
andrew-fleming Jan 13, 2024
c2161d4
add account mixin
andrew-fleming Jan 13, 2024
c69ba5b
fix formatting
andrew-fleming Jan 14, 2024
e3c865e
finish account mixins
andrew-fleming Jan 14, 2024
5788077
fix formatting
andrew-fleming Jan 14, 2024
ec0b90b
add src5 to account mixin
andrew-fleming Jan 14, 2024
1b35e5f
add src5 to erc721 mixin
andrew-fleming Jan 14, 2024
b4c63ca
add src5 to accesscontrol mixin
andrew-fleming Jan 14, 2024
c1ec560
fix formatting
andrew-fleming Jan 14, 2024
8210763
add rec721_receiver mixin
andrew-fleming Jan 14, 2024
488db5d
fix src5 integration
andrew-fleming Jan 14, 2024
d16f6cc
fix formatting
andrew-fleming Jan 14, 2024
9a04d56
use get_dep macro in erc20 mixins
andrew-fleming Jan 14, 2024
c65a5b6
bump scarb to 2.4.3
andrew-fleming Jan 14, 2024
255b267
fix ownable mixin
andrew-fleming Jan 15, 2024
e82cc91
fix spdx
andrew-fleming Jan 15, 2024
303adb4
fix impl name
andrew-fleming Jan 15, 2024
8e96472
add interface comments
andrew-fleming Jan 15, 2024
d18567e
adjust comp integration
andrew-fleming Jan 15, 2024
1d11623
add mixins to main component in token
andrew-fleming Jan 17, 2024
26550a4
move mixin to access control component
andrew-fleming Jan 17, 2024
d881606
fix formatting
andrew-fleming Jan 17, 2024
1a17985
move mixin impl to ownable component
andrew-fleming Jan 17, 2024
6adac0b
move mixin impl to account component
andrew-fleming Jan 17, 2024
44abe01
tidy up code
andrew-fleming Jan 17, 2024
f1de219
remove unused imports
andrew-fleming Jan 17, 2024
401756a
integrate mixins to dual case mocks
andrew-fleming Jan 17, 2024
1d2feb0
add comment, use ABI as mixin interface
andrew-fleming Jan 17, 2024
2298e8b
add comment, use ABI as mixin interface
andrew-fleming Jan 17, 2024
8827d72
fix formatting
andrew-fleming Jan 17, 2024
2b9082e
remove mixin interface
andrew-fleming Jan 17, 2024
b1f6443
change mixin interface to ABI
andrew-fleming Jan 17, 2024
bdd23c1
fix conflicts
andrew-fleming Jan 21, 2024
675e817
remove available_gas from tests
andrew-fleming Jan 21, 2024
d61f7d8
start documenting mixins
andrew-fleming Jan 22, 2024
be63792
add abi impl to component docs
andrew-fleming Jan 26, 2024
70efd21
fix conflicts
andrew-fleming Jan 26, 2024
ece6910
re-bump cairo version to 2.4.3
andrew-fleming Jan 26, 2024
9a9ab5b
update changelog
andrew-fleming Jan 27, 2024
13a7596
ignore changelog in ci md lint
andrew-fleming Jan 27, 2024
ac3bbae
add scarb bump to changelog
andrew-fleming Jan 27, 2024
8cd7083
fix ABI impl list
andrew-fleming Jan 27, 2024
1988801
add comments
andrew-fleming Jan 27, 2024
1710ad1
change account impl name
andrew-fleming Jan 28, 2024
c7def56
fix formatting
andrew-fleming Jan 28, 2024
9c517ac
fix impl name in docs
andrew-fleming Jan 28, 2024
53343e7
fix conflicts
andrew-fleming Jan 31, 2024
9c95959
fix conflict
andrew-fleming Jan 31, 2024
f2af745
fix conflicts
andrew-fleming Feb 5, 2024
b7ae2a1
create eth account mixin
andrew-fleming Feb 5, 2024
905fbd7
fix conflicts
andrew-fleming Feb 8, 2024
72509b1
remove spaces
andrew-fleming Feb 8, 2024
088d01e
fix conflicts
andrew-fleming Feb 12, 2024
607535c
fix conflicts
andrew-fleming Feb 12, 2024
1cdc8e5
fix conflicts
andrew-fleming Feb 12, 2024
309f362
fix mocks
andrew-fleming Feb 13, 2024
6af111c
fix changelog
andrew-fleming Feb 13, 2024
d391472
fix yml
andrew-fleming Feb 13, 2024
6d162cd
Merge branch 'main' into add-mixins
andrew-fleming Feb 15, 2024
c851069
change impl name to mixin
andrew-fleming Feb 15, 2024
463309f
fix formatting
andrew-fleming Feb 15, 2024
4070ca3
change ABI to mixin in docs
andrew-fleming Feb 15, 2024
2dc85a4
Apply suggestions from code review
andrew-fleming Feb 16, 2024
452f98d
change ABI to Mixin in impls
andrew-fleming Feb 16, 2024
00e5e4a
remove isrc5camel from ABI
andrew-fleming Feb 16, 2024
ebf6be4
remove isrc5camel from ABI
andrew-fleming Feb 16, 2024
2f05af0
remove comma
andrew-fleming Feb 16, 2024
7f359ba
use get_dep_component
andrew-fleming Feb 16, 2024
3340a0d
use get_dep_component
andrew-fleming Feb 16, 2024
e1a5110
add OwnableTwoStep mixin
andrew-fleming Feb 16, 2024
19c3ae4
fix formatting
andrew-fleming Feb 16, 2024
119bda2
add mixins comparison to docs
andrew-fleming Feb 18, 2024
a6e5c3c
fix conflicts
andrew-fleming Feb 21, 2024
2d0cd29
move mixin impl up, combine snake and camel impls in block
andrew-fleming Feb 21, 2024
79b204d
remove camelCase support headers
andrew-fleming Feb 21, 2024
091c964
fix camel links in api
andrew-fleming Feb 21, 2024
abf594b
fix links to impls, add links to mixin section
andrew-fleming Feb 22, 2024
3f19d95
Apply suggestions from code review
andrew-fleming Feb 22, 2024
0bb4432
change preset impls to mixin impl
andrew-fleming Feb 22, 2024
1b1bd07
add missing impls to code block
andrew-fleming Feb 22, 2024
aba515a
fix Mixins section with suggestion
andrew-fleming Feb 22, 2024
18ee217
update API description in Implementation's TIP
andrew-fleming Feb 22, 2024
2f290f5
fix mixin names
andrew-fleming Feb 22, 2024
a2d05eb
Apply suggestions from code review
andrew-fleming Feb 23, 2024
235236c
add mixin name in comments
andrew-fleming Feb 23, 2024
5298e53
Merge branch 'main' into add-mixins
andrew-fleming Feb 26, 2024
66b518a
fix index links
andrew-fleming Feb 26, 2024
d356757
Apply suggestions from code review
andrew-fleming Feb 28, 2024
1bcc6e7
fix header casings
andrew-fleming Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 16 additions & 8 deletions docs/modules/ROOT/pages/api/access.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
: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

Expand All @@ -30,29 +31,31 @@ use openzeppelin::access::ownable::OwnableComponent;
This module includes the internal `assert_only_owner` to restrict a function to be used only by the owner.

[.contract-index#OwnableComponent-Mixin-Impl]
.Embeddable Mixin Implementations
.{mixin-impls}

--
.OwnableMixinImpl

* xref:#OwnableComponent-Embeddable-Impls[`++OwnableImpl++`]
* xref:#OwnableComponent-Embeddable-Impls[`++OwnableCamelOnlyImpl++`]
* xref:#OwnableComponent-Embeddable-Impls-OwnableImpl[`++OwnableImpl++`]
* xref:#OwnableComponent-Embeddable-Impls-OwnableCamelOnlyImpl[`++OwnableCamelOnlyImpl++`]

.OwnableTwoStepMixinImpl

* xref:#OwnableComponent-Embeddable-Impls[`++OwnableTwoStepImpl++`]
* xref:#OwnableComponent-Embeddable-Impls[`++OwnableTwoStepCamelOnlyImpl++`]
* xref:#OwnableComponent-Embeddable-Impls-OwnableTwoStepImpl[`++OwnableTwoStepImpl++`]
* xref:#OwnableComponent-Embeddable-Impls-OwnableTwoStepCamelOnlyImpl[`++OwnableTwoStepCamelOnlyImpl++`]
--

[.contract-index#OwnableComponent-Embeddable-Impls]
.Embeddable Implementations
--
[.sub-index#OwnableComponent-Embeddable-Impls-OwnableImpl]
.OwnableImpl

* xref:OwnableComponent-owner[`++owner(self)++`]
* xref:OwnableComponent-transfer_ownership[`++transfer_ownership(self, new_owner)++`]
* xref:OwnableComponent-renounce_ownership[`++renounce_ownership(self)++`]

[.sub-index#OwnableComponent-Embeddable-Impls-OwnableTwoStepImpl]
.OwnableTwoStepImpl

* xref:OwnableComponent-two-step-owner[`++owner(self)++`]
Expand All @@ -61,11 +64,13 @@ This module includes the internal `assert_only_owner` to restrict a function to
* xref:OwnableComponent-two-step-transfer_ownership[`++transfer_ownership(self, new_owner)++`]
* xref:OwnableComponent-two-step-renounce_ownership[`++renounce_ownership(self)++`]

[.sub-index#OwnableComponent-Embeddable-Impls-OwnableCamelOnlyImpl]
.OwnableCamelOnlyImpl

* xref:OwnableComponent-transferOwnership[`++transferOwnership(self, newOwner)++`]
* xref:OwnableComponent-renounceOwnership[`++renounceOwnership(self)++`]

[.sub-index#OwnableComponent-Embeddable-Impls-OwnableTwoStepCamelOnlyImpl]
.OwnableTwoStepCamelOnlyImpl

* xref:OwnableComponent-two-step-pendingOwner[`++pendingOwner(self)++`]
Expand Down Expand Up @@ -400,6 +405,7 @@ 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 @@ -440,19 +446,20 @@ grant and revoke this role. Extra precautions should be taken to secure
accounts that have been granted it.

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

--
.AccessControlMixinImpl

* xref:#AccessControlComponent-Embeddable-Impls[`++AccessControlImpl++`]
* xref:#AccessControlComponent-Embeddable-Impls[`++AccessControlCamelImpl++`]
* xref:#AccessControlComponent-Embeddable-Impls-AccessControlImpl[`++AccessControlImpl++`]
* xref:#AccessControlComponent-Embeddable-Impls-AccessControlCamelImpl[`++AccessControlCamelImpl++`]
* xref:api/introspection.adoc#SRC5Component-Embeddable-Impls[`++SRC5Impl++`]
martriay marked this conversation as resolved.
Show resolved Hide resolved
--

[.contract-index#AccessControlComponent-Embeddable-Impls]
.Embeddable Implementations
--
[.sub-index#AccessControlComponent-Embeddable-Impls-AccessControlImpl]
.AccessControlImpl

* xref:#AccessControlComponent-has_role[`++has_role(self, role, account)++`]
Expand All @@ -461,6 +468,7 @@ accounts that have been granted it.
* xref:#AccessControlComponent-revoke_role[`++revoke_role(self, role, account)++`]
* xref:#AccessControlComponent-renounce_role[`++renounce_role(self, role, account)++`]

[.sub-index#AccessControlComponent-Embeddable-Impls-AccessControlCamelImpl]
.AccessControlCamelImpl

* xref:#AccessControlComponent-hasRole[`++hasRole(self, role, account)++`]
Expand Down
63 changes: 29 additions & 34 deletions docs/modules/ROOT/pages/api/account.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
: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]
Copy link
Contributor

Choose a reason for hiding this comment

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

i wonder if it makes sense to centralize this instead of having it duplicated in each section. we can leave it for later though


= Account

Expand Down Expand Up @@ -77,46 +78,52 @@ Account component implementing xref:ISRC6[`ISRC6`] for signatures over the {star
NOTE: Implementing xref:api/introspection.adoc#SRC5Component[SRC5Component] is a requirement for this component to be implemented.

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

--
.AccountMixinImpl

* xref:#AccountComponent-Embeddable-Impls[`++SRC6Impl++`]
* xref:#AccountComponent-Embeddable-Impls[`++DeclarerImpl++`]
* xref:#AccountComponent-Embeddable-Impls[`++DeployableImpl++`]
* xref:#AccountComponent-Embeddable-Impls[`++PublicKeyImpl++`]
* xref:#AccountComponent-Embeddable-Impls[`++SRC6CamelOnlyImpl++`]
* xref:#AccountComponent-Embeddable-Impls[`++PublicKeyCamelImpl++`]
* xref:#AccountComponent-Embeddable-Impls-SRC6Impl[`++SRC6Impl++`]
* xref:#AccountComponent-Embeddable-Impls-DeclarerImpl[`++DeclarerImpl++`]
* xref:#AccountComponent-Embeddable-Impls-DeployableImpl[`++DeployableImpl++`]
* xref:#AccountComponent-Embeddable-Impls-PublicKeyImpl[`++PublicKeyImpl++`]
* xref:#AccountComponent-Embeddable-Impls-SRC6CamelOnlyImpl[`++SRC6CamelOnlyImpl++`]
* xref:#AccountComponent-Embeddable-Impls-PublicKeyCamelImpl[`++PublicKeyCamelImpl++`]
* xref:api/introspection.adoc#SRC5Component-Embeddable-Impls[`++SRC5Impl++`]
--

[.contract-index#AccountComponent-Embeddable-Impls]
.Embeddable Implementations
--
[.sub-index#AccountComponent-Embeddable-Impls-SRC6Impl]
.SRC6Impl

* xref:#AccountComponent-\\__execute__[`++__execute__(self, calls)++`]
* xref:#AccountComponent-\\__validate__[`++__validate__(self, calls)++`]
* xref:#AccountComponent-is_valid_signature[`++is_valid_signature(self, hash, signature)++`]

[.sub-index#AccountComponent-Embeddable-Impls-DeclarerImpl]
.DeclarerImpl

* xref:#AccountComponent-\\__validate_declare__[`++__validate_declare__(self, class_hash)++`]

[.sub-index#AccountComponent-Embeddable-Impls-DeployableImpl]
.DeployableImpl

* xref:#AccountComponent-\\__validate_deploy__[`++__validate_deploy__(self, hash, signature)++`]

[.sub-index#AccountComponent-Embeddable-Impls-PublicKeyImpl]
.PublicKeyImpl

* xref:#AccountComponent-get_public_key[`++get_public_key(self)++`]
* xref:#AccountComponent-set_public_key[`++set_public_key(self, new_public_key)++`]

[.sub-index#AccountComponent-Embeddable-Impls-SRC6CamelOnlyImpl]
.SRC6CamelOnlyImpl

* xref:#AccountComponent-isValidSignature[`++isValidSignature(self, hash, signature)++`]

[.sub-index#AccountComponent-Embeddable-Impls-PublicKeyCamelImpl]
.PublicKeyCamelImpl

* xref:#AccountComponent-getPublicKey[`++getPublicKey(self)++`]
Expand Down Expand Up @@ -290,46 +297,52 @@ NOTE: Implementing xref:api/introspection.adoc#SRC5Component[SRC5Component] is a
NOTE: The `EthPublicKey` type is an alias for `starknet::secp256k1::Secp256k1Point`.

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

--
.EthAccountMixinImpl

* xref:#EthAccountComponent-Embeddable-Impls[`++SRC6Impl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++DeclarerImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++DeployableImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++PublicKeyImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++SRC6CamelOnlyImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++PublicKeyCamelImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls-SRC6Impl[`++SRC6Impl++`]
* xref:#EthAccountComponent-Embeddable-Impls-DeclarerImpl[`++DeclarerImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls-DeployableImpl[`++DeployableImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls-PublicKeyImpl[`++PublicKeyImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls-SRC6CamelOnlyImpl[`++SRC6CamelOnlyImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls-PublicKeyCamelImpl[`++PublicKeyCamelImpl++`]
* xref:api/introspection.adoc#SRC5Component-Embeddable-Impls[`++SRC5Impl++`]
--

[.contract-index#EthAccountComponent-Embeddable-Impls]
.Embeddable Implementations
--
[.sub-index#EthAccountComponent-Embeddable-Impls-SRC6Impl]
.SRC6Impl

* xref:#EthAccountComponent-\\__execute__[`++__execute__(self, calls)++`]
* xref:#EthAccountComponent-\\__validate__[`++__validate__(self, calls)++`]
* xref:#EthAccountComponent-is_valid_signature[`++is_valid_signature(self, hash, signature)++`]

[.sub-index#EthAccountComponent-Embeddable-Impls-DeclarerImpl]
.DeclarerImpl

* xref:#EthAccountComponent-\\__validate_declare__[`++__validate_declare__(self, class_hash)++`]

[.sub-index#EthAccountComponent-Embeddable-Impls-DeployableImpl]
.DeployableImpl

* xref:#EthAccountComponent-\\__validate_deploy__[`++__validate_deploy__(self, hash, signature)++`]

[.sub-index#EthAccountComponent-Embeddable-Impls-PublicKeyImpl]
.PublicKeyImpl

* xref:#EthAccountComponent-get_public_key[`++get_public_key(self)++`]
* xref:#EthAccountComponent-set_public_key[`++set_public_key(self, new_public_key)++`]

[.sub-index#EthAccountComponent-Embeddable-Impls-SRC6CamelOnlyImpl]
.SRC6CamelOnlyImpl

* xref:#EthAccountComponent-isValidSignature[`++isValidSignature(self, hash, signature)++`]

[.sub-index#EthAccountComponent-Embeddable-Impls-PublicKeyCamelImpl]
.PublicKeyCamelImpl

* xref:#EthAccountComponent-getPublicKey[`++getPublicKey(self)++`]
Expand Down Expand Up @@ -518,16 +531,7 @@ include::../utils/_class_hashes.adoc[]
--
.AccountComponent

* xref:#AccountComponent-Embeddable-Impls[`++SRC6Impl++`]
* xref:#AccountComponent-Embeddable-Impls[`++PublicKeyImpl++`]
* xref:#AccountComponent-Embeddable-Impls[`++DeclarerImpl++`]
* xref:#AccountComponent-Embeddable-Impls[`++DeployableImpl++`]
* xref:#AccountComponent-Embeddable-Impls[`++SRC6CamelOnlyImpl++`]
* xref:#AccountComponent-Embeddable-Impls[`++PublicKeyCamelImpl++`]

.SRC5Component

* xref:api/introspection.adoc#SRC5Component-Embeddable-Impls[`++SRC5Impl++`]
* xref:#AccountComponent-Embeddable-Mixin-Impl[`++AccountMixinImpl++`]
--

[#Account-constructor-section]
Expand Down Expand Up @@ -570,16 +574,7 @@ include::../utils/_class_hashes.adoc[]
--
.EthAccountComponent

* xref:#EthAccountComponent-Embeddable-Impls[`++SRC6Impl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++PublicKeyImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++DeclarerImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++DeployableImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++SRC6CamelOnlyImpl++`]
* xref:#EthAccountComponent-Embeddable-Impls[`++PublicKeyCamelImpl++`]

.SRC5Component

* xref:api/introspection.adoc#SRC5Component-Embeddable-Impls[`++SRC5Impl++`]
* xref:#EthAccountComponent-Embeddable-Mixin-Impl[`++EthAccountMixinImpl++`]
--

[.contract-index]
Expand Down
16 changes: 9 additions & 7 deletions docs/modules/ROOT/pages/api/erc20.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:erc20-guide: xref:erc20.adoc[ERC20 guide]
:casing-discussion: https://github.com/OpenZeppelin/cairo-contracts/discussions/34[here]
:custom-decimals: xref:/erc20.adoc#customizing_decimals[Customizing decimals]
:mixin-impl: xref:components.adoc#mixins[Embeddable Mixin Implementation]

= ERC20

Expand Down Expand Up @@ -169,18 +170,19 @@ use openzeppelin::token::erc20::ERC20Component;
ERC20 component extending <<IERC20,IERC20>> and <<IERC20Metadata,IERC20Metadata>>.

[.contract-index#ERC20Component-Embeddable-Mixin-Impl]
.Embeddable Mixin Implementation
.{mixin-impl}

--
.ERC20MixinImpl
* xref:#ERC20Component-Embeddable-Impls[`++ERC20Impl++`]
* xref:#ERC20Component-Embeddable-Impls[`++ERC20MetadataImpl++`]
* xref:#ERC20Component-Embeddable-Impls[`++ERC20CamelOnlyImpl++`]
* xref:#ERC20Component-Embeddable-Impls-ERC20Impl[`++ERC20Impl++`]
* xref:#ERC20Component-Embeddable-Impls-ERC20MetadataImpl[`++ERC20MetadataImpl++`]
* xref:#ERC20Component-Embeddable-Impls-ERC20CamelOnlyImpl[`++ERC20CamelOnlyImpl++`]
--

[.contract-index#ERC20Component-Embeddable-Impls]
.Embeddable Implementations
--
[.sub-index#ERC20Component-Embeddable-Impls-ERC20Impl]
.ERC20Impl
* xref:#ERC20Component-total_supply[`++total_supply(self)++`]
* xref:#ERC20Component-balance_of[`++balance_of(self, account)++`]
Expand All @@ -189,11 +191,13 @@ ERC20 component extending <<IERC20,IERC20>> and <<IERC20Metadata,IERC20Metadata>
* xref:#ERC20Component-transfer_from[`++transfer_from(self, sender, recipient, amount)++`]
* xref:#ERC20Component-approve[`++approve(self, spender, amount)++`]

[.sub-index#ERC20Component-Embeddable-Impls-ERC20MetadataImpl]
.ERC20MetadataImpl
* xref:#ERC20Component-name[`++name(self)++`]
* xref:#ERC20Component-symbol[`++symbol(self)++`]
* xref:#ERC20Component-decimals[`++decimals(self)++`]

[.sub-index#ERC20Component-Embeddable-Impls-ERC20CamelOnlyImpl]
Copy link
Member

Choose a reason for hiding this comment

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

Very nice!

Copy link
Contributor

Choose a reason for hiding this comment

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

indeed! this looks great now

.ERC20CamelOnlyImpl
* xref:#ERC20Component-totalSupply[`++totalSupply(self)++`]
* xref:#ERC20Component-balanceOf[`++balanceOf(self, account)++`]
Expand Down Expand Up @@ -437,9 +441,7 @@ include::../utils/_class_hashes.adoc[]
--
.ERC20MixinImpl

* xref:#ERC20Component-Embeddable-Impls[`++ERC20Impl++`]
* xref:#ERC20Component-Embeddable-Impls[`++ERC20MetadataImpl++`]
* xref:#ERC20Component-Embeddable-Impls[`++ERC20CamelOnlyImpl++`]
* xref:#ERC20Component-Embeddable-Mixin-Impl[`++ERC20MixinImpl++`]
--

[#ERC20-constructor-section]
Expand Down
23 changes: 12 additions & 11 deletions docs/modules/ROOT/pages/api/erc721.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
:receiving-tokens: xref:/erc721.adoc#receiving_tokens[Receiving Tokens]
:casing-discussion: https://github.com/OpenZeppelin/cairo-contracts/discussions/34[here]
:inner-src5: xref:api/introspection.adoc#ISRC5[SRC5 ID]
:mixin-impl: xref:components.adoc#mixins[Embeddable Mixin Implementation]

= ERC721

Expand Down Expand Up @@ -191,20 +192,21 @@ ERC721 component implementing <<IERC721,IERC721>> and <<IERC721Metadata,IERC721M
NOTE: Implementing xref:api/introspection.adoc#SRC5Component[SRC5Component] is a requirement for this component to be implemented.

[.contract-index#ERC721Component-Embeddable-Mixin-Impl]
.Embeddable Mixin Implementation
.{mixin-impl}

--
.ERC721MixinImpl
* xref:#ERC721Component-Embeddable-Impls[`++ERC721Impl++`]
* xref:#ERC721Component-Embeddable-Impls[`++ERC721MetadataImpl++`]
* xref:#ERC721Component-Embeddable-Impls[`++ERC721CamelOnlyImpl++`]
* xref:#ERC721Component-Embeddable-Impls[`++ERC721MetadataCamelOnlyImpl++`]
* xref:#ERC721Component-Embeddable-Impls-ERC721Impl[`++ERC721Impl++`]
* xref:#ERC721Component-Embeddable-Impls-ERC721MetadataImpl[`++ERC721MetadataImpl++`]
* xref:#ERC721Component-Embeddable-Impls-ERC721CamelOnlyImpl[`++ERC721CamelOnlyImpl++`]
* xref:#ERC721Component-Embeddable-Impls-ERC721MetadataCamelOnlyImpl[`++ERC721MetadataCamelOnlyImpl++`]
* xref:api/introspection.adoc#SRC5Component-Embeddable-Impls[`++SRC5Impl++`]
--

[.contract-index#ERC721Component-Embeddable-Impls]
.Embeddable Implementations
--
[.sub-index#ERC721Component-Embeddable-Impls-ERC721Impl]
.ERC721Impl
* xref:#IERC721-balance_of[`++balance_of(self, account)++`]
* xref:#IERC721-owner_of[`++owner_of(self, token_id)++`]
Expand All @@ -215,12 +217,14 @@ NOTE: Implementing xref:api/introspection.adoc#SRC5Component[SRC5Component] is a
* xref:#IERC721-get_approved[`++get_approved(self, token_id)++`]
* xref:#IERC721-is_approved_for_all[`++is_approved_for_all(self, owner, operator)++`]

[.sub-index#ERC721Component-Embeddable-Impls-ERC721MetadataImpl]
.ERC721MetadataImpl
* xref:#IERC721Metadata-name[`++name(self)++`]
* xref:#IERC721Metadata-symbol[`++symbol(self)++`]
* xref:#IERC721Metadata-token_uri[`++token_uri(self, token_id)++`]

.ER721CamelOnlyImpl
[.sub-index#ERC721Component-Embeddable-Impls-ERC721CamelOnlyImpl]
.ERC721CamelOnlyImpl
* xref:#ERC721-balanceOf[`++balanceOf(self, account)++`]
* xref:#ERC721-ownerOf[`++ownerOf(self, tokenId)++`]
* xref:#ERC721-safeTransferFrom[`++safeTransferFrom(self, from, to, tokenId, data)++`]
Expand All @@ -229,6 +233,7 @@ NOTE: Implementing xref:api/introspection.adoc#SRC5Component[SRC5Component] is a
* xref:#ERC721-getApproved[`++getApproved(self, tokenId)++`]
* xref:#ERC721-isApprovedForAll[`++isApprovedForAll(self, owner, operator)++`]

[.sub-index#ERC721Component-Embeddable-Impls-ERC721MetadataCamelOnlyImpl]
.ERC721MetadataCamelOnlyImpl
* xref:#ERC721-tokenURI[`++tokenURI(self, tokenId)++`]

Expand Down Expand Up @@ -638,11 +643,7 @@ include::../utils/_class_hashes.adoc[]
--
.ERC721MixinImpl

* xref:#ERC721Component-Embeddable-Impls[`++ERC721Impl++`]
* xref:#ERC721Component-Embeddable-Impls[`++ERC721MetadataImpl++`]
* xref:#ERC721Component-Embeddable-Impls[`++ERC721CamelOnly++`]
* xref:#ERC721Component-Embeddable-Impls[`++ERC721MetadataCamelOnly++`]
* xref:api/introspection.adoc#SRC5Component-Embeddable-Impls[`++SRC5Impl++`]
* xref:#ERC721Component-Embeddable-Mixin-Impl[`++ERC721MixinImpl++`]
--

[#ERC721-constructor-section]
Expand Down