MiniWallet Contracts refactor, MiniServer, Proxy Upgrade Deploys#12
MiniWallet Contracts refactor, MiniServer, Proxy Upgrade Deploys#12johnwhitton wants to merge 1 commit intominiwalletfrom
Conversation
polymorpher
left a comment
There was a problem hiding this comment.
It's nice to have hardhat do the proxy-deployment in a simple function call, but I am concerned we see too little detail and have too little control. The generated .json files (in deployments/) are pretty hard to read, and may be easily confused with something that can be regenerated. Yet they are unique to the deployment and critical to managing the contract / upgrades in the future.
For each chain, we only need three things: proxy contract, deployed proxy address, and logic contract address. Rather than keeping a bunch of JSON files and irrelevant information in those files, I think it is better to just store these three pieces of information in a file inside a folder (similar to relayer/cache, but can be simpler, e.g. the versions can be hash of contracts instead). When we need to upgrade the contract later, we just read from that file and call relevant functions accordingly (i.e. (1) deploy a new logic contract, (2) redirect proxy to the address of the new logic contract). I have read https://github.com/wighawag/hardhat-deploy#deploying-and-upgrading-proxies and examined underlying types (ProxyOptionsBase, etc.) but I am not sure whether hardhat-deploy library supports manual selection (of logic contract address) during upgrade. It would be nice if it does, but even if it doesn't, it seems not hard to just implement on our own - should be just a few lines
TODO
miniwallets/deployments/ethLocalfolder to .gitignore leaveminiwallet/deploymentsfolderSample Deployment Log