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
5f72ae71
Commit
5f72ae71
authored
Dec 18, 2020
by
github-actions
Browse files
Options
Browse Files
Download
Plain Diff
Merge upstream openzeppelin-contracts into upstream-patched
parents
c197b134
6be0b410
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
ERC1155Receiver.sol
contracts/token/ERC1155/ERC1155Receiver.sol
+2
-2
Create2.sol
contracts/utils/Create2.sol
+1
-1
EnumerableMap.sol
contracts/utils/EnumerableMap.sol
+4
-4
EnumerableSet.sol
contracts/utils/EnumerableSet.sol
+4
-4
No files found.
contracts/token/ERC1155/ERC1155Receiver.sol
View file @
5f72ae71
...
@@ -11,8 +11,8 @@ import "../../introspection/ERC165.sol";
...
@@ -11,8 +11,8 @@ import "../../introspection/ERC165.sol";
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
constructor() internal {
constructor() internal {
_registerInterface(
_registerInterface(
ERC1155Receiver(
0
).onERC1155Received.selector ^
ERC1155Receiver(
address(0)
).onERC1155Received.selector ^
ERC1155Receiver(
0
).onERC1155BatchReceived.selector
ERC1155Receiver(
address(0)
).onERC1155BatchReceived.selector
);
);
}
}
}
}
contracts/utils/Create2.sol
View file @
5f72ae71
...
@@ -54,6 +54,6 @@ library Create2 {
...
@@ -54,6 +54,6 @@ library Create2 {
bytes32 _data = keccak256(
bytes32 _data = keccak256(
abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)
abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash)
);
);
return address(uint
256(_data
));
return address(uint
160(uint256(_data)
));
}
}
}
}
contracts/utils/EnumerableMap.sol
View file @
5f72ae71
...
@@ -177,7 +177,7 @@ library EnumerableMap {
...
@@ -177,7 +177,7 @@ library EnumerableMap {
* already present.
* already present.
*/
*/
function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
return _set(map._inner, bytes32(key), bytes32(uint256(
value
)));
return _set(map._inner, bytes32(key), bytes32(uint256(
uint160(value)
)));
}
}
/**
/**
...
@@ -214,7 +214,7 @@ library EnumerableMap {
...
@@ -214,7 +214,7 @@ library EnumerableMap {
*/
*/
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
(bytes32 key, bytes32 value) = _at(map._inner, index);
(bytes32 key, bytes32 value) = _at(map._inner, index);
return (uint256(key), address(uint
256(value
)));
return (uint256(key), address(uint
160(uint256(value)
)));
}
}
/**
/**
...
@@ -225,13 +225,13 @@ library EnumerableMap {
...
@@ -225,13 +225,13 @@ library EnumerableMap {
* - `key` must be in the map.
* - `key` must be in the map.
*/
*/
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
return address(uint
256(_get(map._inner, bytes32(key
))));
return address(uint
160(uint256(_get(map._inner, bytes32(key)
))));
}
}
/**
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*/
*/
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
return address(uint
256(_get(map._inner, bytes32(key), errorMessage
)));
return address(uint
160(uint256(_get(map._inner, bytes32(key), errorMessage)
)));
}
}
}
}
contracts/utils/EnumerableSet.sol
View file @
5f72ae71
...
@@ -199,7 +199,7 @@ library EnumerableSet {
...
@@ -199,7 +199,7 @@ library EnumerableSet {
* already present.
* already present.
*/
*/
function add(AddressSet storage set, address value) internal returns (bool) {
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(
value
)));
return _add(set._inner, bytes32(uint256(
uint160(value)
)));
}
}
/**
/**
...
@@ -209,14 +209,14 @@ library EnumerableSet {
...
@@ -209,14 +209,14 @@ library EnumerableSet {
* present.
* present.
*/
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(
value
)));
return _remove(set._inner, bytes32(uint256(
uint160(value)
)));
}
}
/**
/**
* @dev Returns true if the value is in the set. O(1).
* @dev Returns true if the value is in the set. O(1).
*/
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(
value
)));
return _contains(set._inner, bytes32(uint256(
uint160(value)
)));
}
}
/**
/**
...
@@ -237,7 +237,7 @@ library EnumerableSet {
...
@@ -237,7 +237,7 @@ library EnumerableSet {
* - `index` must be strictly less than {length}.
* - `index` must be strictly less than {length}.
*/
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint
256(_at(set._inner, index
)));
return address(uint
160(uint256(_at(set._inner, index)
)));
}
}
...
...
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