Skip to content

Commit

Permalink
Update readme, add contributing
Browse files Browse the repository at this point in the history
  • Loading branch information
ericglau committed Oct 27, 2023
1 parent d1e2e27 commit 94f2744
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 19 deletions.
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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.
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <reference>` 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.
Expand Down Expand Up @@ -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.

Expand All @@ -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
```

0 comments on commit 94f2744

Please sign in to comment.