-
Notifications
You must be signed in to change notification settings - Fork 34
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: make Rust docs consistent #497
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for contracts-stylus canceled.
|
I also added * mark befor each event |
@DarkLord017 you should also fix the failing CI |
Okay |
1 similar comment
Okay |
You can review it now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job @DarkLord017.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you ! |
/// NOTE: The ERC-1155 acceptance check is not performed in this function. | ||
/// See [`Self::_update_with_acceptance_check`] instead. | ||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did a great job @DarkLord017 , most of the comments I left are related to fine-tuning the details of the original issue requirements.
Sometimes we notice the changes we want to make only once the PR is created.
/// NOTE: In order to have [`Erc1155UriStorage::uri`] exposed in ABI, | ||
/// you need to do this manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// NOTE: In order to have [`Erc1155UriStorage::uri`] exposed in ABI, | |
/// you need to do this manually. | |
/// NOTE: To expose this function in your contract's ABI, implement it as | |
/// shown in the Examples section below, accepting only the `token_id` | |
/// parameter. The `metadata_uri` reference should come from your contract's | |
/// state. The implementation should forward the call to your internal | |
/// storage instance along with the metadata reference. |
This updated NOTE section is much clearer.
All similar NOTE sections should be updated in a similar manner.
@0xNeshi , You can review it now should i remove the |
done ! @0xNeshi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I think we're close to getting this merged
@@ -15,26 +15,26 @@ pub trait IErc20Burnable { | |||
/// Destroys a `value` amount of tokens from the caller, lowering the total | |||
/// supply. | |||
/// | |||
/// Relies on the `update` mechanism. | |||
/// NOTE: Relies on the `update` mechanism. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DarkLord017 you can remove these notes
/// # Requirements | ||
/// | ||
/// * `token_id` must exist. | ||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DarkLord017 remove all requirement sections
@@ -3,7 +3,7 @@ | |||
use alloy_primitives::{Address, U256}; | |||
use stylus_sdk::msg; | |||
|
|||
use crate::token::erc20::{Erc20, Error}; | |||
use crate::token::erc20::{self, Erc20, Error}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use crate::token::erc20::{self, Erc20, Error}; | |
use crate::token::erc20::{self, Erc20}; |
Let's remove this Error
import, and reference it like type Error = erc20::Error
- makes it clearer that we're reusing ERC-20 errors
@@ -3,7 +3,7 @@ | |||
use alloy_primitives::{Address, U256}; | |||
use stylus_sdk::msg; | |||
|
|||
use crate::token::erc721::{Erc721, Error}; | |||
use crate::token::erc721::{self, Erc721, Error}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use crate::token::erc721::{self, Erc721, Error}; | |
use crate::token::erc721::{self, Erc721}; |
Same as in previous comment
@@ -99,7 +102,7 @@ impl Erc721Metadata { | |||
/// | |||
/// * [`Error::NonexistentToken`] - If the token does not exist. | |||
/// | |||
/// # Example | |||
/// # Examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other singular occurrences to update, do a global search in the repo
/// NOTE: In order to have [`Erc1155UriStorage::uri`] exposed in ABI, | ||
/// you need to do this manually. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other occurrences of:
/// NOTE: In order to have [`...`] exposed in
/// ABI, you need to do this manually.
You can do a global search, and update all of them
Resolves #476
PR Checklist