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
d5b3189a
Commit
d5b3189a
authored
Feb 02, 2021
by
github-actions
Browse files
Options
Browse Files
Download
Plain Diff
Merge upstream openzeppelin-contracts into upstream-patched
parents
bc6886c2
63a0343d
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
28 additions
and
2 deletions
+28
-2
EIP712.sol
contracts/drafts/EIP712.sol
+2
-0
ERC20Permit.sol
contracts/drafts/ERC20Permit.sol
+2
-0
ERC165Checker.sol
contracts/introspection/ERC165Checker.sol
+2
-0
SafeMath.sol
contracts/math/SafeMath.sol
+10
-0
ERC20PresetFixedSupply.sol
contracts/presets/ERC20PresetFixedSupply.sol
+2
-0
ERC777PresetFixedSupply.sol
contracts/presets/ERC777PresetFixedSupply.sol
+2
-0
BeaconProxy.sol
contracts/proxy/BeaconProxy.sol
+2
-0
Clones.sol
contracts/proxy/Clones.sol
+2
-0
Address.sol
contracts/utils/Address.sol
+2
-2
EnumerableMap.sol
contracts/utils/EnumerableMap.sol
+2
-0
No files found.
contracts/drafts/EIP712.sol
View file @
d5b3189a
...
@@ -18,6 +18,8 @@ pragma solidity >=0.6.0 <0.8.0;
...
@@ -18,6 +18,8 @@ pragma solidity >=0.6.0 <0.8.0;
*
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* _Available since v3.4._
*/
*/
abstract contract EIP712 {
abstract contract EIP712 {
/* solhint-disable var-name-mixedcase */
/* solhint-disable var-name-mixedcase */
...
...
contracts/drafts/ERC20Permit.sol
View file @
d5b3189a
...
@@ -15,6 +15,8 @@ import "./EIP712.sol";
...
@@ -15,6 +15,8 @@ import "./EIP712.sol";
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
* presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
* need to send a transaction, and thus is not required to hold Ether at all.
*
* _Available since v3.4._
*/
*/
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
using Counters for Counters.Counter;
using Counters for Counters.Counter;
...
...
contracts/introspection/ERC165Checker.sol
View file @
d5b3189a
...
@@ -47,6 +47,8 @@ library ERC165Checker {
...
@@ -47,6 +47,8 @@ library ERC165Checker {
* is that some interfaces may not be supported.
* is that some interfaces may not be supported.
*
*
* See {IERC165-supportsInterface}.
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
*/
function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) {
function getSupportedInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool[] memory) {
// an array of booleans corresponding to interfaceIds and whether they're supported or not
// an array of booleans corresponding to interfaceIds and whether they're supported or not
...
...
contracts/math/SafeMath.sol
View file @
d5b3189a
...
@@ -18,6 +18,8 @@ pragma solidity >=0.6.0 <0.8.0;
...
@@ -18,6 +18,8 @@ pragma solidity >=0.6.0 <0.8.0;
library SafeMath {
library SafeMath {
/**
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
uint256 c = a + b;
...
@@ -27,6 +29,8 @@ library SafeMath {
...
@@ -27,6 +29,8 @@ library SafeMath {
/**
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
if (b > a) return (false, 0);
...
@@ -35,6 +39,8 @@ library SafeMath {
...
@@ -35,6 +39,8 @@ library SafeMath {
/**
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
...
@@ -48,6 +54,8 @@ library SafeMath {
...
@@ -48,6 +54,8 @@ library SafeMath {
/**
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
if (b == 0) return (false, 0);
...
@@ -56,6 +64,8 @@ library SafeMath {
...
@@ -56,6 +64,8 @@ library SafeMath {
/**
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
if (b == 0) return (false, 0);
...
...
contracts/presets/ERC20PresetFixedSupply.sol
View file @
d5b3189a
...
@@ -12,6 +12,8 @@ import "../token/ERC20/ERC20Burnable.sol";
...
@@ -12,6 +12,8 @@ import "../token/ERC20/ERC20Burnable.sol";
*
*
* This contract uses {ERC20Burnable} to include burn capabilities - head to
* This contract uses {ERC20Burnable} to include burn capabilities - head to
* its documentation for details.
* its documentation for details.
*
* _Available since v3.4._
*/
*/
contract ERC20PresetFixedSupply is ERC20Burnable {
contract ERC20PresetFixedSupply is ERC20Burnable {
/**
/**
...
...
contracts/presets/ERC777PresetFixedSupply.sol
View file @
d5b3189a
...
@@ -8,6 +8,8 @@ import "../token/ERC777/ERC777.sol";
...
@@ -8,6 +8,8 @@ import "../token/ERC777/ERC777.sol";
*
*
* - Preminted initial supply
* - Preminted initial supply
* - No access control mechanism (for minting/pausing) and hence no governance
* - No access control mechanism (for minting/pausing) and hence no governance
*
* _Available since v3.4._
*/
*/
contract ERC777PresetFixedSupply is ERC777 {
contract ERC777PresetFixedSupply is ERC777 {
/**
/**
...
...
contracts/proxy/BeaconProxy.sol
View file @
d5b3189a
...
@@ -11,6 +11,8 @@ import "./IBeacon.sol";
...
@@ -11,6 +11,8 @@ import "./IBeacon.sol";
*
*
* The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't
* The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't
* conflict with the storage layout of the implementation behind the proxy.
* conflict with the storage layout of the implementation behind the proxy.
*
* _Available since v3.4._
*/
*/
contract BeaconProxy is Proxy {
contract BeaconProxy is Proxy {
/**
/**
...
...
contracts/proxy/Clones.sol
View file @
d5b3189a
...
@@ -12,6 +12,8 @@ pragma solidity >=0.6.0 <0.8.0;
...
@@ -12,6 +12,8 @@ pragma solidity >=0.6.0 <0.8.0;
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
* deterministic method.
*
* _Available since v3.4._
*/
*/
library Clones {
library Clones {
/**
/**
...
...
contracts/utils/Address.sol
View file @
d5b3189a
...
@@ -148,7 +148,7 @@ library Address {
...
@@ -148,7 +148,7 @@ library Address {
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
* but performing a delegate call.
*
*
* _Available since v3.
3
._
* _Available since v3.
4
._
*/
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
...
@@ -158,7 +158,7 @@ library Address {
...
@@ -158,7 +158,7 @@ library Address {
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
* but performing a delegate call.
*
*
* _Available since v3.
3
._
* _Available since v3.
4
._
*/
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
require(isContract(target), "Address: delegate call to non-contract");
...
...
contracts/utils/EnumerableMap.sol
View file @
d5b3189a
...
@@ -235,6 +235,8 @@ library EnumerableMap {
...
@@ -235,6 +235,8 @@ library EnumerableMap {
/**
/**
* @dev Tries to returns the value associated with `key`. O(1).
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
* Does not revert if `key` is not in the map.
*
* _Available since v3.4._
*/
*/
function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
(bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
(bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
...
...
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