Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Openzeppelin V5 #118

Open
0xSamWitch opened this issue Oct 22, 2023 · 1 comment
Open

Upgrade to Openzeppelin V5 #118

0xSamWitch opened this issue Oct 22, 2023 · 1 comment

Comments

@0xSamWitch
Copy link

OZ recently released a major upgrade https://blog.openzeppelin.com/introducing-openzeppelin-contracts-5.0 these contracts should be updated to resolve the backwards incompatible changes

@e00dan
Copy link

e00dan commented Jan 5, 2024

Additional context from the perspective of new developers following quick-start guide from LayerZero docs but trying to use Foundry instead of using this repository and Hardhat:

When setting up Foundry and installing OpenZeppelin libraries by default it will install latest version (>= 5). This results in the error in OmniCounter example:

➜  lzcross git:(master) ✗ forge build
[⠊] Compiling...
[⠊] Installing Solc version 0.8.23
[⠔] Successfully installed Solc 0.8.23
[⠊] Compiling 35 files with 0.8.23
[⠢] Solc 0.8.23 finished in 459.69ms
Error: 
Compiler run failed:
Error (3415): No arguments passed to the base constructor. Specify the arguments or mark "OmniCounter" as abstract.
 --> src/OmniCounter.sol:9:1:
  |
9 | contract OmniCounter is NonblockingLzApp {
  | ^ (Relevant source part starts here and spans across multiple lines).
Note: Base constructor parameters:
  --> lib/openzeppelin-contracts/contracts/access/Ownable.sol:38:16:
   |
38 |     constructor(address initialOwner) {
   |  

Seems easily fixable though by changing constructor in LzApp.sol to:

constructor(address _endpoint) Ownable(_msgSender()) {
    lzEndpoint = ILayerZeroEndpoint(_endpoint);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants