Commit b72088a9 by Nicolás Venturo

Add 'available since' notices

parent 8b58fc71
...@@ -59,6 +59,8 @@ abstract contract AccessControl is Context { ...@@ -59,6 +59,8 @@ abstract contract AccessControl is Context {
* *
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this. * {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/ */
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
......
...@@ -11,11 +11,12 @@ import "../../math/SafeMath.sol"; ...@@ -11,11 +11,12 @@ import "../../math/SafeMath.sol";
import "../../utils/Address.sol"; import "../../utils/Address.sol";
/** /**
* @title Standard ERC1155 token
* *
* @dev Implementation of the basic standard multi-token. * @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155 * See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/ */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using SafeMath for uint256; using SafeMath for uint256;
......
...@@ -7,6 +7,8 @@ import "./ERC1155.sol"; ...@@ -7,6 +7,8 @@ import "./ERC1155.sol";
/** /**
* @dev Extension of {ERC1155} that allows token holders to destroy both their * @dev Extension of {ERC1155} that allows token holders to destroy both their
* own tokens and those that they have been approved to use. * own tokens and those that they have been approved to use.
*
* _Available since v3.1._
*/ */
abstract contract ERC1155Burnable is ERC1155 { abstract contract ERC1155Burnable is ERC1155 {
function burn(address account, uint256 id, uint256 value) public virtual { function burn(address account, uint256 id, uint256 value) public virtual {
......
...@@ -4,6 +4,9 @@ pragma solidity ^0.6.0; ...@@ -4,6 +4,9 @@ pragma solidity ^0.6.0;
import "./ERC1155Receiver.sol"; import "./ERC1155Receiver.sol";
/**
* @dev _Available since v3.1._
*/
contract ERC1155Holder is ERC1155Receiver { contract ERC1155Holder is ERC1155Receiver {
function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual override returns (bytes4) { function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual override returns (bytes4) {
return this.onERC1155Received.selector; return this.onERC1155Received.selector;
......
...@@ -11,6 +11,8 @@ import "../../utils/Pausable.sol"; ...@@ -11,6 +11,8 @@ import "../../utils/Pausable.sol";
* Useful for scenarios such as preventing trades until the end of an evaluation * 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 * period, or having an emergency switch for freezing all token transfers in the
* event of a large bug. * event of a large bug.
*
* _Available since v3.1._
*/ */
abstract contract ERC1155Pausable is ERC1155, Pausable { abstract contract ERC1155Pausable is ERC1155, Pausable {
/** /**
......
...@@ -5,6 +5,9 @@ pragma solidity ^0.6.0; ...@@ -5,6 +5,9 @@ pragma solidity ^0.6.0;
import "./IERC1155Receiver.sol"; import "./IERC1155Receiver.sol";
import "../../introspection/ERC165.sol"; import "../../introspection/ERC165.sol";
/**
* @dev _Available since v3.1._
*/
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
constructor() public { constructor() public {
_registerInterface( _registerInterface(
......
...@@ -7,6 +7,8 @@ import "../../introspection/IERC165.sol"; ...@@ -7,6 +7,8 @@ import "../../introspection/IERC165.sol";
/** /**
* @dev Required interface of an ERC1155 compliant contract, as defined in the * @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP]. * https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/ */
interface IERC1155 is IERC165 { interface IERC1155 is IERC165 {
/** /**
......
...@@ -7,6 +7,8 @@ import "./IERC1155.sol"; ...@@ -7,6 +7,8 @@ import "./IERC1155.sol";
/** /**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/ */
interface IERC1155MetadataURI is IERC1155 { interface IERC1155MetadataURI is IERC1155 {
/** /**
......
...@@ -5,9 +5,8 @@ pragma solidity ^0.6.0; ...@@ -5,9 +5,8 @@ pragma solidity ^0.6.0;
import "../../introspection/IERC165.sol"; import "../../introspection/IERC165.sol";
/** /**
@title ERC-1155 Multi Token Receiver Interface * _Available since v3.1._
@dev See https://eips.ethereum.org/EIPS/eip-1155 */
*/
interface IERC1155Receiver is IERC165 { interface IERC1155Receiver is IERC165 {
/** /**
......
...@@ -70,6 +70,8 @@ library Address { ...@@ -70,6 +70,8 @@ library Address {
* *
* - `target` must be a contract. * - `target` must be a contract.
* - calling `target` with `data` must not revert. * - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/ */
function functionCall(address target, bytes memory data) internal returns (bytes memory) { function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed"); return functionCall(target, data, "Address: low-level call failed");
...@@ -78,6 +80,8 @@ library Address { ...@@ -78,6 +80,8 @@ library Address {
/** /**
* @dev Same as {Address-functionCall-address-bytes-}, but with * @dev Same as {Address-functionCall-address-bytes-}, but with
* `errorMessage` as a fallback revert reason when `target` reverts. * `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) { function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage); return _functionCallWithValue(target, data, 0, errorMessage);
...@@ -96,6 +100,8 @@ library Address { ...@@ -96,6 +100,8 @@ library Address {
* - `target` must be a contract. * - `target` must be a contract.
* - the calling contract must have an ETH balance of at least `value`. * - the calling contract must have an ETH balance of at least `value`.
* - calling `target` with `data` must not revert. * - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/ */
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { 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"); return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
...@@ -104,6 +110,8 @@ library Address { ...@@ -104,6 +110,8 @@ library Address {
/** /**
* @dev Same as {Address-functionCallWithValue-address-bytes-uint256-}, but * @dev Same as {Address-functionCallWithValue-address-bytes-uint256-}, but
* with `errorMessage` as a fallback revert reason when `target` reverts. * 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) { 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"); require(address(this).balance >= value, "Address: insufficient balance for call");
......
...@@ -117,6 +117,8 @@ library SafeCast { ...@@ -117,6 +117,8 @@ library SafeCast {
* Requirements: * Requirements:
* *
* - input must fit into 128 bits * - input must fit into 128 bits
*
* _Available since v3.1._
*/ */
function toInt128(int256 value) internal pure returns (int128) { function toInt128(int256 value) internal pure returns (int128) {
require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits"); require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
...@@ -133,6 +135,8 @@ library SafeCast { ...@@ -133,6 +135,8 @@ library SafeCast {
* Requirements: * Requirements:
* *
* - input must fit into 64 bits * - input must fit into 64 bits
*
* _Available since v3.1._
*/ */
function toInt64(int256 value) internal pure returns (int64) { function toInt64(int256 value) internal pure returns (int64) {
require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits"); require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
...@@ -149,6 +153,8 @@ library SafeCast { ...@@ -149,6 +153,8 @@ library SafeCast {
* Requirements: * Requirements:
* *
* - input must fit into 32 bits * - input must fit into 32 bits
*
* _Available since v3.1._
*/ */
function toInt32(int256 value) internal pure returns (int32) { function toInt32(int256 value) internal pure returns (int32) {
require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits"); require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
...@@ -165,6 +171,8 @@ library SafeCast { ...@@ -165,6 +171,8 @@ library SafeCast {
* Requirements: * Requirements:
* *
* - input must fit into 16 bits * - input must fit into 16 bits
*
* _Available since v3.1._
*/ */
function toInt16(int256 value) internal pure returns (int16) { function toInt16(int256 value) internal pure returns (int16) {
require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits"); require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
...@@ -181,6 +189,8 @@ library SafeCast { ...@@ -181,6 +189,8 @@ library SafeCast {
* Requirements: * Requirements:
* *
* - input must fit into 8 bits. * - input must fit into 8 bits.
*
* _Available since v3.1._
*/ */
function toInt8(int256 value) internal pure returns (int8) { function toInt8(int256 value) internal pure returns (int8) {
require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits"); require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment