Update docs

This commit is contained in:
github-actions
2024-01-23 18:06:09 +00:00
parent d3848f4c25
commit 63bb51f17d
8 changed files with 686 additions and 15 deletions

View File

@ -1,14 +1,30 @@
:github-icon: pass:[<svg class="icon"><use href="#github-icon"/></svg>]
:ReentrancyGuard: pass:normal[xref:utils.adoc#ReentrancyGuard[`ReentrancyGuard`]]
:Pausable: pass:normal[xref:utils.adoc#Pausable[`Pausable`]]
:SafeCast: pass:normal[xref:utils.adoc#SafeCast[`SafeCast`]]
:Math: pass:normal[xref:utils.adoc#Math[`Math`]]
:SignedMath: pass:normal[xref:utils.adoc#SignedMath[`SignedMath`]]
:Multicall: pass:normal[xref:utils.adoc#Multicall[`Multicall`]]
:Create2: pass:normal[xref:utils.adoc#Create2[`Create2`]]
:SafeCast: pass:normal[xref:utils.adoc#SafeCast[`SafeCast`]]
:ECDSA: pass:normal[xref:utils.adoc#ECDSA[`ECDSA`]]
:MessageHashUtils: pass:normal[xref:utils.adoc#MessageHashUtils[`MessageHashUtils`]]
:SignatureChecker: pass:normal[xref:utils.adoc#SignatureChecker[`SignatureChecker`]]
:MerkleProof: pass:normal[xref:utils.adoc#MerkleProof[`MerkleProof`]]
:EIP712: pass:normal[xref:utils.adoc#EIP712[`EIP712`]]
:ReentrancyGuard: pass:normal[xref:utils.adoc#ReentrancyGuard[`ReentrancyGuard`]]
:Pausable: pass:normal[xref:utils.adoc#Pausable[`Pausable`]]
:Nonces: pass:normal[xref:utils.adoc#Nonces[`Nonces`]]
:BitMaps: pass:normal[xref:utils.adoc#BitMaps[`BitMaps`]]
:EnumerableMap: pass:normal[xref:utils.adoc#EnumerableMap[`EnumerableMap`]]
:EnumerableSet: pass:normal[xref:utils.adoc#EnumerableSet[`EnumerableSet`]]
:EnumerableMap: pass:normal[xref:utils.adoc#EnumerableMap[`EnumerableMap`]]
:DoubleEndedQueue: pass:normal[xref:utils.adoc#DoubleEndedQueue[`DoubleEndedQueue`]]
:Checkpoints: pass:normal[xref:utils.adoc#Checkpoints[`Checkpoints`]]
:Create2: pass:normal[xref:utils.adoc#Create2[`Create2`]]
:Address: pass:normal[xref:utils.adoc#Address[`Address`]]
:Arrays: pass:normal[xref:utils.adoc#Arrays[`Arrays`]]
:Base64: pass:normal[xref:utils.adoc#Base64[`Base64`]]
:Strings: pass:normal[xref:utils.adoc#Strings[`Strings`]]
:ShortString: pass:normal[xref:utils.adoc#ShortString[`ShortString`]]
:StorageSlot: pass:normal[xref:utils.adoc#StorageSlot[`StorageSlot`]]
:Multicall: pass:normal[xref:utils.adoc#Multicall[`Multicall`]]
:Context: pass:normal[xref:utils.adoc#Context[`Context`]]
:EnumerableMap: pass:normal[xref:utils.adoc#EnumerableMap[`EnumerableMap`]]
:EnumerableSet: pass:normal[xref:utils.adoc#EnumerableSet[`EnumerableSet`]]
:xref-Math-tryAdd-uint256-uint256-: xref:utils.adoc#Math-tryAdd-uint256-uint256-
@ -163,6 +179,10 @@
:xref-Pausable-Unpaused-address-: xref:utils.adoc#Pausable-Unpaused-address-
:xref-Pausable-EnforcedPause--: xref:utils.adoc#Pausable-EnforcedPause--
:xref-Pausable-ExpectedPause--: xref:utils.adoc#Pausable-ExpectedPause--
:xref-Nonces-nonces-address-: xref:utils.adoc#Nonces-nonces-address-
:xref-Nonces-_useNonce-address-: xref:utils.adoc#Nonces-_useNonce-address-
:xref-Nonces-_useCheckedNonce-address-uint256-: xref:utils.adoc#Nonces-_useCheckedNonce-address-uint256-
:xref-Nonces-InvalidAccountNonce-address-uint256-: xref:utils.adoc#Nonces-InvalidAccountNonce-address-uint256-
:ERC165Checker: pass:normal[xref:utils.adoc#ERC165Checker[`ERC165Checker`]]
:ERC165: pass:normal[xref:utils.adoc#ERC165[`ERC165`]]
:xref-IERC165-supportsInterface-bytes4-: xref:utils.adoc#IERC165-supportsInterface-bytes4-
@ -336,6 +356,9 @@
:xref-StorageSlot-getBytesSlot-bytes-: xref:utils.adoc#StorageSlot-getBytesSlot-bytes-
:ERC2771Context: pass:normal[xref:metatx.adoc#ERC2771Context[`ERC2771Context`]]
:xref-Multicall-multicall-bytes---: xref:utils.adoc#Multicall-multicall-bytes---
:xref-Context-_msgSender--: xref:utils.adoc#Context-_msgSender--
:xref-Context-_msgData--: xref:utils.adoc#Context-_msgData--
:xref-Context-_contextSuffixLength--: xref:utils.adoc#Context-_contextSuffixLength--
= Utilities
[.readme-notice]
@ -343,14 +366,30 @@ NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/
Miscellaneous contracts and libraries containing utility functions you can use to improve security, work with new data types, or safely use low-level primitives.
* {Math}, {SignedMath}: Implementation of various arithmetic functions.
* {SafeCast}: Checked downcasting functions to avoid silent truncation.
* {ECDSA}, {MessageHashUtils}: Libraries for interacting with ECDSA signatures.
* {SignatureChecker}: A library helper to support regular ECDSA from EOAs as well as ERC-1271 signatures for smart contracts.
* {MerkleProof}: Functions for verifying https://en.wikipedia.org/wiki/Merkle_tree[Merkle Tree] proofs.
* {EIP712}: Contract with functions to allow processing signed typed structure data according to https://eips.ethereum.org/EIPS/eip-712[EIP-712].
* {ReentrancyGuard}: A modifier that can prevent reentrancy during certain functions.
* {Pausable}: A common emergency response mechanism that can pause functionality while a remediation is pending.
* {SafeCast}: Checked downcasting functions to avoid silent truncation.
* {Math}, {SignedMath}: Implementation of various arithmetic functions.
* {Multicall}: Simple way to batch together multiple calls in a single external call.
* {Create2}: Wrapper around the https://blog.openzeppelin.com/getting-the-most-out-of-create2/[`CREATE2` EVM opcode] for safe use without having to deal with low-level assembly.
* {Nonces}: Utility for tracking and verifying address nonces that only increment.
* {ERC165, ERC165Checker}: Utilities for inspecting interfaces supported by contracts.
* {BitMaps}: A simple library to manage boolean value mapped to a numerical index in an efficient way.
* {EnumerableMap}: A type like Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`], but with key-value _enumeration_: this will let you know how many entries a mapping has, and iterate over them (which is not possible with `mapping`).
* {EnumerableSet}: Like {EnumerableMap}, but for https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets]. Can be used to store privileged accounts, issued IDs, etc.
* {DoubleEndedQueue}: An implementation of a https://en.wikipedia.org/wiki/Double-ended_queue[double ended queue] whose values can be removed added or remove from both sides. Useful for FIFO and LIFO structures.
* {Checkpoints}: A data structure to store values mapped to an strictly increasing key. Can be used for storing and accessing values over time.
* {Create2}: Wrapper around the https://blog.openzeppelin.com/getting-the-most-out-of-create2/[`CREATE2` EVM opcode] for safe use without having to deal with low-level assembly.
* {Address}: Collection of functions for overloading Solidity's https://docs.soliditylang.org/en/latest/types.html#address[`address`] type.
* {Arrays}: Collection of functions that operate on https://docs.soliditylang.org/en/latest/types.html#arrays[`arrays`].
* {Base64}: On-chain base64 and base64URL encoding according to https://datatracker.ietf.org/doc/html/rfc4648[RFC-4648].
* {Strings}: Common operations for strings formatting.
* {ShortString}: Library to encode (and decode) short strings into (or from) a single bytes32 slot for optimizing costs. Short strings are limited to 31 characters.
* {StorageSlot}: Methods for accessing specific storage slots formatted as common primitive types.
* {Multicall}: Abstract contract with an utility to allow batching together multiple calls in a single transaction. Useful for allowing EOAs to perform multiple operations at once.
* {Context}: An utility for abstracting the sender and calldata in the current execution context.
[NOTE]
====
@ -2412,6 +2451,64 @@ The operation failed because the contract is paused.
The operation failed because the contract is not paused.
:InvalidAccountNonce: pass:normal[xref:#Nonces-InvalidAccountNonce-address-uint256-[`++InvalidAccountNonce++`]]
:nonces: pass:normal[xref:#Nonces-nonces-address-[`++nonces++`]]
:_useNonce: pass:normal[xref:#Nonces-_useNonce-address-[`++_useNonce++`]]
:_useCheckedNonce: pass:normal[xref:#Nonces-_useCheckedNonce-address-uint256-[`++_useCheckedNonce++`]]
[.contract]
[[Nonces]]
=== `++Nonces++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Nonces.sol[{github-icon},role=heading-link]
[.hljs-theme-light.nopadding]
```solidity
import "@openzeppelin/contracts/utils/Nonces.sol";
```
Provides tracking nonces for addresses. Nonces will only increment.
[.contract-index]
.Functions
--
* {xref-Nonces-nonces-address-}[`++nonces(owner)++`]
* {xref-Nonces-_useNonce-address-}[`++_useNonce(owner)++`]
* {xref-Nonces-_useCheckedNonce-address-uint256-}[`++_useCheckedNonce(owner, nonce)++`]
--
[.contract-index]
.Errors
--
* {xref-Nonces-InvalidAccountNonce-address-uint256-}[`++InvalidAccountNonce(account, currentNonce)++`]
--
[.contract-item]
[[Nonces-nonces-address-]]
==== `[.contract-item-name]#++nonces++#++(address owner) → uint256++` [.item-kind]#public#
Returns the next unused nonce for an address.
[.contract-item]
[[Nonces-_useNonce-address-]]
==== `[.contract-item-name]#++_useNonce++#++(address owner) → uint256++` [.item-kind]#internal#
Consumes a nonce.
Returns the current value and increments nonce.
[.contract-item]
[[Nonces-_useCheckedNonce-address-uint256-]]
==== `[.contract-item-name]#++_useCheckedNonce++#++(address owner, uint256 nonce)++` [.item-kind]#internal#
Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
[.contract-item]
[[Nonces-InvalidAccountNonce-address-uint256-]]
==== `[.contract-item-name]#++InvalidAccountNonce++#++(address account, uint256 currentNonce)++` [.item-kind]#error#
The nonce used for an `account` is not the expected current nonce.
== Introspection
This set of interfaces and contracts deal with https://en.wikipedia.org/wiki/Type_introspection[type introspection] of contracts, that is, examining which functions can be called on them. This is usually referred to as a contract's _interface_.
@ -4505,3 +4602,46 @@ to the subcall. This makes it safe to use with {ERC2771Context}. Contexts that d
Receives and executes a batch of function calls on this contract.
:_msgSender: pass:normal[xref:#Context-_msgSender--[`++_msgSender++`]]
:_msgData: pass:normal[xref:#Context-_msgData--[`++_msgData++`]]
:_contextSuffixLength: pass:normal[xref:#Context-_contextSuffixLength--[`++_contextSuffixLength++`]]
[.contract]
[[Context]]
=== `++Context++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v5.0.1/contracts/utils/Context.sol[{github-icon},role=heading-link]
[.hljs-theme-light.nopadding]
```solidity
import "@openzeppelin/contracts/utils/Context.sol";
```
Provides information about the current execution context, including the
sender of the transaction and its data. While these are generally available
via msg.sender and msg.data, they should not be accessed in such a direct
manner, since when dealing with meta-transactions the account sending and
paying for execution may not be the actual sender (as far as an application
is concerned).
This contract is only required for intermediate, library-like contracts.
[.contract-index]
.Functions
--
* {xref-Context-_msgSender--}[`++_msgSender()++`]
* {xref-Context-_msgData--}[`++_msgData()++`]
* {xref-Context-_contextSuffixLength--}[`++_contextSuffixLength()++`]
--
[.contract-item]
[[Context-_msgSender--]]
==== `[.contract-item-name]#++_msgSender++#++() → address++` [.item-kind]#internal#
[.contract-item]
[[Context-_msgData--]]
==== `[.contract-item-name]#++_msgData++#++() → bytes++` [.item-kind]#internal#
[.contract-item]
[[Context-_contextSuffixLength--]]
==== `[.contract-item-name]#++_contextSuffixLength++#++() → uint256++` [.item-kind]#internal#