Procházet zdrojové kódy

Add 'available since' notices

Nicolás Venturo před 5 roky
rodič
revize
b72088a90a

+ 2 - 0
contracts/access/AccessControl.sol

@@ -59,6 +59,8 @@ abstract contract AccessControl is Context {
      *
      * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
      * {RoleAdminChanged} not being emitted signaling this.
+     *
+     * _Available since v3.1._
      */
     event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
 

+ 2 - 1
contracts/token/ERC1155/ERC1155.sol

@@ -11,11 +11,12 @@ import "../../math/SafeMath.sol";
 import "../../utils/Address.sol";
 
 /**
- * @title Standard ERC1155 token
  *
  * @dev Implementation of the basic standard multi-token.
  * See https://eips.ethereum.org/EIPS/eip-1155
  * Originally based on code by Enjin: https://github.com/enjin/erc-1155
+ *
+ * _Available since v3.1._
  */
 contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
     using SafeMath for uint256;

+ 2 - 0
contracts/token/ERC1155/ERC1155Burnable.sol

@@ -7,6 +7,8 @@ import "./ERC1155.sol";
 /**
  * @dev Extension of {ERC1155} that allows token holders to destroy both their
  * own tokens and those that they have been approved to use.
+ *
+ * _Available since v3.1._
  */
 abstract contract ERC1155Burnable is ERC1155 {
     function burn(address account, uint256 id, uint256 value) public virtual {

+ 3 - 0
contracts/token/ERC1155/ERC1155Holder.sol

@@ -4,6 +4,9 @@ pragma solidity ^0.6.0;
 
 import "./ERC1155Receiver.sol";
 
+/**
+ * @dev _Available since v3.1._
+ */
 contract ERC1155Holder is ERC1155Receiver {
     function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual override returns (bytes4) {
         return this.onERC1155Received.selector;

+ 2 - 0
contracts/token/ERC1155/ERC1155Pausable.sol

@@ -11,6 +11,8 @@ import "../../utils/Pausable.sol";
  * Useful for scenarios such as preventing trades until the end of an evaluation
  * period, or having an emergency switch for freezing all token transfers in the
  * event of a large bug.
+ *
+ * _Available since v3.1._
  */
 abstract contract ERC1155Pausable is ERC1155, Pausable {
     /**

+ 3 - 0
contracts/token/ERC1155/ERC1155Receiver.sol

@@ -5,6 +5,9 @@ pragma solidity ^0.6.0;
 import "./IERC1155Receiver.sol";
 import "../../introspection/ERC165.sol";
 
+/**
+ * @dev _Available since v3.1._
+ */
 abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
     constructor() public {
         _registerInterface(

+ 2 - 0
contracts/token/ERC1155/IERC1155.sol

@@ -7,6 +7,8 @@ import "../../introspection/IERC165.sol";
 /**
  * @dev Required interface of an ERC1155 compliant contract, as defined in the
  * https://eips.ethereum.org/EIPS/eip-1155[EIP].
+ *
+ * _Available since v3.1._
  */
 interface IERC1155 is IERC165 {
     /**

+ 2 - 0
contracts/token/ERC1155/IERC1155MetadataURI.sol

@@ -7,6 +7,8 @@ import "./IERC1155.sol";
 /**
  * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
  * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
+ *
+ * _Available since v3.1._
  */
 interface IERC1155MetadataURI is IERC1155 {
     /**

+ 2 - 3
contracts/token/ERC1155/IERC1155Receiver.sol

@@ -5,9 +5,8 @@ pragma solidity ^0.6.0;
 import "../../introspection/IERC165.sol";
 
 /**
-    @title ERC-1155 Multi Token Receiver Interface
-    @dev See https://eips.ethereum.org/EIPS/eip-1155
-*/
+ * _Available since v3.1._
+ */
 interface IERC1155Receiver is IERC165 {
 
     /**

+ 8 - 0
contracts/utils/Address.sol

@@ -70,6 +70,8 @@ library Address {
      *
      * - `target` must be a contract.
      * - calling `target` with `data` must not revert.
+     *
+     * _Available since v3.1._
      */
     function functionCall(address target, bytes memory data) internal returns (bytes memory) {
       return functionCall(target, data, "Address: low-level call failed");
@@ -78,6 +80,8 @@ library Address {
     /**
      * @dev Same as {Address-functionCall-address-bytes-}, but with
      * `errorMessage` as a fallback revert reason when `target` reverts.
+     *
+     * _Available since v3.1._
      */
     function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
         return _functionCallWithValue(target, data, 0, errorMessage);
@@ -96,6 +100,8 @@ library Address {
      * - `target` must be a contract.
      * - the calling contract must have an ETH balance of at least `value`.
      * - calling `target` with `data` must not revert.
+     *
+     * _Available since v3.1._
      */
     function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
         return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
@@ -104,6 +110,8 @@ library Address {
     /**
      * @dev Same as {Address-functionCallWithValue-address-bytes-uint256-}, but
      * with `errorMessage` as a fallback revert reason when `target` reverts.
+     *
+     * _Available since v3.1._
      */
     function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
         require(address(this).balance >= value, "Address: insufficient balance for call");

+ 10 - 0
contracts/utils/SafeCast.sol

@@ -117,6 +117,8 @@ library SafeCast {
      * Requirements:
      *
      * - input must fit into 128 bits
+     *
+     * _Available since v3.1._
      */
     function toInt128(int256 value) internal pure returns (int128) {
         require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
@@ -133,6 +135,8 @@ library SafeCast {
      * Requirements:
      *
      * - input must fit into 64 bits
+     *
+     * _Available since v3.1._
      */
     function toInt64(int256 value) internal pure returns (int64) {
         require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
@@ -149,6 +153,8 @@ library SafeCast {
      * Requirements:
      *
      * - input must fit into 32 bits
+     *
+     * _Available since v3.1._
      */
     function toInt32(int256 value) internal pure returns (int32) {
         require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
@@ -165,6 +171,8 @@ library SafeCast {
      * Requirements:
      *
      * - input must fit into 16 bits
+     *
+     * _Available since v3.1._
      */
     function toInt16(int256 value) internal pure returns (int16) {
         require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
@@ -181,6 +189,8 @@ library SafeCast {
      * Requirements:
      *
      * - input must fit into 8 bits.
+     *
+     * _Available since v3.1._
      */
     function toInt8(int256 value) internal pure returns (int8) {
         require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");