This project demonstrates the implementation of upgradeable smart contracts using the UUPS (Universal Upgradeable Proxy Standard) pattern with OpenZeppelin and Hardhat.
The project contains two main contracts:
Counter.sol
: The initial implementation of a simple counter contract.CounterV2.sol
: An upgraded version of the counter contract with additional functionality.
Both contracts are designed to be upgradeable using the UUPS pattern.
- Clone the repository
- Install dependencies:
npm install
In the project directory, you can run:
npx hardhat compile
npx hardhat test
npx hardhat run scripts/deploy.js
npx hardhat run scripts/upgrade.js
- Implementation of UUPS upgradeable contracts
- Use of OpenZeppelin's upgradeable contracts
- Hardhat for development and testing
- Ethers.js for interacting with the Ethereum network
Run the test suite to ensure everything is working correctly:
npx hardhat test
To deploy the initial version of the contract:
npx hardhat run scripts/deploy.js
To upgrade the contract:
npx hardhat run scripts/upgrade.js
To learn more about Hardhat, OpenZeppelin, and UUPS upgradeable contracts, check out the following resources:
This project is licensed under the MIT License.