https://github.com/0xheartcode/foundryproxytutorial
Quick Repository that shows how to use the upgradeable EIP-1967 Transparent Proxy with foundry and open zeppelin.
https://github.com/0xheartcode/foundryproxytutorial
Last synced: over 1 year ago
JSON representation
Quick Repository that shows how to use the upgradeable EIP-1967 Transparent Proxy with foundry and open zeppelin.
- Host: GitHub
- URL: https://github.com/0xheartcode/foundryproxytutorial
- Owner: 0xheartcode
- Created: 2024-06-22T15:38:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-22T15:51:36.000Z (almost 2 years ago)
- Last Synced: 2025-01-20T05:42:35.444Z (over 1 year ago)
- Language: Solidity
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UpgradeableToken Project
This project contains the `UpgradeableToken` smart contract, its deployment script, and test cases. Below are the instructions on how to verify, deploy, and test the contract.
## Prerequisites
- Node.js (v12.x or later)
- Foundry
- OpenZeppelin Contracts Upgradeable
- OpenZeppelin Upgrades
## Installation
1. Install Foundry:
```bash
curl -L https://foundry.paradigm.xyz | bash
foundryup
```
2. Clone the repository and install dependencies:
```bash
git clone
cd
forge install
```
Or install the following dependencies directly:
```bash
forge install OpenZeppelin/openzeppelin-foundry-upgrades
forge install OpenZeppelin/openzeppelin-contracts-upgradeable
```
3. Ensure you have the following dependencies in your `foundry.toml`:
```toml
[profile.default]
src = "src"
out = "out"
libs = ["lib"]
ffi = true
ast = true
build_info = true
extra_output = ["storageLayout"]
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
```
## Environment Variables
Set the environment variables for your private key and RPC URL:
Copy the `.env.local` file to `.env` and fill out the necessary details.
## Compilation
To compile the project, run:
```bash
forge build
```
## Testing
To test the project, run:
```bash
forge test
```
## Deployment
To deploy the contract, follow these steps:
1. Clean and rebuild the project (⚠️ use this in case of any issues. Clean && rebuild):
```bash
forge clean
forge build
```
2. Deploying with Forge Script
To deploy the contract using the Forge script, run:
```bash
forge script script/DeployUpgradeableToken.s.sol --rpc-url $RPC_URL --broadcast -vvvv
```
## Verification
To verify the contract on Etherscan, use the following command:
```bash
forge verify-contract --rpc-url $RPC_URL --etherscan-api-key $ETHERSCAN_API_KEY $DEPLOYED_CONTRACT_ADDRESS src/UpgradeableToken.sol:UpgradeableToken
```
### Documentation and Credits
This project was inspired by and adapted from the following blog post:
[Deploy Upgradeable Contract with Foundry and OpenZeppelin](https://www.proof2work.com/blog/deploy-upgradeable-contract-with-foundry-and-openzeppelin)