Commit 1e9549a2 authored by smartcontracts's avatar smartcontracts Committed by GitHub

Merge pull request #2126 from ethereum-optimism/sc/ct-readme-1

maintenance: contracts README update 1
parents 0f042da8 175ae0bf
---
'@eth-optimism/contracts': patch
---
Minor README update
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
# Optimism Smart Contracts # Optimism Smart Contracts
`@eth-optimism/contracts` contains the various Solidity smart contracts used within the Optimism system. `@eth-optimism/contracts` contains the various Solidity smart contracts used within the Optimism system.
Some of these contracts are deployed on Ethereum ("Layer 1"), while others are meant to be deployed to Optimism ("Layer 2"). Some of these contracts are [meant to be deployed to Ethereum ("Layer 1")](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/contracts/L1), while others are [meant to be deployed to Optimism ("Layer 2")](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/contracts/L2).
Within each contract file you'll find the network upon which the contract is meant to be deloyed, listed as either `EVM` (for Ethereum) or `OVM` (for Optimism).
If neither `EVM` nor `OVM` are listed, the contract is likely intended to be used on either network.
Within each contract file you'll find a comment that lists: ## Usage (npm)
1. The compiler with which a contract is intended to be compiled, `solc` or `optimistic-solc`.
2. The network upon to which the contract will be deployed, `OVM` or `EVM`.
<!-- TODO: Add link to final contract docs here when finished. --> You can import `@eth-optimism/contracts` to use the Optimism contracts within your own codebase.
We currently only export `@eth-optimism/contracts` via `npm`.
## Usage (npm) Install via `npm` or `yarn`:
If your development stack is based on Node/npm:
```shell ```shell
npm install @eth-optimism/contracts npm install @eth-optimism/contracts
...@@ -21,7 +21,16 @@ npm install @eth-optimism/contracts ...@@ -21,7 +21,16 @@ npm install @eth-optimism/contracts
Within your contracts: Within your contracts:
```solidity ```solidity
import { SomeContract } from "@eth-optimism/contracts/SomeContract.sol"; import { SomeContract } from "@eth-optimism/contracts/path/to/SomeContract.sol";
```
Note that the `/path/to/SomeContract.sol` is the path to the target contract within the [contracts folder](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/contracts) inside of this package.
For example, the [L1CrossDomainMessenger](/contracts/L1/messaging/L1CrossDomainMessenger.sol) contract is located at `/contracts/L1/messaging/L1CrossDomainMessenger.sol`, relative to this README.
You would therefore import the contract as:
```solidity
import { L1CrossDomainMessenger } from "@eth-optimism/contracts/L1/messaging/L1CrossDomainMessenger.sol";
``` ```
## Guide for Developers ## Guide for Developers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment