Hi. I am going to the official Tutorial for upgradable SmartContracts using OpenZellin-OS and got in stuck very fast:
The base contract is importing zos-lib/contracts/migrations/Migratable.sol. But there is none in zos-lib.
pragma solidity ^0.4.21;
import "zos-lib/contracts/migrations/Migratable.sol";
contract MyContract is Migratable {
uint256 public x;
function initialize(uint256 _x) isInitializer("MyContract", "0") public {
x = _x;
}
}
The command zos add MyContract gives the following error:
Could not find zos-lib/contracts/migrations/Migratable.sol from any sources
Looking into the sos-lib package, there is no migration-folder.
Just some housekeeping, I have moved the topic to the #support:zeppelinos category so we can track it until we have an answer and renamed the topic slightly to be clear that this is an issue when following the tutorial.
It seems that things have changed significantly here. Referring to this tutorial, which seems to be more up to date, the initializing-process goes as follows:
pragma solidity ^0.5.0;
import "zos-lib/contracts/Initializable.sol";
contract MyContract is Initializable {
uint256 public x;
string public s;
function initialize(uint256 _x, string memory _s) initializer public {
x = _x;
s = _s;
}
}
Please consider the import of initializable.sol instead migratable.sol