All the code was developed for learning purposes and is from Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course by freeCodeCamp.org and Patrick Collins
The project represents an upgradable Smart Contract through a Proxy.
It implements the Openzeppelin Transparent Proxy Smart Contract as a Proxy.
Thanks to this proxy we can change the implementation (logic) of the smart contract.
This project demonstrates an advanced Hardhat use case, integrating other tools commonly used alongside Hardhat in the ecosystem.
This project also includes automatic verification of the contract for real networks. The verification is only executed when running on real networks
To get a local copy up and running follow these simple steps.
Make sure you have already installed Node.js in your device. Also make sure you have yarn installed, in case you don't, install it:
- yarn
npm install --global yarn
- Clone the repo
git clone https://github.com/alvaro-8a/hardhat-upgrades-fcc.git
- Install YARN packages
yarn install
You can use this code it as a template to develop your own upgradable smart contract, there are many improvements that can be done so feel free to make any change.
You can also use it to deploy your own upgradable smart contract to a Solidity supported Blockchain (Ethereum, Polygon, BSC...).
Note: This project is a demo and I don't recommend using it without changes, there are many things that can be improved so take in consideration before using it.
-
Upgrade Box -> BoxV2
-
Proxy Box -> BoxV2
-
Deploy a Proxy
- Manually --Subleson--
- hardhat-deploy's built-in proxies <-
- Openzeppelin upgrades plugin
- [✔️] Develop different contract implementations (Box & BoxV)
- [✔️] Develop ProxyAdmin contract (Admin of the proxy)
- [✔️] Deploy scripts
- [✔️] Upgrade script
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion or an improvement that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Your Name - @alvaro_8a_ - alvaroblanco8a@gmail.com
Project Link: https://github.com/alvaro-8a/hardhat-upgrades-fcc