Upgradeable contract: require and check current version of the contract during upgrade
Clarification and motivation
When one wants to upgrade our standard upgradeable contract they have to pass only the new version to which the contract will be upgraded. It is a bit unsafe because one may assume wrong version of a contract and apply a wrong upgrade (one which shouldn't be applied to the current version).
We can also require current version of the contract as a new upgrade parameter. So one should pass two versions: new and current one. If real current version doesn't match the one provided by the caller, an error should be thrown.
Acceptance criteria
EpwBeginUpgrade
and Upgrade
should have an additional nat
argument: expected current version. They should fail if it does not match the value returned by GetVersion
.