MyGit

v4.4.1

OpenZeppelin/openzeppelin-contracts

版本发布时间: 2021-12-15 03:07:32

OpenZeppelin/openzeppelin-contracts最新发布版本:v5.1.0-rc.0(2024-10-03 22:56:46)

:warning: This is a patch for a low severity vulnerability. For more information visit the security advisory.

Breaking change

It is no longer possible to call an initializer-protected function from within another initializer function outside the context of a constructor. Projects using OpenZeppelin upgradeable proxies should continue to work as is, since in the common case the initializer is invoked in the constructor directly. If this is not the case for you, the suggested change is to use the new onlyInitializing modifier in the following way:

 contract A {
-    function initialize() public   initializer { ... }
+    function initialize() internal onlyInitializing { ... }
 }
 contract B is A {
     function initialize() public initializer {
         A.initialize();
     }
 }

相关地址:原始地址 下载(tar) 下载(zip)

查看:2021-12-15发行的版本