Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
b72088a9
Commit
b72088a9
authored
Jun 11, 2020
by
Nicolás Venturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'available since' notices
parent
8b58fc71
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
4 deletions
+38
-4
AccessControl.sol
contracts/access/AccessControl.sol
+2
-0
ERC1155.sol
contracts/token/ERC1155/ERC1155.sol
+2
-1
ERC1155Burnable.sol
contracts/token/ERC1155/ERC1155Burnable.sol
+2
-0
ERC1155Holder.sol
contracts/token/ERC1155/ERC1155Holder.sol
+3
-0
ERC1155Pausable.sol
contracts/token/ERC1155/ERC1155Pausable.sol
+2
-0
ERC1155Receiver.sol
contracts/token/ERC1155/ERC1155Receiver.sol
+3
-0
IERC1155.sol
contracts/token/ERC1155/IERC1155.sol
+2
-0
IERC1155MetadataURI.sol
contracts/token/ERC1155/IERC1155MetadataURI.sol
+2
-0
IERC1155Receiver.sol
contracts/token/ERC1155/IERC1155Receiver.sol
+2
-3
Address.sol
contracts/utils/Address.sol
+8
-0
SafeCast.sol
contracts/utils/SafeCast.sol
+10
-0
No files found.
contracts/access/AccessControl.sol
View file @
b72088a9
...
...
@@ -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);
...
...
contracts/token/ERC1155/ERC1155.sol
View file @
b72088a9
...
...
@@ -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;
...
...
contracts/token/ERC1155/ERC1155Burnable.sol
View file @
b72088a9
...
...
@@ -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 {
...
...
contracts/token/ERC1155/ERC1155Holder.sol
View file @
b72088a9
...
...
@@ -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;
...
...
contracts/token/ERC1155/ERC1155Pausable.sol
View file @
b72088a9
...
...
@@ -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 {
/**
...
...
contracts/token/ERC1155/ERC1155Receiver.sol
View file @
b72088a9
...
...
@@ -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(
...
...
contracts/token/ERC1155/IERC1155.sol
View file @
b72088a9
...
...
@@ -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 {
/**
...
...
contracts/token/ERC1155/IERC1155MetadataURI.sol
View file @
b72088a9
...
...
@@ -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 {
/**
...
...
contracts/token/ERC1155/IERC1155Receiver.sol
View file @
b72088a9
...
...
@@ -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 {
/**
...
...
contracts/utils/Address.sol
View file @
b72088a9
...
...
@@ -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");
...
...
contracts/utils/SafeCast.sol
View file @
b72088a9
...
...
@@ -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");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment