-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from yieldnest/fix/oz-dependency
upgrade to oz 5
- Loading branch information
Showing
10 changed files
with
92 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,10 @@ | |
"@layerzerolabs/lz-evm-oapp-v2": "^2.1.18", | ||
"@layerzerolabs/lz-evm-protocol-v2": "^2.1.27", | ||
"@layerzerolabs/lz-evm-v1-0.7": "^2.3.40", | ||
"@openzeppelin/contracts": "4.9.2", | ||
"@openzeppelin/contracts-upgradeable": "4.9.2", | ||
"@openzeppelin/contracts": "5.0.2", | ||
"@openzeppelin/contracts-upgradeable": "5.0.2", | ||
"@openzeppelin/contracts-4.9.2": "npm:@openzeppelin/[email protected]", | ||
"@openzeppelin/contracts-upgradeable-4.9.2": "npm:@openzeppelin/[email protected]", | ||
"hardhat-deploy": "^0.12.4", | ||
"husky": "^9.1.5", | ||
"lint-staged": "^15.2.10", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// SPDX-License-Identifier: BSD 3-Clause License | ||
pragma solidity ^0.8.24; | ||
|
||
import {Vm} from "lib/forge-std/src/Vm.sol"; | ||
// import {ERC1967Utils} from "lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Utils.sol"; | ||
|
||
import {ERC1967Utils} from "@openzeppelin/contracts-5/proxy/ERC1967/ERC1967Utils.sol"; | ||
|
||
contract Utils { | ||
/** | ||
* @dev Returns the admin address of a TransparentUpgradeableProxy contract. | ||
* @param proxy The address of the TransparentUpgradeableProxy. | ||
* @return The admin address of the proxy contract. | ||
*/ | ||
function getTransparentUpgradeableProxyAdminAddress(address proxy) public view returns (address) { | ||
address CHEATCODE_ADDRESS = 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D; | ||
Vm vm = Vm(CHEATCODE_ADDRESS); | ||
|
||
bytes32 adminSlot = vm.load(proxy, ERC1967Utils.ADMIN_SLOT); | ||
return address(uint160(uint256(adminSlot))); | ||
} | ||
|
||
/** | ||
* @dev Returns the implementation address of a TransparentUpgradeableProxy contract. | ||
* @param proxy The address of the TransparentUpgradeableProxy. | ||
* @return The implementation address of the proxy contract. | ||
*/ | ||
function getTransparentUpgradeableProxyImplementationAddress(address proxy) public view returns (address) { | ||
address CHEATCODE_ADDRESS = 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D; | ||
Vm vm = Vm(CHEATCODE_ADDRESS); | ||
|
||
bytes32 implementationSlot = vm.load(proxy, ERC1967Utils.IMPLEMENTATION_SLOT); | ||
return address(uint160(uint256(implementationSlot))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,15 +387,25 @@ | |
resolved "https://registry.yarnpkg.com/@layerzerolabs/lz-evm-v1-0.7/-/lz-evm-v1-0.7-2.3.40.tgz#8097560124439a4a5301f13f975f5df7e33a6dd7" | ||
integrity sha512-0tTD84gmrsPmy2EGyIq1ZIm3xxzHt7eul27MYIn1D2V1APJ6qo+GlXTi4jZwy241wKpd9khNe+ATHOIoaZdlTQ== | ||
|
||
"@openzeppelin/[email protected]": | ||
"@openzeppelin/contracts-4.9.2@npm:@openzeppelin/[email protected]": | ||
version "4.9.2" | ||
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1" | ||
integrity sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg== | ||
|
||
"@openzeppelin/contracts-upgradeable-4.9.2@npm:@openzeppelin/[email protected]": | ||
version "4.9.2" | ||
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.2.tgz#a817c75688f8daede420052fbcb34e52482e769e" | ||
integrity sha512-siviV3PZV/fHfPaoIC51rf1Jb6iElkYWnNYZ0leO23/ukXuvOyoC/ahy8jqiV7g+++9Nuo3n/rk5ajSN/+d/Sg== | ||
|
||
"@openzeppelin/[email protected]": | ||
version "4.9.2" | ||
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1" | ||
integrity sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg== | ||
"@openzeppelin/[email protected]": | ||
version "5.0.2" | ||
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-5.0.2.tgz#3e5321a2ecdd0b206064356798c21225b6ec7105" | ||
integrity sha512-0MmkHSHiW2NRFiT9/r5Lu4eJq5UJ4/tzlOgYXNAIj/ONkQTVnz22pLxDvp4C4uZ9he7ZFvGn3Driptn1/iU7tQ== | ||
|
||
"@openzeppelin/[email protected]": | ||
version "5.0.2" | ||
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.2.tgz#b1d03075e49290d06570b2fd42154d76c2a5d210" | ||
integrity sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA== | ||
|
||
"@pnpm/config.env-replace@^1.1.0": | ||
version "1.1.0" | ||
|