1
1
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
2
2
deleted file mode 100644
3
- index 35ad097f..00000000
3
+ index 35ad097ff..000000000
4
4
--- a/.github/ISSUE_TEMPLATE/bug_report.md
5
5
+++ /dev/null
6
6
@@ -1,21 +0,0 @@
@@ -26,7 +26,7 @@ index 35ad097f..00000000
26
26
-
27
27
- <!-- We will be able to better help if you provide a minimal example that triggers the bug. -->
28
28
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
29
- index 4018cef2..d343a53d 100644
29
+ index 4018cef29..d343a53d8 100644
30
30
--- a/.github/ISSUE_TEMPLATE/config.yml
31
31
+++ b/.github/ISSUE_TEMPLATE/config.yml
32
32
@@ -1,4 +1,8 @@
@@ -40,7 +40,7 @@ index 4018cef2..d343a53d 100644
40
40
about: Ask in the OpenZeppelin Forum
41
41
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
42
42
deleted file mode 100644
43
- index ff596b0c..00000000
43
+ index ff596b0c3..000000000
44
44
--- a/.github/ISSUE_TEMPLATE/feature_request.md
45
45
+++ /dev/null
46
46
@@ -1,14 +0,0 @@
@@ -59,48 +59,48 @@ index ff596b0c..00000000
59
59
- <!-- Make sure that you have reviewed the OpenZeppelin Contracts Contributor Guidelines. -->
60
60
- <!-- https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/CONTRIBUTING.md -->
61
61
diff --git a/README.md b/README.md
62
- index 60d0a430..0e4f91a6 100644
62
+ index 60d0a430a..0e4f91a6d 100644
63
63
--- a/README.md
64
64
+++ b/README.md
65
65
@@ -19,6 +19,9 @@
66
66
> [!IMPORTANT]
67
67
> OpenZeppelin Contracts uses semantic versioning to communicate backwards compatibility of its API and storage layout. For upgradeable contracts, the storage layout of different major versions should be assumed incompatible, for example, it is unsafe to upgrade from 4.9.3 to 5.0.0. Learn more at [Backwards Compatibility](https://docs.openzeppelin.com/contracts/backwards-compatibility).
68
-
68
+
69
69
+ +> [!NOTE]
70
70
+ +> You are looking at the upgradeable variant of OpenZeppelin Contracts. Be sure to review the documentation on [Using OpenZeppelin Contracts with Upgrades](https://docs.openzeppelin.com/contracts/upgradeable).
71
71
+ +
72
72
## Overview
73
-
73
+
74
74
### Installation
75
75
@@ -26,7 +29,7 @@
76
76
#### Hardhat (npm)
77
-
77
+
78
78
```
79
79
- $ npm install @openzeppelin/contracts
80
80
+ $ npm install @openzeppelin/contracts-upgradeable
81
81
```
82
-
82
+
83
83
#### Foundry (git)
84
84
@@ -38,10 +41,10 @@ $ npm install @openzeppelin/contracts
85
85
> Foundry installs the latest version initially, but subsequent `forge update` commands will use the `master` branch.
86
-
86
+
87
87
```
88
88
- $ forge install OpenZeppelin/openzeppelin-contracts
89
89
+ $ forge install OpenZeppelin/openzeppelin-contracts-upgradeable
90
90
```
91
-
91
+
92
92
- Add `@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/` in `remappings.txt.`
93
93
+ Add `@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/` in `remappings.txt.`
94
-
94
+
95
95
### Usage
96
-
96
+
97
97
@@ -50,10 +53,11 @@ Once installed, you can use the contracts in the library by importing them:
98
98
```solidity
99
99
pragma solidity ^0.8.20;
100
-
100
+
101
101
- import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
102
102
+ import {ERC721Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
103
-
103
+
104
104
- contract MyCollectible is ERC721 {
105
105
- constructor() ERC721("MyCollectible", "MCO") {
106
106
+ contract MyCollectible is ERC721Upgradeable {
@@ -110,7 +110,7 @@ index 60d0a430..0e4f91a6 100644
110
110
}
111
111
```
112
112
diff --git a/contracts/package.json b/contracts/package.json
113
- index 70ae73bc..ef659873 100644
113
+ index 70ae73bc2..ef659873f 100644
114
114
--- a/contracts/package.json
115
115
+++ b/contracts/package.json
116
116
@@ -1,5 +1,5 @@
@@ -140,16 +140,16 @@ index 70ae73bc..ef659873 100644
140
140
+ }
141
141
}
142
142
diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol
143
- index c39954e3..fe681f87 100644
143
+ index c39954e35..fe681f87a 100644
144
144
--- a/contracts/utils/cryptography/EIP712.sol
145
145
+++ b/contracts/utils/cryptography/EIP712.sol
146
146
@@ -4,7 +4,6 @@
147
147
pragma solidity ^0.8.20;
148
-
148
+
149
149
import {MessageHashUtils} from "./MessageHashUtils.sol";
150
150
- import {ShortStrings, ShortString} from "../ShortStrings.sol";
151
151
import {IERC5267} from "../../interfaces/IERC5267.sol";
152
-
152
+
153
153
/**
154
154
@@ -25,33 +24,20 @@ import {IERC5267} from "../../interfaces/IERC5267.sol";
155
155
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
@@ -168,7 +168,7 @@ index c39954e3..fe681f87 100644
168
168
-
169
169
bytes32 private constant TYPE_HASH =
170
170
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
171
-
171
+
172
172
- // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
173
173
- // invalidate the cached domain separator if the chain id changes.
174
174
- bytes32 private immutable _cachedDomainSeparator;
@@ -179,7 +179,7 @@ index c39954e3..fe681f87 100644
179
179
bytes32 private immutable _hashedName;
180
180
+ /// @custom:oz-renamed-from _HASHED_VERSION
181
181
bytes32 private immutable _hashedVersion;
182
-
182
+
183
183
- ShortString private immutable _name;
184
184
- ShortString private immutable _version;
185
185
- // slither-disable-next-line constable-states
@@ -188,7 +188,7 @@ index c39954e3..fe681f87 100644
188
188
- string private _versionFallback;
189
189
+ string private _name;
190
190
+ string private _version;
191
-
191
+
192
192
/**
193
193
* @dev Initializes the domain separator and parameter caches.
194
194
@@ -66,29 +52,23 @@ abstract contract EIP712 is IERC5267 {
@@ -210,7 +210,7 @@ index c39954e3..fe681f87 100644
210
210
+ _hashedName = 0;
211
211
+ _hashedVersion = 0;
212
212
}
213
-
213
+
214
214
/**
215
215
* @dev Returns the domain separator for the current chain.
216
216
*/
@@ -222,12 +222,12 @@ index c39954e3..fe681f87 100644
222
222
- }
223
223
+ return _buildDomainSeparator();
224
224
}
225
-
225
+
226
226
function _buildDomainSeparator() private view returns (bytes32) {
227
227
- return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
228
228
+ return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));
229
229
}
230
-
230
+
231
231
/**
232
232
@@ -125,6 +105,10 @@ abstract contract EIP712 is IERC5267 {
233
233
uint256[] memory extensions
@@ -255,7 +255,7 @@ index c39954e3..fe681f87 100644
255
255
+ function _EIP712Name() internal view virtual returns (string memory) {
256
256
+ return _name;
257
257
}
258
-
258
+
259
259
/**
260
260
* @dev The version parameter for the EIP712 domain.
261
261
*
@@ -314,7 +314,7 @@ index c39954e3..fe681f87 100644
314
314
}
315
315
}
316
316
diff --git a/package.json b/package.json
317
- index eeeaf0bc..65581c54 100644
317
+ index eeeaf0bcd..65581c544 100644
318
318
--- a/package.json
319
319
+++ b/package.json
320
320
@@ -34,7 +34,7 @@
@@ -327,15 +327,15 @@ index eeeaf0bc..65581c54 100644
327
327
"keywords": [
328
328
"solidity",
329
329
diff --git a/remappings.txt b/remappings.txt
330
- index 304d1386..a1cd63be 100644
330
+ index 304d1386a..a1cd63bee 100644
331
331
--- a/remappings.txt
332
332
+++ b/remappings.txt
333
333
@@ -1 +1,2 @@
334
334
- @openzeppelin/contracts/=contracts/
335
335
+ @openzeppelin/contracts-upgradeable/=contracts/
336
336
+ @openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/
337
337
diff --git a/test/utils/cryptography/EIP712.test.js b/test/utils/cryptography/EIP712.test.js
338
- index 2b6e7fa9..268e0d29 100644
338
+ index 2b6e7fa97..268e0d29d 100644
339
339
--- a/test/utils/cryptography/EIP712.test.js
340
340
+++ b/test/utils/cryptography/EIP712.test.js
341
341
@@ -47,27 +47,6 @@ describe('EIP712', function () {
@@ -364,5 +364,5 @@ index 2b6e7fa9..268e0d29 100644
364
364
- });
365
365
- }
366
366
});
367
-
367
+
368
368
it('hash digest', async function () {
0 commit comments