Smart contracts for key-value storage and proxy delegate upgradability pattern.
A contract that can store up all data for the main contract.
Proxy contract, there is no any logical code in this contract, it only for upgrade.
Logical contract version 1 and version2.
- deploy KeyValueStorage.sol.
- deploy UpgradeProxy.sol.
- deploy MainContractV1.sol.
- call upgradeTo(MainContractV1.address) to upgrade the contract to version 1.
- deploy MainContractV2.sol.
- call upgradeTo(MainContractV2.address) to upgrade the contract to version 2.
Recompile contracts and build artifacts.
$ truffle complie
$ truffle test