Coder Social home page Coder Social logo

contracts's Introduction

Across-logo

Contains smart contract suite to enable instant token transfers between any two networks. Relays are backstopped by liquidity held in a central HubPool on Ethereum, which also serves as the cross-chain administrator of all contracts in the system. SpokePool contracts are deployed to any network that wants to originate token deposits or be the final destination for token transfers, and they are all governed by the HubPool on Ethereum.

This contract set is the second iteration of the Across smart contracts which facilitate token transfers from any L2 to L1.

These contracts were audited by OpenZeppelin which is a great resource for understanding the contracts.

This video is also useful for understanding the technical architecture.

Deployed Contract Versions

The latest contract deployments on Production will always be under the deployed tag.

Build

yarn
yarn hardhat compile

Test

yarn test # Run unit tests without gas analysis
yarn test:gas-analytics # Run only tests that count gas costs
yarn test:report-gas # Run unit tests with hardhat-gas-reporter enabled

Lint

yarn lint
yarn lint-fix

Deploy and Verify

NODE_URL_1=https://mainnet.infura.com/xxx yarn hardhat deploy --tags HubPool --network mainnet
ETHERSCAN_API_KEY=XXX yarn hardhat etherscan-verify --network mainnet --license AGPL-3.0 --force-license --solc-input

Tasks

Finalize Scroll Claims from L2 -> L1 (Mainnet | Sepolia)
yarn hardhat finalize-scroll-claims --l2-address {operatorAddress}

Slither

Slither is a Solidity static analysis framework written in Python 3. It runs a suite of vulnerability detectors, prints visual information about contract details, and provides an API to easily write custom analyses. Slither enables developers to find vulnerabilities, enhance their code comprehension, and quickly prototype custom analyses.

Spire-Contracts has been analyzed using [email protected] and no major bugs was found. To rerun the analytics, run:

slither contracts/SpokePool.sol
\ --solc-remaps @=node_modules/@
\ --solc-args "--optimize --optimize-runs 1000000"
\ --filter-paths "node_modules"
\ --exclude naming-convention

You can replace SpokePool.sol with the specific contract you want to analyze.

ZK Sync Adapter

These are special instructions for compiling and deploying contracts on zksync. The compile command will create artifacts-zk and cache-zk directories.

Compile

This step requires Docker Desktop to be running, as the solc docker image is fetched as a prerequisite.

yarn compile-zksync

License

All code in this repository is licensed under BUSL-1.1 unless specified differently in the file. Individual exceptions to this license can be made by Risk Labs, which holds the rights to this software and design. If you are interested in using the code or designs in a derivative work, feel free to reach out to [email protected].

contracts's People

Contributors

nicholaspai avatar chrismaree avatar mrice32 avatar pxrl avatar dependabot[bot] avatar dohaki avatar james-a-morris avatar bmzig avatar amateima avatar evaldofelipe avatar kevinuma avatar puma314 avatar

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.