Skip to content

Commit 8e3ea8b

Browse files
naevernernestognw
andauthored
Update EIP712 upgradeable patch file (#5690)
Co-authored-by: ernestognw <ernestognw@gmail.com>
1 parent 48bd286 commit 8e3ea8b

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

scripts/upgradeable/upgradeable.patch

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ index 60d0a430a..0e4f91a6d 100644
110110
}
111111
```
112112
diff --git a/contracts/package.json b/contracts/package.json
113-
index 3682eadeb..4f870d094 100644
113+
index 70ae73bc2..ef659873f 100644
114114
--- a/contracts/package.json
115115
+++ b/contracts/package.json
116116
@@ -1,5 +1,5 @@
117117
{
118118
- "name": "@openzeppelin/contracts",
119119
+ "name": "@openzeppelin/contracts-upgradeable",
120120
"description": "Secure Smart Contract library for Solidity",
121-
"version": "5.2.0",
121+
"version": "5.3.0",
122122
"files": [
123123
@@ -13,7 +13,7 @@
124124
},
@@ -140,7 +140,7 @@ index 3682eadeb..4f870d094 100644
140140
+ }
141141
}
142142
diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol
143-
index bcb67c87a..7195c3bbd 100644
143+
index c39954e35..fe681f87a 100644
144144
--- a/contracts/utils/cryptography/EIP712.sol
145145
+++ b/contracts/utils/cryptography/EIP712.sol
146146
@@ -4,7 +4,6 @@
@@ -151,12 +151,17 @@ index bcb67c87a..7195c3bbd 100644
151151
import {IERC5267} from "../../interfaces/IERC5267.sol";
152152

153153
/**
154-
@@ -28,30 +27,18 @@ import {IERC5267} from "../../interfaces/IERC5267.sol";
155-
* NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
156-
* separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
157-
* separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
154+
@@ -25,33 +24,20 @@ import {IERC5267} from "../../interfaces/IERC5267.sol";
155+
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
156+
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
157+
*
158+
- * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
159+
- * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
160+
- * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
158161
- *
159162
- * @custom:oz-upgrades-unsafe-allow state-variable-immutable
163+
+ * NOTE: The upgradeable version of this contract does not use an immutable cache and recomputes the domain separator
164+
+ * each time {_domainSeparatorV4} is called. That is cheaper than accessing a cached version in cold storage.
160165
*/
161166
abstract contract EIP712 is IERC5267 {
162167
- using ShortStrings for *;
@@ -186,7 +191,7 @@ index bcb67c87a..7195c3bbd 100644
186191

187192
/**
188193
* @dev Initializes the domain separator and parameter caches.
189-
@@ -66,29 +53,23 @@ abstract contract EIP712 is IERC5267 {
194+
@@ -66,29 +52,23 @@ abstract contract EIP712 is IERC5267 {
190195
* contract upgrade].
191196
*/
192197
constructor(string memory name, string memory version) {
@@ -224,7 +229,7 @@ index bcb67c87a..7195c3bbd 100644
224229
}
225230

226231
/**
227-
@@ -127,6 +108,10 @@ abstract contract EIP712 is IERC5267 {
232+
@@ -125,6 +105,10 @@ abstract contract EIP712 is IERC5267 {
228233
uint256[] memory extensions
229234
)
230235
{
@@ -235,7 +240,7 @@ index bcb67c87a..7195c3bbd 100644
235240
return (
236241
hex"0f", // 01111
237242
_EIP712Name(),
238-
@@ -141,22 +126,62 @@ abstract contract EIP712 is IERC5267 {
243+
@@ -139,22 +123,62 @@ abstract contract EIP712 is IERC5267 {
239244
/**
240245
* @dev The name parameter for the EIP712 domain.
241246
*
@@ -309,7 +314,7 @@ index bcb67c87a..7195c3bbd 100644
309314
}
310315
}
311316
diff --git a/package.json b/package.json
312-
index f9e7d9205..c35020d51 100644
317+
index eeeaf0bcd..65581c544 100644
313318
--- a/package.json
314319
+++ b/package.json
315320
@@ -34,7 +34,7 @@

0 commit comments

Comments
 (0)