Upgradable smart-contracts
This repository demonstrates the use of upgradable smart contracts using OpenZeppelin Contracts Upgradeable and Foundry. It provides example contracts, deployment scripts, and tests to help you get started with secure and maintainable upgradeable contract development.
- Example implementation of upgradeable contracts (
BoxV1,BoxV2) - Deployment and upgrade scripts using Foundry
- Automated tests for deployment and upgrade flows
- Integration with OpenZeppelin's upgradeable libraries
Clone the repository and install dependencies:
git clone https://github.com/your-username/upgradable_contract.git
cd upgradable_contract
forge install
* Compile Contracts
forge build
* Run Tests
forge test
** Deploy and Upgrade
* Deployment and upgrade scripts are located in the script/ directory:
* DeployBox.s.sol: Deploys the initial version of the contract.
* UpgradeBox.sol: Upgrades the contract to a new version.
* You can run these scripts using Foundry's forge script command.
src/ # Solidity contract sources
script/ # Deployment and upgrade scripts
test/ # Test contracts
lib/ # External dependencies (OpenZeppelin, Forge Std, etc.)
*References
** OpenZeppelin Contracts Upgradeable Documentation
** Foundry Book
** License
** This project is licensed under the MIT License.