Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
bidzyyys committed Jan 17, 2025
1 parent 96bbc2e commit adb2f80
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 57 deletions.
10 changes: 5 additions & 5 deletions contracts/src/access/ownable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ pub trait IOwnable {
///
/// # Errors
///
/// * [`Error::UnauthorizedAccount`] - If not called by the owner, then the error
/// is returned.
/// * [`Error::UnauthorizedAccount`] - If not called by the owner, then the
/// error is returned.
///
/// # Events
///
/// * Emits a [`OwnershipTransferred`] event.
/// * Emits a [`OwnershipTransferred`] event.
fn renounce_ownership(&mut self) -> Result<(), Self::Error>;
}

Expand Down Expand Up @@ -170,8 +170,8 @@ impl Ownable {
///
/// # Errors
///
/// * [`Error::UnauthorizedAccount`] - If called by any account other than the owner, then the error
/// is returned.
/// * [`Error::UnauthorizedAccount`] - If called by any account other than
/// the owner, then the error is returned.
pub fn only_owner(&self) -> Result<(), Error> {
let account = msg::sender();
if self.owner() != account {
Expand Down
34 changes: 17 additions & 17 deletions contracts/src/finance/vesting_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ pub trait IVestingWallet {
///
/// # Errors
///
/// * [`ownable::Error::UnauthorizedAccount`] - If called by any account other than the owner, then the error
/// is returned.
/// * [`ownable::Error::InvalidOwner`] - If `new_owner` is the `Address::ZERO`, then the error
/// is returned.
/// * [`ownable::Error::UnauthorizedAccount`] - If called by any account
/// other than the owner, then the error is returned.
/// * [`ownable::Error::InvalidOwner`] - If `new_owner` is the
/// `Address::ZERO`, then the error is returned.
///
/// # Events
///
Expand All @@ -190,12 +190,12 @@ pub trait IVestingWallet {
///
/// # Errors
///
/// * [`ownable::Error::UnauthorizedAccount`] - If not called by the owner, then the error
/// is returned.
/// * [`ownable::Error::UnauthorizedAccount`] - If not called by the owner,
/// then the error is returned.
///
/// # Events
///
/// * Emits an [`ownable::OwnershipTransferred`] event.
/// * Emits an [`ownable::OwnershipTransferred`] event.
fn renounce_ownership(&mut self) -> Result<(), Self::Error>;

/// The contract should be able to receive Ether.
Expand Down Expand Up @@ -266,8 +266,8 @@ pub trait IVestingWallet {
///
/// # Errors
///
/// * [`Error::InvalidToken`] -If the `token` address is not a contract, then the error
/// is returned.
/// * [`Error::InvalidToken`] -If the `token` address is not a contract,
/// then the error is returned.
///
/// # Panics
///
Expand All @@ -285,8 +285,8 @@ pub trait IVestingWallet {
///
/// # Errors
///
/// * [`Error::ReleaseEtherFailed`] - If Ether transfer fails, then the error is
/// returned.
/// * [`Error::ReleaseEtherFailed`] - If Ether transfer fails, then the
/// error is returned.
///
/// # Events
///
Expand All @@ -308,10 +308,10 @@ pub trait IVestingWallet {
///
/// # Errors
///
/// * [`Error::InvalidToken`] - If the `token` address is not a contract, then the error
/// is returned.
/// * [`safe_erc20::Error::SafeErc20FailedOperation`] - If the contract fails to execute the call, then the error
/// is returned.
/// * [`Error::InvalidToken`] - If the `token` address is not a contract,
/// then the error is returned.
/// * [`safe_erc20::Error::SafeErc20FailedOperation`] - If the contract
/// fails to execute the call, then the error is returned.
///
/// # Events
///
Expand Down Expand Up @@ -350,8 +350,8 @@ pub trait IVestingWallet {
///
/// # Errors
///
/// * [`Error::InvalidToken`] - If the `token` address is not a contract, then the error
/// is returned.
/// * [`Error::InvalidToken`] - If the `token` address is not a contract,
/// then the error is returned.
///
/// # Panics
///
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/token/erc1155/extensions/supply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Erc1155Supply {
/// * Emits a [`erc1155::TransferSingle`] event if the arrays contain one
/// element, and [`erc1155::TransferBatch`] otherwise.
///
/// # Panics
/// # Panics
///
/// * If updated balance and/or supply exceeds `U256::MAX`, may happen
/// during the `mint` operation.
Expand Down
85 changes: 51 additions & 34 deletions contracts/src/token/erc1155/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,10 +669,10 @@ impl Erc1155 {
///
/// # Errors
///
/// * [`Error::InvalidSender`] - If `from` is the `Address::ZERO`, then the error
/// is returned.
/// * [`Error::InsufficientBalance`] - If `value` is greater than the balance of the `from` account,
/// then the error is returned.
/// * [`Error::InvalidSender`] - If `from` is the `Address::ZERO`, then the
/// error is returned.
/// * [`Error::InsufficientBalance`] - If `value` is greater than the
/// balance of the `from` account, then the error is returned.
///
/// # Events
///
Expand Down Expand Up @@ -701,17 +701,18 @@ impl Erc1155 {
///
/// # Errors
///
/// * [`Error::InvalidSender`] - If `from` is the `Address::ZERO`, then the error
/// is returned.
/// * [`Error::InvalidArrayLength`] - If length of `ids` is not equal to length of `values`, then the
/// error is returned.
/// * [`Error::InsufficientBalance`] - If any of the `values` is greater than the balance of the respective
/// token from `tokens` of the `from` account, then the error is returned.
/// * [`Error::InvalidSender`] - If `from` is the `Address::ZERO`, then the
/// error is returned.
/// * [`Error::InvalidArrayLength`] - If length of `ids` is not equal to
/// length of `values`, then the error is returned.
/// * [`Error::InsufficientBalance`] - If any of the `values` is greater
/// than the balance of the respective token from `tokens` of the `from`
/// account, then the error is returned.
///
/// # Events
///
/// * Emits a [`TransferSingle`] event if the arrays contain one element, and
/// [`TransferBatch`] otherwise.
/// * Emits a [`TransferSingle`] event if the arrays contain one element,
/// and [`TransferBatch`] otherwise.
///
/// # Panics
///
Expand All @@ -738,8 +739,8 @@ impl Erc1155 {
///
/// # Errors
///
/// * [`Error::InvalidOperator`] - If `operator` is the `Address::ZERO`, then the error
/// is returned.
/// * [`Error::InvalidOperator`] - If `operator` is the `Address::ZERO`,
/// then the error is returned.
///
/// # Events
///
Expand Down Expand Up @@ -788,10 +789,12 @@ impl Erc1155 {
///
/// # Errors
///
/// * [`Error::InvalidReceiver`] - If [`IERC1155Receiver::on_erc_1155_received`] hasn't returned its
/// * [`Error::InvalidReceiver`] - If
/// [`IERC1155Receiver::on_erc_1155_received`] hasn't returned its
/// interface id or returned with error, then the error
/// is returned.

Check warning on line 795 in contracts/src/token/erc1155/mod.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:795:9 | 795 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 795 | /// is returned. | + Raw Output: contracts/src/token/erc1155/mod.rs:795:9:w:warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:795:9 | 795 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 795 | /// is returned. | + __END__

Check warning on line 795 in contracts/src/token/erc1155/mod.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:795:9 | 795 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 795 | /// is returned. | + Raw Output: contracts/src/token/erc1155/mod.rs:795:9:w:warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:795:9 | 795 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 795 | /// is returned. | + __END__
/// * [`Error::InvalidReceiver`] - If [`IERC1155Receiver::on_erc_1155_batch_received`] hasn't returned its
/// * [`Error::InvalidReceiver`] - If
/// [`IERC1155Receiver::on_erc_1155_batch_received`] hasn't returned its
/// interface id or returned with error, then the error
/// is returned.

Check warning on line 799 in contracts/src/token/erc1155/mod.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:799:9 | 799 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 799 | /// is returned. | + Raw Output: contracts/src/token/erc1155/mod.rs:799:9:w:warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:799:9 | 799 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 799 | /// is returned. | + __END__

Check warning on line 799 in contracts/src/token/erc1155/mod.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:799:9 | 799 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 799 | /// is returned. | + Raw Output: contracts/src/token/erc1155/mod.rs:799:9:w:warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:799:9 | 799 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 799 | /// is returned. | + __END__
fn _check_on_erc1155_received(
Expand Down Expand Up @@ -857,20 +860,25 @@ impl Erc1155 {
///
/// # Errors
///
/// * [`Error::InvalidReceiver`] - If `to` is `Address::ZERO`, then the error
/// * [`Error::InvalidReceiver`] - If `to` is `Address::ZERO`, then the
/// error
/// is returned.

Check warning on line 865 in contracts/src/token/erc1155/mod.rs

View workflow job for this annotation

GitHub Actions / stable / clippy

[clippy] reported by reviewdog 🐶 warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:865:9 | 865 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 865 | /// is returned. | ++ Raw Output: contracts/src/token/erc1155/mod.rs:865:9:w:warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:865:9 | 865 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 865 | /// is returned. | ++ __END__

Check warning on line 865 in contracts/src/token/erc1155/mod.rs

View workflow job for this annotation

GitHub Actions / beta / clippy

[clippy] reported by reviewdog 🐶 warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:865:9 | 865 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 865 | /// is returned. | ++ Raw Output: contracts/src/token/erc1155/mod.rs:865:9:w:warning: doc list item without indentation --> contracts/src/token/erc1155/mod.rs:865:9 | 865 | /// is returned. | ^ | = help: if this is supposed to be its own paragraph, add a blank line = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation help: indent this line | 865 | /// is returned. | ++ __END__
/// * [`Error::InvalidReceiver`] - If [`IERC1155Receiver::on_erc_1155_received`] hasn't returned its
/// * [`Error::InvalidReceiver`] - If
/// [`IERC1155Receiver::on_erc_1155_received`] hasn't returned its
/// interface id or returned with error, then the error
/// is returned.
/// * [`Error::InvalidReceiver`] - If [`IERC1155Receiver::on_erc_1155_batch_received`] hasn't returned its
/// * [`Error::InvalidReceiver`] - If
/// [`IERC1155Receiver::on_erc_1155_batch_received`] hasn't returned its
/// interface id or returned with error, then the error
/// is returned.
/// * [`Error::InvalidArrayLength`] - If length of `ids` is not equal to length of `values`, then the
/// * [`Error::InvalidArrayLength`] - If length of `ids` is not equal to
/// length of `values`, then the
/// error is returned.
///
/// # Events
///
/// * Emits a [`TransferSingle`] event if the arrays contain one element, and
/// * Emits a [`TransferSingle`] event if the arrays contain one element,
/// and
/// [`TransferBatch`] otherwise.
///
/// # Panics
Expand Down Expand Up @@ -909,17 +917,20 @@ impl Erc1155 {
///
/// # Errors
///
/// * [`Error::InvalidSender`] - If `from` is the `Address::ZERO`, then the error
/// * [`Error::InvalidSender`] - If `from` is the `Address::ZERO`, then the
/// error
/// is returned.
/// * [`Error::InvalidArrayLength`] - If length of `ids` is not equal to length of `values`, then the
/// * [`Error::InvalidArrayLength`] - If length of `ids` is not equal to
/// length of `values`, then the
/// error is returned.
/// * [`Error::InsufficientBalance`] -If any of the `values` is greater than the balance of the respective
/// * [`Error::InsufficientBalance`] -If any of the `values` is greater than
/// the balance of the respective
/// token from `tokens` of the `from` account, then the error is returned.
///
/// # Events
///
/// * Emits a [`TransferSingle`] event if the arrays contain one element, and
/// [`TransferBatch`] otherwise.
/// * Emits a [`TransferSingle`] event if the arrays contain one element,
/// and [`TransferBatch`] otherwise.
///
/// # Panics
///
Expand Down Expand Up @@ -959,25 +970,31 @@ impl Erc1155 {
///
/// # Errors
///
/// * [`Error::InvalidReceiver`] - If `to` is the `Address::ZERO`, then the error
/// * [`Error::InvalidReceiver`] - If `to` is the `Address::ZERO`, then the
/// error
/// is returned.
/// * [`Error::InvalidSender`] - If `from` is the `Address::ZERO`, then the error
/// * [`Error::InvalidSender`] - If `from` is the `Address::ZERO`, then the
/// error
/// is returned.
/// * [`Error::InvalidArrayLength`] - If length of `ids` is not equal to length of `values`, then the
/// * [`Error::InvalidArrayLength`] - If length of `ids` is not equal to
/// length of `values`, then the
/// error is returned.
/// * [`Error::InsufficientBalance`] - If `value` is greater than the balance of the `from` account,
/// * [`Error::InsufficientBalance`] - If `value` is greater than the
/// balance of the `from` account,
/// then the error is returned.
/// * [`Error::InvalidReceiver`] - If [`IERC1155Receiver::on_erc_1155_received`] hasn't returned its
/// * [`Error::InvalidReceiver`] - If
/// [`IERC1155Receiver::on_erc_1155_received`] hasn't returned its
/// interface id or returned with error, then the error
/// is returned.
/// * [`Error::InvalidReceiver`] - If [`IERC1155Receiver::on_erc_1155_batch_received`] hasn't returned its
/// * [`Error::InvalidReceiver`] - If
/// [`IERC1155Receiver::on_erc_1155_batch_received`] hasn't returned its
/// interface id or returned with error, then the error
/// is returned.
///
/// # Events
///
/// * Emits a [`TransferSingle`] event if the arrays contain one element, and
/// [`TransferBatch`] otherwise.
/// * Emits a [`TransferSingle`] event if the arrays contain one element,
/// and [`TransferBatch`] otherwise.
///
/// # Panics
///
Expand Down

0 comments on commit adb2f80

Please sign in to comment.