Skip to content

Commit

Permalink
update readme for better install steps
Browse files Browse the repository at this point in the history
  • Loading branch information
derekbar90 committed Mar 26, 2021
1 parent 3aab82a commit 66ef793
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 19 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@

# optimism-openzeppelin-compat
[![NPM Package](https://img.shields.io/npm/v/@thesatoshicompany/optimism-openzeppelin-compat/latest?label=%40thesatoshicompany%2Foptimism-openzeppelin-compat&logo=npm)](https://www.npmjs.com/package/@thesatoshicompany/optimism-openzeppelin-compat)

This repo contains patches needed to use the OpenZeppelin contracts with Optimism L2.

Example: When using Optimism ETH is not supported and instead WETH must be used. When using OpenZeppelin Address contract via ERC20, there are balance checks for ETH and thus the compilation fails due to an unsupported OPCODE. This patches these issues and allows for seamless development.
> Example: When using Optimism ETH is not supported and instead WETH
> must be used. When using OpenZeppelin Address contract via ERC20,
> there are balance checks for ETH and thus the compilation fails due to
> an unsupported OPCODE. This patches these issues and allows for
> seamless development.
## Installation

Use the following command to use:
Use the following command to install:

```
npm i --save @thesatoshicompany/optimism-openzeppelin-compat
```

Add the following to the package.json scripts section:

```
"scripts": {
+ "postinstall": "patch-package --patch-dir node_modules/@thesatoshicompany/optimism-openzeppelin-compat/patches"
},
```

`Note: Post install script is needed because this package does not patch files on install automatically. It only provides the appropriate patches and the needed module to apply them.`

`This was a design choice so full control is left to the consumer of the module for if and when they are applied.`

## Supported OpenZeppelin Versions

v3.4.1

## Have an additional patch which should be included?

Provide a PR and a review will happen so that it can be included.
16 changes: 2 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "@thesatoshicompany/optimism-openzeppelin-compat",
"version": "1.0.2",
"version": "1.0.3",
"description": "OpenZeppelin patch module for Optimism",
"main": "index.js",
"scripts": {
"postinstall": "patch-package",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand All @@ -18,7 +17,6 @@
},
"homepage": "https://github.com/derekbar90/optimism-openzeppelin-compat#readme",
"dependencies": {
"@openzeppelin/contracts": "^3.4.1",
"patch-package": "^6.4.7"
}
}

0 comments on commit 66ef793

Please sign in to comment.