Repot Logo
ContractsChainsProtocolsSocial Media
Search for all contractsSearch for code snippets
Contracts
Protocols
Repot
v0.8.0
Repot
DocumentationPrivacyTerms
Social
DiscordXTelegram
Mantle Network

Mantle Network

Audited

Website    |    Tech Docs



  • :book: Introduction
  • :dart: Goals
  • :rocket: Quick Start
    • :link: Useful Addresses
    • :computer: Set up Local Environment
    • :wrench: Using the Mantle SDK
    • 🧩 Using the Node RPC API
    • πŸŽ› Spin up a Verifier Node
  • :ledger: Directory Structure
  • :sparkles: How to Contribute
  • :copyright: License

Introduction

Mantle is a suite of Ethereum scaling solutions including an optimistic rollup and ZK rollup built using an iterative modular chain approach, and supported by Mantle’s native token $MNT.

It is designed to bolster support for hyper-scaled throughput decentralized applications (dApps) β€” from derivatives decentralized exchanges (DEXs), to gaming, to operations of decentralized autonomous organizations (DAOs).


Goals

Layer 2 rollups are built to address the scaling limitations of Ethereum by taking transaction processing to a separate execution layer, but this inevitably exposes users to the high gas fees and limited throughput on Layer 1.

Mantle's modular architecture helps achieve greater network efficiency for resources at hand, while maintaining the same level of security for all network actors. Increased network performance also enables better fraud proof and ZK proof technology, essentially unlocking the true potential of L2 rollups.

Different parts of the Mantle tech stack are specialized to tackle specific issues.

  • Data Availability: Data Availability powered by EigenDA technology, an innovative re-staking solution that leverages Ethereum's validator network to bring the security of L1 to L2
  • EVM-level Fraud Proofs: Improved fraud proofs that are evaluated using EVM-level instructions

We encourage you to check out the Mantle tech docs to learn more about the inner workings of Mantle.


Quick Start

Useful Addresses

Name Mainnet Testnet
Token Faucet N/A https://faucet.testnet.mantle.xyz/
Mantle Bridge https://bridge.mantle.xyz/ https://bridge.testnet.mantle.xyz/
Mantle Explorer https://explorer.mantle.xyz/ https://explorer.testnet.mantle.xyz/
Mantle Node RPC URL https://rpc.mantle.xyz/ https://rpc.testnet.mantle.xyz/
Chain ID 5000 5001

DApps need to connect to nodes for fetching block data and sending transactions to the Mantle network. Our JSON-RPC API supports HTTPS and WebSocket connections.

Service Mainnet Testnet
RPC https://rpc.mantle.xyz/ https://rpc.testnet.mantle.xyz/
WebSocket wss://ws.mantle.xyz wss://ws.testnet.mantle.xyz

Using the Mantle SDK

You can use npm or yarn package managers to download and install the @mantleio/sdk package. We'll use yarn in this example.

  1. Set up a project directory.
mkdir MantleSDK
cd MantleSDK
npm init --yes
  1. Download and install the SDK package using this command.
yarn add -D @mantleio/sdk
  1. Create a <filename>.js script and get started by making a request, for instance, to fetch the current L1 gas price.
const ethers = require("ethers")
const mantle = require("@mantleio/sdk")

const l2RpcProvider = new ethers.providers.JsonRpcProvider("https://rpc.testnet.mantle.xyz")

async function main() {

    console.log(await mantle.getL1GasPrice(l2RpcProvider))
}

main();
  1. Run your script using the node <filename>.js command to see the output.

Feel free to browse through our compilation of tutorials that use the Mantle SDK to demonstrate common functionality such as bridging assets between Mantle and Ethereum, and more.

The SDK docs provide complete reference of all the methods available as part of the Mantle SDK to facilitate interaction between applications and Mantle network.


Spin up a Verifier Node

There are multiple roles associated with Mantle nodes. Rollup Verifiers mainly sync rollup data from Mantle's trusted Sequencer (to be decentralized in the future!). dApp builders who run their own verifier nodes have the benefit of being able to simulate L2 transactions, among other advantages, and have ready access to them without rate-limiting (as opposed to public RPCs).

Here's a tutorial describing the process of deploying a verifier node.


Directory Structure

root
β”œβ”€β”€ packages
β”‚   β”œβ”€β”€ common-ts: Common tools for building apps in TypeScript
β”‚   β”œβ”€β”€ contracts: L1 and L2 smart contracts for Mantle
β”‚   β”œβ”€β”€ core-utils: Low-level utilities that make building Mantle easier
β”‚   β”œβ”€β”€ data-transport-layer: Service for indexing Mantle-related L1 data
β”‚   β”œβ”€β”€ fault-detector: Service for detecting Sequencer faults
β”‚   β”œβ”€β”€ message-relayer: Tool for automatically relaying L1<>L2 messages in development
β”‚   β”œβ”€β”€ replica-healthcheck: Service for monitoring the health of a replica node
β”‚   └── sdk: provides a set of tools for interacting with Mantle

~~ Production ~~
β”œβ”€β”€ batch-submitter: Service for submitting batches of transactions and results to L1
β”œβ”€β”€ mt-batcher: Service for submitting batches of transactions to EigenDA
β”œβ”€β”€ mt-challenger: EigenDA data fraud proof
β”œβ”€β”€ bss-core: Core batch-submitter logic and utilities
β”œβ”€β”€ gas-oracle: Service for updating L1 gas prices on L2
β”œβ”€β”€ integration-tests: Various integration tests for the Mantle network
β”œβ”€β”€ l2geth: Mantle client software, a fork of geth v1.9.10  (deprecated for BEDROCK upgrade)
β”œβ”€β”€ l2geth-exporter: A prometheus exporter to collect/serve metrics from an L2 geth node
β”œβ”€β”€ proxyd: Configurable RPC request router and proxy

How to Contribute

Read through CONTRIBUTING.md for a general overview of our contribution process. Then check out our list of good first issues to find something fun to work on!


License

Code forked from optimism under the name optimism is licensed under the GNU GPLv3 in accordance with the original license.

All other files within this repository are licensed under the MIT License unless stated otherwise.

Mantle Network

Mantle Network is a high-performance, modular Ethereum Layer-2 (L2) blockchain optimized for scalability and usability. Designed with developers and users in mind, Mantle Network provides the tools and infrastructure necessary to build decentralized applications (dApps) with superior efficiency and security.

Key Features

  • Modular Architecture: Separates consensus, data availability, and execution layers for maximum scalability and performance.
  • Ethereum Compatibility: Fully compatible with Ethereum's EVM, enabling seamless deployment of existing smart contracts.
  • Optimized for Developers: Robust SDKs, detailed documentation, and developer-friendly APIs to accelerate dApp development.
  • Low Transaction Costs: Leverages cutting-edge technologies to provide low-cost, high-speed transactions.
  • Secure by Design: Inherits Ethereum's battle-tested security with enhanced L2-specific measures.

Getting Started

  1. Clone this repository:

    git clone https://github.com/mantlenetwork/mantle-network.git
    cd mantle-network
    
  2. Follow the installation guide to set up your environment.

  3. Explore the examples directory for sample projects and use cases.

Documentation

Comprehensive documentation is available here. It includes guides for:

  • Setting up and running a Mantle node.
  • Deploying smart contracts.
  • Building and scaling dApps on Mantle.

Community and Support

Join our growing community of developers and blockchain enthusiasts:

  • Discord
  • Twitter
  • Reddit

For technical support, please create an issue or contact us at [email protected].

Contributing

We welcome contributions! Please read our contribution guide to get started.


Β© 2024 Mantle Network. All rights reserved.

Download CodeOpen Code

.DS_Store