feat(access): add AccessControl #186
reviewdog [clippy] report
reported by reviewdog 🐶
Findings (0)
Filtered Findings (18)
README.md|1 col 3| warning: item in documentation is missing backticks
--> contracts/src/../../README.md:1:3
|
1 | # OpenZeppelin Contracts for Stylus
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
note: the lint level is defined here
--> contracts/src/lib.rs:3:22
|
3 | #![warn(clippy::all, clippy::pedantic)]
| ^^^^^^^^^^^^^^^^
= note: #[warn(clippy::doc_markdown)]
implied by #[warn(clippy::pedantic)]
help: try
|
1 | # OpenZeppelin
Contracts for Stylus
| ~~~~~~~~~~~~~~
README.md|14 col 1| warning: item in documentation is missing backticks
--> contracts/src/../../README.md:14:1
|
14 | OpenZeppelin Contracts for Stylus exists thanks to its contributors. There are
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
14 | OpenZeppelin
Contracts for Stylus exists thanks to its contributors. There are
| ~~~~~~~~~~~~~~
README.md|29 col 1| warning: item in documentation is missing backticks
--> contracts/src/../../README.md:29:1
|
29 | OpenZeppelin Contracts for Stylus is released under the MIT License.
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
29 | OpenZeppelin
Contracts for Stylus is released under the MIT License.
| ~~~~~~~~~~~~~~
contracts/src/erc20/mod.rs|3 col 30| warning: item in documentation is missing backticks
--> contracts/src/erc20/mod.rs:3:30
|
3 | //! We have followed general OpenZeppelin Contracts guidelines: functions
| ^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
|
3 | //! We have followed general OpenZeppelin
Contracts guidelines: functions
| ~~~~~~~~~~~~~~
contracts/src/erc721/mod.rs|291 col 15| warning: this argument is passed by value, but not consumed in the function body
--> contracts/src/erc721/mod.rs:291:15
|
291 | data: Bytes,
| ^^^^^ help: consider taking a reference instead: &Bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
= note: #[warn(clippy::needless_pass_by_value)]
implied by #[warn(clippy::pedantic)]
contracts/src/erc721/mod.rs|457 col 5| warning: this method could have a #[must_use]
attribute
--> contracts/src/erc721/mod.rs:457:5
|
457 | / pub fn is_approved_for_all(
458 | | &self,
459 | | owner: Address,
460 | | operator: Address,
461 | | ) -> bool {
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
= note: #[warn(clippy::must_use_candidate)]
implied by #[warn(clippy::pedantic)]
help: add the attribute
|
457 ~ #[must_use] pub fn is_approved_for_all(
458 + &self,
459 + owner: Address,
460 + operator: Address,
461 ~ ) -> bool {
|
contracts/src/erc721/mod.rs|481 col 5| warning: this method could have a #[must_use]
attribute
--> contracts/src/erc721/mod.rs:481:5
|
481 | pub fn owner_of_inner(&self, token_id: U256) -> Address {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub fn _owner_of_inner(&self, token_id: U256) -> Address
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
contracts/src/erc721/mod.rs|492 col 5| warning: this method could have a #[must_use]
attribute
--> contracts/src/erc721/mod.rs:492:5
|
492 | pub fn get_approved_inner(&self, token_id: U256) -> Address {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: #[must_use] pub fn _get_approved_inner(&self, token_id: U256) -> Address
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
contracts/src/erc721/mod.rs|508 col 5| warning: this method could have a #[must_use]
attribute
--> contracts/src/erc721/mod.rs:508:5
|
508 | / pub fn is_authorized(
509 | | &self,
510 | | owner: Address,
511 | | spender: Address,
512 | | token_id: U256,
513 | | ) -> bool {
| |^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate
help: add the attribute
|
508 ~ #[must_use] pub fn is_authorized(
509 + &self,
510 + owner: Address,
511 + spender: Address,
512 + token_id: U256,
513 ~ ) -> bool {
|
contracts/src/erc721/mod.rs|720 col 15| warning: this argument is passed by value, but not consumed in the function body
--> contracts/src/erc721/mod.rs:720:15
|
720 | data: Bytes,
| ^^^^^ help: consider taking a reference instead: &Bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
contracts/src/erc721/mod.rs|866 col 15| warning: this argument is passed by value, but not consumed in the function body
--> contracts/src/erc721/mod.rs:866:15
|
866 | data: Bytes,
| ^^^^^ help: consider taking a reference instead: &Bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
contracts/src/erc721/mod.rs|1026 col 21| warning: unnecessary !=
operation
--> contracts/src/erc721/mod.rs:1026:21
|
1026 | / if result != IERC721RECEIVER_INTERFACE_ID {
1027 | | Err(ERC721InvalidReceiver { receiver: to }.into())
1028 | | } else {
1029 | | Ok(())
1030 | | }
| |^
|
= help: change to ==
and swap the blocks of the if
/else
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
= note: #[warn(clippy::if_not_else)]
implied by #[warn(clippy::pedantic)]
contracts/src/erc721/mod.rs|13 col 1| warning: missing documentation for a struct field
--> contracts/src/erc721/mod.rs:13:1
|
13 | / sol! {
14 | | /// Emitted when the tokenId
token is transferred from from
to to
.
15 | | ///
16 | | /// * from
- Address from which the token will be transferred.
... |
33 | | event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
34 | | }
| |^
|
note: the lint level is defined here
--> contracts/src/lib.rs:2:9
|
2 | #![warn(missing_docs, unreachable_pub, rust_2021_compatibility)]
| ^^^^^^^^^^^^
= note: this warning originates in the macro sol
(in Nightly builds, run with -Z macro-backtrace for more info)
contracts/src/erc721/mod.rs|36 col 1| warning: missing documentation for a struct field
--> contracts/src/erc721/mod.rs:36:1
|
36 | / sol! {
37 | | /// Indicates that an address can't be an owner.
38 | | /// For example, address(0)
is a forbidden owner in ERC-721. Used in balance queries.
39 | | ///
... |
87 | | error ERC721InvalidOperator(address operator);
88 | | }
| |^
|
= note: this warning originates in the macro sol
(in Nightly builds, run with -Z macro-backtrace for more info)
contracts/src/erc721/mod.rs|118 col 1| warning: missing documentation for a struct
--> contracts/src/erc721/mod.rs:118:1
|
118 | / sol_interface! {
119 | | /// ERC-721 token receiver interface.
120 | | ///
121 | | /// Interface for any contract that wants to support safeTransfers
122 | | /// from ERC-721 asset contracts.
123 | | interface IERC721Receiver {
| |______________^
|
= note: this warning originates in the macro sol_interface
(in Nightly builds, run with -Z macro-backtrace for more info)
contracts/src/erc721/mod.rs|118 col 1| warning: missing documentation for a struct field
--> contracts/src/erc721/mod.rs:118:1
|
118 | / sol_interface! {
119 | | /// ERC-721 token receiver interface.
120 | | ///
121 | | /// Interface for any contract that wants to support safeTransfers
... |
136 | | }
137 | | }
| |^
|
= note: this warning originates in the macro sol_interface
(in Nightly builds, run with -Z macro-backtrace for more info)
contracts/src/erc721/mod.rs|118 col 1| warning: missing documentation for an associated function
--> contracts/src/erc721/mod.rs:118:1
|
118 | / sol_interface! {
119 | | /// ERC-721 token receiver interface.
120 | | ///
121 | | /// Interface for any contract that wants to support safeTransfers
... |
136 | | }
137 | | }
| |^
|
= note: this warning originates in the macro sol_interface
(in Nightly builds, run with -Z macro-backtrace for more info)
contracts/src/erc721/mod.rs|118 col 1| warning: missing documentation for a method
--> contracts/src/erc721/mod.rs:118:1
|
118 | / sol_interface! {
119 | | /// ERC-721 token receiver interface.
120 | | ///
121 | | /// Interface for any contract that wants to support safeTransfers
... |
136 | | }
137 | | }
| |_^
|
= note: this warning originates in the macro sol_interface
(in Nightly builds, run with -Z macro-backtrace for more info)