https://github.com/squilliamx/foundry-upgradeable-uups
Professional implementation of upgradeable smart contract system demonstrating mastery of UUPS proxy patterns, state persistence, and secure upgrade mechanisms. Built with industry best practices using Foundry & OpenZeppelin. Features comprehensive testing suite and automated deployment infrastructure.
https://github.com/squilliamx/foundry-upgradeable-uups
erc1967 ethereum foundry openzeppelin-solidity proxy solidity upgradeable-smart-contract uups-proxy-pattern
Last synced: 22 days ago
JSON representation
Professional implementation of upgradeable smart contract system demonstrating mastery of UUPS proxy patterns, state persistence, and secure upgrade mechanisms. Built with industry best practices using Foundry & OpenZeppelin. Features comprehensive testing suite and automated deployment infrastructure.
- Host: GitHub
- URL: https://github.com/squilliamx/foundry-upgradeable-uups
- Owner: SquilliamX
- Created: 2024-12-20T23:03:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-26T04:59:11.000Z (over 1 year ago)
- Last Synced: 2025-10-24T22:37:20.629Z (7 months ago)
- Topics: erc1967, ethereum, foundry, openzeppelin-solidity, proxy, solidity, upgradeable-smart-contract, uups-proxy-pattern
- Language: Solidity
- Homepage:
- Size: 438 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ Upgradeable Smart Contract System
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.
## ๐ Key Features
- **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
## ๐๏ธ Technical Architecture
### Smart Contracts
- `BoxV1.sol` - Initial implementation with basic functionality
- `BoxV2.sol` - Enhanced implementation with additional features
- `ERC1967Proxy` - Industry-standard proxy contract from OpenZeppelin
### Infrastructure
- **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
## ๐ Security Features
- Initialization protection using OpenZeppelin's `Initializable`
- Ownership management with `OwnableUpgradeable`
- UUPS upgrade pattern with access controls
- Constructor safeguards for implementation contracts
## Quick Start
```bash
git clone https://github.com/SquilliamX/Foundry-Upgradeable-UUPS.git
cd Foundry-Upgradeable-UUPS
forge build
forge install
```
## ๐งช Testing
```bash
forge test
```
The test suite includes:
- Proxy deployment verification
- Implementation upgrade validation
- State persistence checks
- Access control verification
## ๐ฆ Deployment
The system uses a two-step deployment process:
1. Initial Deployment:
```bash
forge script script/DeployBox.s.sol
```
2. Upgrade Process:
```bash
forge script script/UpgradeBox.s.sol
```
## ๐ Technical Deep Dive
### Upgrade Pattern
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
### State Management
- Utilizes OpenZeppelin's upgradeable contracts
- Implements proper initialization patterns
- Maintains state consistency across upgrades
## ๐ ๏ธ Development Stack
- Solidity ^0.8.19
- OpenZeppelin Contracts (Upgradeable)
- Foundry Development Framework
- DevOps Tools for Deployment Management
## ๐ค Contributing
Contributions are welcome! Please check our contributing guidelines and submit PRs for any enhancements.
## ๐ License
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*