You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Solidity Scripting Tutorial example code doesn't compile when the latest version of the OpenZeppelin library is used.
Installing OpenZeppelin library using the instructions: forge install transmissions11/solmate Openzeppelin/openzeppelin-contracts seems to install the latest version of the OpenZeppelin library (v5), possibly because the ref defaults to "master"?
Error:
Compiler run failed:
Error (3415): No arguments passed to the base constructor. Specify the arguments or mark "NFT" as abstract.
--> src/NFT.sol:13:1:
|
13 | contract NFT is ERC721, Ownable {
| ^ (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) {
|
Possibly the NFT constructor could call the base constructor?
The Solidity Scripting Tutorial example code doesn't compile when the latest version of the OpenZeppelin library is used.
Installing OpenZeppelin library using the instructions:
forge install transmissions11/solmate Openzeppelin/openzeppelin-contracts
seems to install the latest version of the OpenZeppelin library (v5), possibly because the ref defaults to "master"?The function signature of the OpenZeppelin Ownable class has changed in v5 from v4, the constructor now requires an "initialOwner" parameter.
So the example code in the Tutorial is missing a call to the base constructor in Ownable.
The compilation error (using Solc 0.8.22) is:
Possibly the NFT constructor could call the base constructor?
Or possibly the dependency could specify a version?
The text was updated successfully, but these errors were encountered: