• This repository has been archived on 12/Apr/2021
  • Stars
    star
    251
  • Rank 157,177 (Top 4 %)
  • Language
    Solidity
  • License
    MIT License
  • Created over 3 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[Optimism] Smart Contracts

[DEPRECATED] This repository is now deprecated in favour of the new development monorepo.

Optimistic Ethereum Smart Contracts

@eth-optimism/contracts contains the various Solidity smart contracts used within the Optimistic Ethereum system. Some of these contracts are deployed on Ethereum ("Layer 1"), while others are meant to be deployed to Optimistic Ethereum ("Layer 2").

Within each contract file you'll find a comment that lists:

  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.

A more detailed overview of these contracts can be found on the community hub.

Usage (npm)

If your development stack is based on Node/npm:

npm install @eth-optimism/contracts

Within your contracts:

import { SomeContract } from "@eth-optimism/contracts/SomeContract.sol";

Guide for Developers

Setup

Install the following:

Clone the repo:

git clone https://github.com/ethereum-optimism/contracts.git
cd contracts

Install npm packages:

yarn install

Running Tests

Tests are executed via yarn:

yarn test

Run specific tests by giving a path to the file you want to run:

yarn test ./test/path/to/my/test.spec.ts

Measuring test coverage:

yarn test-coverage

The output is most easily viewable by opening the html file in your browser:

open ./coverage/index.html

Compiling and Building

Easiest way is to run the primary build script:

yarn build

Running the full build command will perform the following actions:

  1. build:contracts - Compile all Solidity contracts with both the EVM and OVM compilers.
  2. build:typescript - Builds the typescript files that are used to export utilities into js.
  3. build:copy - Copies various other files into the build folder.
  4. build:dump - Generates a genesis state from the contracts that L2 geth will use.
  5. build:typechain - Generates TypeChain artifacts.

You can also build specific components as follows:

yarn build:contracts

Security

Please refer to our Security Policy for information about how to disclose security issues with this code.

More Repositories

1

optimism

Optimism is Ethereum, scaled.
Go
5,098
star
2

optimism-tutorial

Build your first app on Optimism!
Solidity
733
star
3

cannon

On chain interactive fault prover for Ethereum
Solidity
572
star
4

community-hub

Optimism Governance Docs
Vue
300
star
5

ecosystem-contributions

Find ways to contribute to the Optimism Collective
TypeScript
278
star
6

ethereum-optimism.github.io

Unified token list for OP Mainnet, Base, and other OP Chains
TypeScript
228
star
7

optimism-starter

A boilerplate for getting started with optimism
Solidity
181
star
8

optimistic-specs

Optimistic: Bedrock, is a protocol that strives to be an extremely simple optimistic rollup that maintains 1:1 compatibility with Ethereum
Go
167
star
9

op-geth

Go
129
star
10

OPerating-manual

OPerating Manual of the Optimism Collective. https://optimism.io/vision
128
star
11

optimism-project-ideas

Ways to contribute to the Optimism Collective
112
star
12

asterisc

Work in progress RISC-V interactive fraud-proof tech
Go
81
star
13

smock

[Optimism] Solidity mock contracts in JavaScript
TypeScript
73
star
14

brand-kit

Brand assets for Optimism
67
star
15

op-analytics

Onchain Data, Utilities, References, and other Analytics on Optimism
Jupyter Notebook
57
star
16

docs

Optimism Developer Docs
MDX
52
star
17

developers

This repository is to serve as a place where builders on every level of the OP Stack can come to collaborate.
52
star
18

kona

A suite of libraries and build pipelines for developing verifiable Rust programs targeting Fault Proof VMs.
Rust
49
star
19

optimism-integration

[Optimism] Service Integration & Rapid Development
Shell
48
star
20

go-ethereum

[Optimism] Go implementation of the Optimistic Ethereum protocol
Go
39
star
21

solidity

[Optimism] (Slightly) modified Solidity compiler
C++
37
star
22

axos

Portable no-std Derivation Pipeline engineered in pure Rust
Rust
25
star
23

superchain-ops

Solidity
25
star
24

ecosystem

Optimism is Ethereum, scaled.
TypeScript
24
star
25

minigeth

Stripped-down oracle-augmented version of geth for use in fault proofs.
Go
23
star
26

Truffle-ERC20-Example

A simple ERC20 token project in Truffle to get started with the OVM
JavaScript
22
star
27

verifier

[Optimism] Layer 2 Verifier
JavaScript
21
star
28

lib-keccak

Keccak-f[1600] permutation in the EVM
Solidity
20
star
29

merch

official optimism merch instructions
19
star
30

superchain-relayer

Interface to relay messages from L2 to L1 for OP Chains using the Optimism SDK
Solidity
18
star
31

optimism-mud-starter

A MUD based starterkit by optimism
TypeScript
17
star
32

reference-optimistic-geth

Go
16
star
33

optimism-ts-services

[Optimism] Client-Side Services
TypeScript
15
star
34

superchain-registry

Go
14
star
35

Waffle-ERC20-Example

A simple ERC20 token project in Waffle to get started with the OVM
Solidity
14
star
36

batch-submitter

[Optimism] Batches go zoom
TypeScript
11
star
37

plugins

[Optimism] Plugins!
TypeScript
11
star
38

data-transport-layer

[Optimism] Shuttling data from L1 all day.
TypeScript
11
star
39

regenesis

[Optimism] State Dumps & Regenesis Automation
JavaScript
10
star
40

optimistic-pm

Modeled after https://github.com/ethereum/eth2.0-pm
9
star
41

.github

[Optimism] Default GitHub configuration files
9
star
42

integration-tests

[Optimism] Service Integration Tests
TypeScript
8
star
43

tx-overload

Go
7
star
44

chug-splash

Chuggin' and splashin', splashin' and chuggin'. Chugslash!
TypeScript
7
star
45

stack-docs

OP Stack documentation
Vue
4
star
46

infra

Optimistic infrastructure
Shell
4
star
47

workshops

Workshops that we teach
Solidity
3
star
48

docker

[Optimism] Dockerfiles and Entrypoints
Shell
2
star
49

design-docs

2
star
50

changelog

HTML
2
star
51

service-base

[Optimism] A simple framework for stateful JS services
TypeScript
2
star
52

optimism-faq-bot

Optimism FAQ bot for Discord. A fork of Rari-Capital's FAQ bot :0
Python
2
star
53

l2-geth-state-dumper

A small utility for generating an L2 genesis state
Go
2
star
54

ovm-subgraphs

TypeScript
1
star
55

keygeneration

[Optimism] Airgapped Key Generation
Shell
1
star
56

scripts

[Optimism] Various misc. scripts
JavaScript
1
star