|
@@ -5,23 +5,20 @@ 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.
|
|
|
|
|
|
-The {Address}, {Arrays}, {Base64} and {Strings} libraries provide more operations related to these native data types, while {SafeCast} adds ways to safely convert between the different signed and unsigned numeric types.
|
|
|
-{Multicall} provides a function to batch together multiple calls in a single external call.
|
|
|
-
|
|
|
-For new data types:
|
|
|
-
|
|
|
- * {EnumerableMap}: like Solidity's https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`] type, 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.
|
|
|
+ * {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.
|
|
|
+ * {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.
|
|
|
|
|
|
[NOTE]
|
|
|
====
|
|
|
Because Solidity does not support generic types, {EnumerableMap} and {EnumerableSet} are specialized to a limited number of key-value types.
|
|
|
-
|
|
|
-As of v3.0, {EnumerableMap} supports `uint256 -> address` (`UintToAddressMap`), and {EnumerableSet} supports `address` and `uint256` (`AddressSet` and `UintSet`).
|
|
|
====
|
|
|
|
|
|
-Finally, {Create2} contains all necessary utilities to safely use the https://blog.openzeppelin.com/getting-the-most-out-of-create2/[`CREATE2` EVM opcode], without having to deal with low-level assembly.
|
|
|
-
|
|
|
== Math
|
|
|
|
|
|
{{Math}}
|
|
@@ -42,6 +39,12 @@ Finally, {Create2} contains all necessary utilities to safely use the https://bl
|
|
|
|
|
|
{{EIP712}}
|
|
|
|
|
|
+== Security
|
|
|
+
|
|
|
+{{ReentrancyGuard}}
|
|
|
+
|
|
|
+{{Pausable}}
|
|
|
+
|
|
|
== 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_.
|