Skip to content

Commit

Permalink
docs: add links explaining undefined behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi committed Dec 26, 2024
1 parent 627fd17 commit dbfc6cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/src/utils/nonces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ impl Nonces {
///
/// # Safety
///
/// the function will experience **undefined behavior**, if the nonce for
/// the function will experience [undefined behavior], if the nonce for
/// the given `owner` has reached the maximum value representable by `U256`.
/// Extreme caution should be taken to ensure overflow cannot occur.
///
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
pub fn use_nonce(&mut self, owner: Address) -> U256 {
let nonce = self._nonces.get(owner);

Expand All @@ -89,14 +91,16 @@ impl Nonces {
///
/// # Safety
///
/// the function will experience **undefined behavior**, if the nonce for
/// the function will experience [undefined behavior], if the nonce for
/// the given `owner` has reached the maximum value representable by `U256`.
/// Extreme caution should be taken to ensure overflow cannot occur.
///
/// # Errors
///
/// Returns an error if the `nonce` is not the next valid nonce for the
/// owner.
///
/// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
pub fn use_checked_nonce(
&mut self,
owner: Address,
Expand Down

0 comments on commit dbfc6cb

Please sign in to comment.