Error writing Upgradable contracts using npm install @openzeppelin/upgrades@2.4.0

Hi, I am currently learning to implement smart contract upgradability and was going through this link. And based on the docs there, I have two queries,

  1. The command npm install @openzeppelin/upgrades@2.4.0 seems to be outdated in Writing the exchange contract section as the console throws the following error,
npm ERR! notarget No matching version found for @openzeppelin/upgrades@2.4.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that does not exist.

But doing npm install @openzeppelin/upgrades@2.6.0 works fine.

  1. It’s mentioned in the docs to import the base initializable contract through import "@openzeppelin/upgrades/contracts/Initializable.sol"; But in the version 2.6.0, there is no such contract named as Initializable.sol. So which one to use in the newer version?

Thanks :slight_smile:

1 Like

Hi @manolingam,

Sorry about that. I have created a pull request to update the documentation: https://github.com/OpenZeppelin/openzeppelin-sdk/pull/1292

This likely occurred when Zeppelin OS was renamed to OpenZeppelin SDK.

Doing npm install @openzeppelin/upgrades and I can import Initializable.sol.
Can you share your error message?

pragma solidity ^0.5.0;

import "@openzeppelin/upgrades/contracts/Initializable.sol";

contract Test is Initializable {

}
1 Like

Hi @abcoathup

Thanks for the update and the pull request.

For the Initializable contract, am sorry. I was looking inside the wrong folder (upgradeability) :man_facepalming:
It’s working fine.

Thanks :slight_smile:

1 Like