This tutorial will walk you through the process of creating a UUPS proxy contract.
A UUPS proxy is a proxy contract that uses the Universal Upgradeable Proxy Standard to upgrade the implementation of the proxy contract.
Below are the steps to run this tutorial with local hardhat node.
- Clone this repository
- Inside the backend directory run
yarn
to install the dependencies. - Run
yarn hardhat node --tags mars
to start a local hardhat node and deploy the contract. - Open a new terminal and run
yarn hardhat deploy --network localhost --tags frontend
to update contract details to frontend. - Open a new terminal from the frontend directory and run
yarn
to install the dependencies. - Run
yarn dev
to start the frontend. - Open https://localhost:3000 to view the app.
- Click on the
Connect
button to connect your Metamask account. - Connect your Metamask account to the local hardhat node.
- Refer to add the local hardhat network to your Metamask account.
- Import first account from the local hardhat node using the private key to your Metamask account.
- Once you have connected your Metamask account, click on the
Check Version
button. - You should see the version of the contract as
1
. - In a terminal from the backend directory, run
yarn hardhat deploy --network localhost --tags marsV2
. - Wait for the contract to be deployed.
- Once the contract is deployed, click on the
Check Version
button again. - You should see the version of the contract as
2
. - If you are trying to redeploy the contracts, make sure to reset your Metamask account from advanced settings .
- Add tests for the contracts