From 94f2744907a05e238c5b8e00885e99c4a0f4b228 Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Thu, 26 Oct 2023 22:25:38 -0400 Subject: [PATCH] Update readme, add contributing --- CONTRIBUTING.md | 33 +++++++++++++++++++++++++++++++++ README.md | 22 +++------------------- 2 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6e709ba --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +Contributing to OpenZeppelin Foundry Upgrades +======= + +Contributions to OpenZeppelin Foundry Upgrades are welcome. Please review the information below to test out and contribute your changes. + +## Building and testing the project + +### Prerequisites +The following prerequisites are required to build the project locally: +- [Node.js](https://nodejs.org/) +- [Yarn](https://yarnpkg.com/getting-started/install) +- [Foundry](https://book.getfoundry.sh/getting-started/installation) + +After the prerequisites are installed, the commands below can be run from this project's root directory. + +### Installing dependencies +```yarn install``` + +The dependencies must be installed at least once before running the tests or linter. + +### Running tests +```yarn test``` + +Ensure that all tests pass. If you are adding new functionality, include testcases as appropriate. + +### Running linter +```yarn lint``` + +If linting errors or warnings occur, run `yarn lint:fix` to attempt to auto-fix issues. If there are remaining issues that cannot be auto-fixed, manually address them and re-run the command to ensure it passes. + +## Creating Pull Requests (PRs) + +As a contributor, we ask that you fork this repository, work on your own fork and then submit pull requests. The pull requests will be reviewed and eventually merged into the main repo. See ["Fork-a-Repo"](https://help.github.com/articles/fork-a-repo/) for how this works. \ No newline at end of file diff --git a/README.md b/README.md index b786b93..d6fbbb7 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,14 @@ Set the following in `remappings.txt`, replacing any previous definitions of the @openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/ ``` -## Version limitations +## Version Limitations This library only supports proxy contracts and upgrade interfaces from OpenZeppelin Contracts 5.0 or higher. ## Requirements This library uses the [OpenZeppelin Upgrades Core CLI](https://docs.openzeppelin.com/upgrades-plugins/1.x/api-core) for upgrade safety checks. In order for safety checks to work, the following are required: -- Node.js must be installed. +- [Node.js](https://nodejs.org/) must be installed. - Configure your `foundry.toml` according to the [CLI Prerequisites](https://docs.openzeppelin.com/upgrades-plugins/1.x/api-core#foundry). - If you are upgrading your contract from a previous version, add the `@custom:oz-upgrades-from ` annotation to the new version of your contract according to [Define Reference Contracts](https://docs.openzeppelin.com/upgrades-plugins/1.x/api-core#define-reference-contracts) or specify the `referenceContract` option when calling the library's functions. - Run `forge clean` before running your Foundry script or tests. @@ -96,7 +96,7 @@ Upgrade a beacon: Upgrades.upgradeBeacon(beacon, "MyContractV2.sol"); ``` -### Deploying +### Deploying and Verifying Run your script with `forge script` to broadcast and deploy. See Foundry's [Solidity Scripting](https://book.getfoundry.sh/tutorials/solidity-scripting) guide. @@ -105,19 +105,3 @@ Run your script with `forge script` to broadcast and deploy. See Foundry's [Soli > **Note** > Include the `--verify` flag for the `forge script` command if you want to verify source code such as on Etherscan. This will verify your implementation contracts along with any proxy contracts as part of the deployment. - -## Contributing - -### Running tests - -``` -forge clean && forge test --ffi -``` - -### Running example script - -You can simulate deployments and upgrades of the various kinds of proxies by running the script: - -``` -forge clean && forge script test/Upgrades.s.sol --ffi -```