Skip to content

Commit 6cd0269

Browse files
Transpile a34d986
1 parent 1f88056 commit 6cd0269

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

CHANGELOG.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
The following contracts and libraries were added:
88

99
- `AccessManager`: A consolidated system for managing access control in complex systems.
10-
- `AccessManaged`: A module for connecting a contract to an authority in charge of its access control.
11-
- `GovernorTimelockAccess`: An adapter for time-locking governance proposals using an `AccessManager`.
12-
- `AuthorityUtils`: A library of utilities for interacting with authority contracts.
10+
- `AccessManaged`: A module for connecting a contract to an authority in charge of its access control.
11+
- `GovernorTimelockAccess`: An adapter for time-locking governance proposals using an `AccessManager`.
12+
- `AuthorityUtils`: A library of utilities for interacting with authority contracts.
1313
- `GovernorStorage`: A Governor module that stores proposal details in storage.
1414
- `ERC2771Forwarder`: An ERC2771 forwarder for meta transactions.
1515
- `ERC1967Utils`: A library with ERC1967 events, errors and getters.
1616
- `Nonces`: An abstraction for managing account nonces.
1717
- `MessageHashUtils`: A library for producing digests for ECDSA operations.
18-
- `Time`: A library with helpers for manipulating time-related objects.
18+
- `Time`: A library with helpers for manipulating time-related objects.
1919

2020
### Removals Summary
2121

2222
The following contracts, libraries, and functions were removed:
23-
23+
2424
- `Address.isContract` (because of its ambiguous nature and potential for misuse)
2525
- `Checkpoints.History`
2626
- `Counters`
@@ -127,7 +127,7 @@ These removals were implemented in the following PRs: [#3637](https://github.com
127127
- `ERC1155`: Removed check for address zero in `balanceOf`. ([#4263](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4263))
128128
- `ERC1155`: Optimized array accesses by skipping bounds checking when unnecessary. ([#4300](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4300))
129129
- `ERC1155`: Bubble errors triggered in the `onERC1155Received` and `onERC1155BatchReceived` hooks. ([#4314](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4314))
130-
- `ERC1155Supply`: Added a `totalSupply()` function that returns the total amount of token circulating, this change will restrict the total tokens minted across all ids to 2**256-1 . ([#3962](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3962))
130+
- `ERC1155Supply`: Added a `totalSupply()` function that returns the total amount of token circulating, this change will restrict the total tokens minted across all ids to 2\*\*256-1 . ([#3962](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3962))
131131
- `ERC1155Receiver`: Removed in favor of `ERC1155Holder`. ([#4450](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4450))
132132

133133
#### Utils
@@ -194,6 +194,27 @@ function supportsInterface(bytes4 interfaceId) public view virtual override retu
194194
}
195195
```
196196

197+
#### SafeMath
198+
199+
Methods in SafeMath superseded by native overflow checks in Solidity 0.8.0 were removed along with operations providing an interface for revert strings. The remaining methods were moved to `utils/Math.sol`.
200+
201+
```diff
202+
- import "@openzeppelin/contracts/utils/math/SafeMath.sol";
203+
+ import "@openzeppelin/contracts/utils/math/Math.sol";
204+
205+
function tryOperations(uint256 x, uint256 y) external view {
206+
- (bool overflowsAdd, uint256 resultAdd) = SafeMath.tryAdd(x, y);
207+
+ (bool overflowsAdd, uint256 resultAdd) = Math.tryAdd(x, y);
208+
- (bool overflowsSub, uint256 resultSub) = SafeMath.trySub(x, y);
209+
+ (bool overflowsSub, uint256 resultSub) = Math.trySub(x, y);
210+
- (bool overflowsMul, uint256 resultMul) = SafeMath.tryMul(x, y);
211+
+ (bool overflowsMul, uint256 resultMul) = Math.tryMul(x, y);
212+
- (bool overflowsDiv, uint256 resultDiv) = SafeMath.tryDiv(x, y);
213+
+ (bool overflowsDiv, uint256 resultDiv) = Math.tryDiv(x, y);
214+
// ...
215+
}
216+
```
217+
197218
#### Adapting Governor modules
198219

199220
Custom Governor modules that override internal functions may require modifications if migrated to v5. In particular, the new internal functions `_queueOperations` and `_executeOperations` may need to be used. If assistance with this migration is needed reach out via the [OpenZeppelin Support Forum](https://forum.openzeppelin.com/c/support/contracts/18).
@@ -209,7 +230,7 @@ The `ECDSA` library is now focused on signer recovery. Previously it also includ
209230
contract Verifier {
210231
using ECDSA for bytes32;
211232
+ using MessageHashUtils for bytes32;
212-
233+
213234
function _verify(bytes32 data, bytes memory signature, address account) internal pure returns (bool) {
214235
return data
215236
.toEthSignedMessageHash()

lib/openzeppelin-contracts

0 commit comments

Comments
 (0)