GithubHelp home page GithubHelp logo

rojotek / contracts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ethereum-optimism/contracts

0.0 0.0 0.0 2.53 MB

[Optimism] Smart Contracts

License: MIT License

TypeScript 45.98% Solidity 53.16% Python 0.20% JavaScript 0.55% Shell 0.11%

contracts's Introduction

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

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.