/foundry-oz-upgrades

A Foundry project that leverages the OpenZeppelin upgrades library to manage creating and deploying upgradeable smart contracts.

Primary LanguageSolidity

🏄‍♂️ Quick Start

This project leverages Foundry to manage dependencies (via soldeer), contract compilation, testing, deployment, and on chain interactions via Solidity scripting.

Note The OZ foundry upgrades library uses node to verify upgrade safety. Make sure you have node version 18.17 or higher and npm version 10.4 or higher installed.

Environment configuration

Duplicate rename the .env.example file to .env. You'll need accounts and api keys for Infura and Etherscan as well as the necessary RPC URLs. Be sure to add the required values in your newly created .env file.

Dependencies

To install the project dependencies, run:

forge soldeer update

Compilation

To compile your contracts, run:

forge compile

Testing

forge test

Note: In case of "Failed to run upgrade safety validation" Run: forge clean

Coverage

forge coverage

Deployment

forge script script/deploy_bridge.s.sol --rpc-url <<alias>> --broadcast --verify

Local deployment

forge script script/deploy_bridge.s.sol --fork-url anvil --broadcast

All deployments are saved in the broadcast directory.

External Resources