LayerZero-Labs/LayerZero-v2

Compilation error

Closed this issue · 3 comments

You need to provide constructor arguments before deploying

The issue is occured on the compiling stage

The problem is that when using Remix IDE the "Ownable" constructor needs to be manually called, potentially because Remix pulls mismatched version of OpenZeppelin (version 5 instead of 4).

Fix:

// import Ownable from OpenZeppelin
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";

contract MyOApp is OApp {
    // Added Ownable constructor call to the line below \/\/\/
    constructor(address _endpoint, address _owner) OApp(_endpoint, _owner) Ownable(_owner) {}
}

Demonstration

Before:
image

After:
image