Skip to content

Commit 2e5d1eb

Browse files
authored
Update transpilation process (#5941)
1 parent e2e9908 commit 2e5d1eb

File tree

7 files changed

+57
-84
lines changed

7 files changed

+57
-84
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
### Deprecation
1313

14+
- `Initializable` and `UUPSUpgradeable` are no longer transpiled. An alias is present in the `@openzeppelin/contracts-upgradeable` package that redirect to the corresponding file in `@openzeppelin/contracts`. These alias will be removed in the next major release. Developers are advised to update their imports to get these files directly from the `@openzeppelin/contracts` package.
1415
- `ECDSA` signature malleability protection is partly deprecated. See documentation for more details.
1516

1617
## 5.4.0 (2025-07-17)

contracts/proxy/utils/UUPSUpgradeable.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol";
1515
* `UUPSUpgradeable` with a custom implementation of upgrades.
1616
*
1717
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
18+
*
19+
* @custom:stateless
1820
*/
1921
abstract contract UUPSUpgradeable is IERC1822Proxiable {
2022
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable

package-lock.json

Lines changed: 37 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"@nomicfoundation/hardhat-network-helpers": "^1.0.13",
6363
"@openzeppelin/docs-utils": "^0.1.5",
6464
"@openzeppelin/merkle-tree": "^1.0.7",
65-
"@openzeppelin/upgrade-safe-transpiler": "^0.3.32",
65+
"@openzeppelin/upgrade-safe-transpiler": "^0.4.1",
6666
"@openzeppelin/upgrades-core": "^1.20.6",
6767
"chai": "^4.2.0",
6868
"eslint": "^9.0.0",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity ^0.8.20;
4+
5+
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// SPDX-License-Identifier: MIT
2+
3+
pragma solidity ^0.8.22;
4+
5+
import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";

scripts/upgradeable/transpile.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
# -D: delete original and excluded files
2424
# -b: use this build info file
2525
# -i: use included Initializable
26-
# -x: exclude proxy-related contracts with a few exceptions
26+
# -x: exclude some proxy-related contracts
2727
# -p: emit public initializer
2828
# -n: use namespaces
2929
# -N: exclude from namespaces transformation
@@ -32,12 +32,8 @@ npx @openzeppelin/upgrade-safe-transpiler -D \
3232
-b "$build_info" \
3333
-i contracts/proxy/utils/Initializable.sol \
3434
-x 'contracts-exposed/**/*' \
35-
-x 'contracts/proxy/**/*' \
36-
-x '!contracts/proxy/Clones.sol' \
37-
-x '!contracts/proxy/ERC1967/ERC1967Storage.sol' \
38-
-x '!contracts/proxy/ERC1967/ERC1967Utils.sol' \
39-
-x '!contracts/proxy/utils/UUPSUpgradeable.sol' \
40-
-x '!contracts/proxy/beacon/IBeacon.sol' \
35+
-x 'contracts/proxy/**/*Proxy*.sol' \
36+
-x 'contracts/proxy/beacon/UpgradeableBeacon.sol' \
4137
-p 'contracts/access/manager/AccessManager.sol' \
4238
-p 'contracts/finance/VestingWallet.sol' \
4339
-p 'contracts/governance/TimelockController.sol' \
@@ -46,5 +42,8 @@ npx @openzeppelin/upgrade-safe-transpiler -D \
4642
-N 'contracts/mocks/**/*' \
4743
-q '@openzeppelin/'
4844

45+
# create alias to Initializable and UUPSUpgradeable
46+
cp $DIRNAME/alias/*.sol contracts/proxy/utils/.
47+
4948
# delete compilation artifacts of vanilla code
5049
npm run clean

0 commit comments

Comments
 (0)