All Pie DAO smart pools are upgradeable because they use a proxy contract. At PieDAO we use our implementation of a simple proxy contract called pie-proxy.
Upgrading a contract is done by setting the implementation address on the proxy contract to the address of the new logic contract. Using this pattern allows smart pools to be upgraded while keeping the old storage.
Deploying a new implementation
Clone the pie-smart-pools repository and checkout master. Master contains the latest release which is considered stable and audited for mainnet use.
copy the contents of env.example to a new file called .env and edit the relevant values inside. DO NOT share this file with anyone as it will contain sensitive data.
Install all dependencies:
Build the project
To deploy the implementation contract run the following command replacing the impl-name value with the name you would like to give to the implementation contract and the --network value with whichever network you want to deploy the contract to.
npx buidler deploy-smart-pool-implementation-complete --impl-name [IMPL-NAME] --network kovan
In your terminal you will see the address of the implementation, copy this for the next step.
Setting the new implementation
The pie-proxy instance has a proxyOwner address, only this address is capable of changing the implementation contract by calling setImplementation(address _newImplementation).
The smart pools are currently controlled by a multisig wallet. To change the implementation you should do the following steps.