A professional-grade implementation of upgradeable smart contracts using the UUPS (Universal Upgradeable Proxy Standard) pattern. This project showcases advanced Solidity development practices, comprehensive testing, and secure upgrade mechanisms.
- UUPS Proxy Pattern Implementation: Leverages OpenZeppelin's battle-tested contracts for secure upgradeability
- Version Control: Seamless contract versioning with BoxV1 → BoxV2 upgrade path
- Comprehensive Testing: Full test coverage using Foundry's robust testing framework
- Professional Deployment Scripts: Automated deployment and upgrade processes
- Security-First Design: Implements critical security patterns and access controls
BoxV1.sol
- Initial implementation with basic functionalityBoxV2.sol
- Enhanced implementation with additional featuresERC1967Proxy
- Industry-standard proxy contract from OpenZeppelin
- Framework: Built with Foundry for modern Solidity development
- Testing: Advanced test suite with state management and upgrade verification
- Deployment: Automated scripts for both initial deployment and upgrades
- Initialization protection using OpenZeppelin's
Initializable
- Ownership management with
OwnableUpgradeable
- UUPS upgrade pattern with access controls
- Constructor safeguards for implementation contracts
git clone https://github.com/SquilliamX/Foundry-Upgradeable-UUPS.git
cd Foundry-Upgradeable-UUPS
forge build
forge install
forge test
The test suite includes:
- Proxy deployment verification
- Implementation upgrade validation
- State persistence checks
- Access control verification
The system uses a two-step deployment process:
- Initial Deployment:
forge script script/DeployBox.s.sol
- Upgrade Process:
forge script script/UpgradeBox.s.sol
The system implements the UUPS pattern, which:
- Maintains a single proxy entry point
- Preserves contract state during upgrades
- Reduces gas costs compared to alternative patterns
- Provides enhanced security through implementation-side upgrade logic
- Utilizes OpenZeppelin's upgradeable contracts
- Implements proper initialization patterns
- Maintains state consistency across upgrades
- Solidity ^0.8.19
- OpenZeppelin Contracts (Upgradeable)
- Foundry Development Framework
- DevOps Tools for Deployment Management
Contributions are welcome! Please check our contributing guidelines and submit PRs for any enhancements.
This project is licensed under the MIT License
Note: This protocol is a demonstration of advanced Solidity development practices and should not be used in production without thorough auditing.
Built with ❤️ by Squilliam