LayerZero-Labs / LayerZero-v2

Other
542 stars 327 forks source link

Compilation error #8

Closed mastepperhs closed 6 months ago

mastepperhs commented 9 months ago
image
Zodomo commented 9 months ago

You need to provide constructor arguments before deploying

aleksandr1101 commented 8 months ago

The issue is occured on the compiling stage

e00dan commented 8 months ago

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