# About MetaTrust

## What is MetaTrust?

MetaTrust is dedicated to building a secure infrastructure for WEB 3.0 developers. Our team brings together top security researchers and experienced experts from academia and industry.MetaTrust Solutions

<figure><img src="/files/dJ3cGr4BhUVJbzcTfRZS" alt=""><figcaption><p>Our tools and solutions cover all attack surface</p></figcaption></figure>

## **MetaTrust Solutions**

Construct a secure system for the comprehensive life cycle management of Web3.0 projects, featuring four core products: [MPM](/introduction/mpm), [MetaScan](/introduction/metascan), [MetaScout](/introduction/metascout), and [MetaScore](/introduction/metascore).


# MetaScan

Overview of MetaScan

## Introduction

MetaScan adopts a revolutionary approach that puts developers first. It integrates multiple security scanning engines into a single platform with unprecedented speed and accuracy, ensuring the protection of every layer of the application, not just the smart contract layer.MetaScan security platform includes multiple critical engines:&#x20;

MetaScan security platform includes multiple critical engines:

* [Security Analyzer](/introduction/metascan/security-analyzer): Detect security vulnerabilities in smart contracts.
* [Security Prover](/introduction/metascan/security-prover): Prove free of vulnerability in smart contracts using formal methods.
* [GPTScan](/introduction/metascan/gptscan): Harnessing the Potential of GPT for Accurate Vulnerability Detection.
* [Open Source Analyzer](/introduction/mpm): Supply chain analysis tool which pinpoints vulnerabilities in a developer's open-source dependencies early in the entire software development lifecycle.
* [IP Analyzer:](broken://pages/6qWvGiFdmBVxnCqy6LEB) Detect vulnerabilities in smart contracts caused by code clones.
* [Code Quality](/introduction/metascan/code-quality): Detect contract code quality and code convention compliance.

## Environments

MetaScan provides multiple ways to utilize the product:

### WEB

The MetaScan Web UI at <https://app.metatrust.io> offers a user-friendly, browser-based experience. It incorporates features like organization management, issue filtering, and report generation for resolving identified issues.

### API Integration

Experienced users and partners have the option to leverage MetaScan's APIs to explore its functionalities. The APIs encompass a wide range of common operations that can be performed on the web platform, including project creation, scan execution, and retrieval of scan results.

The API documentation can be accessed at <https://app.metatrust.io/api/docs/index.html>


# Security Analyzer

Introduction to the Security Analyzer scan engine

Security analyzer is an automatic static analysis tool for detecting smart contract vulnerabilities. In this tool, we adopted the context-sensitive, flow-sensitive, money-sensitive technologies to conduct static analysis. First, we collected the almost-known vulnerable smart contracts, and analyzed how these vulnerabilities happened. Then, we designed our threat analysis model to accurately abstract the pattern of these vulnerabilities. Third, we developed more than 100 rules to automatically detect these vulnerabilities. In total, we have developed 12 categories of vulnerabilities as follows:

* Compiler: Vulnerabilities that derive from the solidity compilers, such as the array usage in ABIEncoderV2 in 0.5.9 version.
* Cross-chain: Bugs related with cross-chain bridges, such as the private key leakage.
* Blockchain: Come from the API usage related blockchain, such as block.number, GasLeft, block.difficulty, etc.
* Language: Common vulnerabilities in smart contract languages, such as reentrancy, integer overflow.
* ERC: Happen due to the ERC standards, such as the event missing in some function, the index missing in event emit.
* Cryptography: Related with the cryptography algorithm and usage, such as signature malleability, ecrecover usage.
* Controlled resource: Indicate the vulnerabilities that are related controlled source, such as the access control.
* Protocol: Vulnerabilities in design and implementation of protocol (e.g., DeFi), including the economic model security.
* DeFi liquidity model: Abnormal settlement and reward collection due to the use of easily manipulated price dependencies in economic model.
* DeFi economic model: The dangerous DeFi economic model formed by the combination of complex DeFi behaviors.
* NFT: Additional tokens are minted during NFT minting, causing losses to the project party, such as false deposit.
* DAO: Dangerous DAO voting design, leading to the main permissions being manipulated by attackers, such as flash-loan based DAO voting attacks.

With the release of MetaScan Verison 1.7, we also provide the integration of AI into the Security Analyzer. Leveraging the advanced capabilities of ChatGPT, our AI augmentation provides enhanced vulnerability detection, comprehensive insights, and actionable recommendations to fix identified issues. We encourage you to test drive this new feature and share feedback so we can refine it further. The AI augmentation makes MetaScan more powerful and easy to use for developers.


# Security Prover

Introduction to the Security Prover scan engine

Prover is a dynamic scanning engine that runs code and explores the state space of all its execution processes. During exploration, Prover detects vulnerabilities based on execution characteristics such as property changes and execution paths. Meanwhile, Prover can prove the absence of critical vulnerabilities like reentrancy through sufficient constraint conditions. Thus, the Prover engine both detects vulnerabilities and verifies the existence of critical vulnerabilities in the code.

To implement the Prover product, we built a symbolic execution engine based on the semantic layer, supporting automatic generation of code state spaces and allowing users to write Prover scripts in Solidity to mine state spaces.

Prover's vulnerability detection includes: compiling contract files to generate AST trees, dynamically executing statements and recording the process. Finally, it determines whether there are vulnerabilities based on the state space, execution paths, and built-in rules.

Prover's safety proofs define safety proof conditions for each type of vulnerability, such as reentrancy, after obtaining the state space, thereby proving that corresponding vulnerabilities will not occur in the code.

Prover's property proofs use user-defined MAIN functions to verify that contract properties do not violate rules during contract execution.

Compared to static engines, Prover has higher reliability and lower false alarm rates because the code state spaces it analyzes are truly executable.


# GPTScan

Unleash the Power of GPT for Precise Smart Contract Vulnerability Detection

GPTScan is a groundbreaking solution that combines the power of GPT (Generative Pre-trained Transformer) with static analysis to detect logic vulnerabilities in smart contracts. Unlike traditional approaches that solely rely on GPT for vulnerability identification, GPTScan leverages GPT as a versatile code understanding tool. By breaking down each logic vulnerability type into scenarios and properties, GPTScan intelligently matches candidate vulnerabilities with GPT. To ensure precision, GPTScan provides explicit instructions to GPT for recognizing key variables and statements, validating them through static confirmation.

Through extensive evaluation on diverse datasets comprising approximately 400 contract projects and 3,000 Solidity files, GPTScan has demonstrated remarkable performance. It achieves a high precision rate of over 90% for token contracts and an acceptable precision of 57.14% for larger projects such as Web3Bugs. With an impressive recall rate of over 80%, GPTScan effectively detects groundtruth logic vulnerabilities, including 9 new vulnerabilities that went unnoticed by human auditors.

Apart from its accuracy, GPTScan is fast and cost-effective, requiring an average of only 14.39 seconds and 0.01 USD to scan per thousand lines of Solidity code. The integration of static confirmation significantly reduces false positives by two-thirds, enhancing the overall efficiency of vulnerability detection.

GPTScan marks a significant advancement in smart contract security, providing developers and auditors with a comprehensive and reliable tool for identifying logic vulnerabilities. With its unique combination of GPT and static analysis, GPTScan sets a new standard in the field of smart contract security assessment.

Detailed paper about GPTScan: <https://arxiv.org/abs/2308.03314>


# Open Source Analyzer

**Open Source Analyzer** (also known as SCA, Software Supply-Chain Analyzer) is a powerful engine designed to identify, monitor, and manage the various components and their dependencies within software. it provides developers and security experts with an in-depth understanding of software composition, enabling them to more effectively control risks and ensure system security.

Key features include:

1. Open-source component identification: SCA can automatically detect open-source components and version information used in software, facilitating tracking and management of open-source dependencies.
2. License compliance: SCA can review software component licenses, ensuring that businesses adhere to relevant regulations and compliance requirements.
3. Security vulnerability detection: SCA can identify known security flaws and risks, assisting developers in promptly patching vulnerabilities and reducing system security risks.
4. Dependency analysis: SCA can analyze the dependency structure between components, helping developers understand component interaction relationships and potential risk points.


# IP Analyzer

Introduction to the IP Analyzer scan engine

The IP Analzyer (Code-Clone) Engine is specifically designed to provide efficient and effective solutions for project IP analysis and smart contract security issue detection.Key features include:

1. Advanced code clone detection: Conducting detailed clone detection at the project, file, function, and line levels to ensure comprehensive coverage. By analyzing patterns of known security issues, it promptly identifies potential vulnerabilities in cloned code, helping users take preventive measures.
2. Open-source component insights: Providing detailed information about imported and cloned code, such as popularity, usage, and maturity, to help developers better understand the use of open-source components in their projects.


# Code Quality

The Code Quality (Lint) engine is a code quality analysis tool that performs static analysis on contract code to identify coding issues, potential errors, and non-compliant code. Its main features include:

* Code style checking: Ensuring that the code follows preset coding standards to improve consistency and readability.
* Potential error detection: Static analysis reveals problems that may cause crashes, reduced performance, or logic errors, and provides repair suggestions.
* Code optimization recommendations: Analyzing performance bottlenecks and unnecessary complexity and providing structural and performance optimization solutions.
* Maintainability analysis: Evaluating code maintainability, identifying parts that need refactoring, and improving maintainability and scalability.

Using the Lint engine helps ensure contract code stability and maintainability, improves project quality and reliability.


# MetaScout

MetaScout is a dynamic, real-time intelligent contract security monitoring platform, mainly including the following monitoring:

* On-chain Monitoring: Transaction analysis for governance attack, market price fluctuation monitoring, social sentiment monitoring, etc.
* Continuous Security Monitoring:By continuously monitoring and assessing the security situation, developers can ensure that their smart contracts maintain optimal security, thereby reducing the risk of attacks and losses.
* Online Abnormal Behavior Monitoring: Analysis of security events based on monitored behavior attacks.

<figure><img src="/files/QAg2ZjjBl3uLLui43cqL" alt=""><figcaption></figcaption></figure>


# MetaScore

## Overview

MetaScore is an innovative platform dedicated to providing comprehensive and valuable security insights by deeply analyzing smart contract codes in Web3 projects. As a value-neutral platform, MetaScore automatically identifies project security risks, serving a diverse user base including investors, project owners, developers, and Web3 media. Our services cover various aspects, such as project security rankings, real-time project security risk alerts, Web3 big data trend dashboard, and Web3 project technology trends.

Firstly, to implement project security rankings, we've constructed a multi-dimensional Web3 project security scoring and rating model. By scanning smart contract codes with our proprietary engine, we identify potential risks and generate comprehensive scores. This helps investors to fully assess the security of Web3 projects and make informed decisions. At the same time, project owners can understand their project's security position within the industry and take appropriate measures to enhance security.

Secondly, leveraging MetaScout's round-the-clock multi-chain transaction monitoring and Migration Attack Analyzer's migration attack detection capabilities, MetaScore provides users with real-time risk information for their followed projects. This enables investors and project owners to respond to risks promptly, protecting assets and avoiding financial losses.

Furthermore, we showcase the Web3 big data trend dashboard from multiple perspectives, revealing the overall security risk landscape for various stakeholders while continuously providing news materials for Web3 media.

Lastly, with IP Analyzer's code clone analysis, we offer MetaStack analysis for each Web3 project, displaying the technical frameworks and templates used in the projects. We also present the industry's technology framework evolution from a macro perspective, assisting project builders in tracking advanced security technologies and reducing security risks.

In summary, MetaScore empowers the Web3 community to build and invest in decentralized projects confidently through comprehensive security analysis and risk assessment, driving Web3's progress.

It is worth noting that to prevent security risk information from being maliciously exploited, MetaScore displays differentiated security risk information for different user types. For ordinary investors, we only display risk statistics identified in various dimensions. Upon automatically identifying and manually confirming a severe risk in a project, we promptly notify the project owner and, after verifying their identity, provide the specific risk location. Simultaneously, we offer corresponding repair suggestions, helping project owners resolve issues in a short time.By adopting this approach, MetaScore ensures that security information is not maliciously exploited while providing project owners with timely security risk alerts and solutions to protect the overall security and stability of the Web3 ecosystem.

Through continuous optimization of our services and technology, MetaScore strives to become the most trusted Web3 project security analysis platform in the industry. Our goal is to provide comprehensive security services to a diverse user base, including investors, project owners, developers, and Web3 media, fostering the healthy development of the entire Web3 industry. We believe that through our efforts and expertise, MetaScore will earn the trust and support of a wide range of users, contributing to building a safer Web3 world.

## Contact Us:

Website: <https://metatrust.io/score>

Twitter: <https://twitter.com/MetatrustLabs>

Email: <Ty@metatrust.io>


# Data

As of April 10, 2023, the MetaScore platform has scanned, rated, ranked, and provided risk alerts for important Web3 projects from mainstream platforms such as Web3 websites and exchanges. To determine the list of projects, we followed these steps:&#x20;

Firstly, we collected unique Web3 projects from Web3 websites and exchange databases. Then, we ranked these projects by calculating the average of their rankings on various platforms.&#x20;

Currently, we are committed to conducting comprehensive scanning, rating, ranking, and risk alerts for every Web3 project that can be publicly accessed on the Internet. We strive to provide the most comprehensive and accurate security analysis and risk assessment tools to help the Web3 community and investors build and invest in reliable projects in the decentralized network, driving the sustainable development of Web3.


# Dimensions in portrait system

The MetaScore portrait system aims to describe the health status of Web3 projects in the open source ecosystem under a security background. We have created six dimensions to build the Web3 project portrait system: Security Development, Security Investment, Transaction Risk, IP Risk, Code Quality Risk, and Development Process Risk.

**Security Development:** This dimension aims to evaluate the vulnerabilities and malicious code in the project's smart contract code to discover potential exploitable vulnerabilities and prevent investors from falling into trading traps.

**Security Investment:** This dimension aims to evaluate the project's investment in security, including whether there are dedicated security teams or experts involved in project development, as well as whether security audits, bug bounty programs, and insurance are implemented.

**Transaction Risk:** This dimension aims to evaluate the security and reliability of the project's smart contract in transactions, as well as whether the project adopts secure asset management and transaction processes to protect users' assets and privacy.

**IP Risk:** This dimension aims to evaluate the risk brought by code cloning and the legal risks of the project's intellectual property and code copyright, as well as whether the project follows relevant intellectual property laws and regulations to protect the interests of the project team and investors.

**Code Quality Risk:** This dimension aims to evaluate the quality, structure, and maintainability of the project's code to ensure the reliability and scalability of the code.

**Development Process Risk**(Coming soon): This dimension aims to evaluate the security practices, code review, and testing processes of the project's code in the development process, as well as whether the best security practices are adopted to ensure the security and stability of the code.

By evaluating these dimensions, we can comprehensively and deeply understand the security status of Web3 projects and provide more accurate security assessments and risk warnings for project teams and investors. We are committed to providing the most comprehensive and accurate security assessment tools to help the Web3 community and investors build trustworthy projects and promote the sustainable development of Web3.


# Score and Rating

## 1. Score

Our proprietary tool is used to scan the projects to be analyzed. In each rating dimension, the project is ranked based on the tool's scan results and a ranking score is calculated, ranging from 0-100. The ranking scores of several dimensions are weighted to give each project a total score, which serves as the project's final security score. The determination of the weight value of each dimension is based on the APH hierarchical method \[1].

The scoring process involves the following important aspects:&#x20;

1\). A higher security score for a project indicates that it is more secure and trustworthy.&#x20;

2\). When calculating the ranking score based on the engine's scan results, a reverse ranking is used. For example, if a project has more vulnerabilities detected by the vulnerability scanning engine, its ranking score will be relatively lower.

## 2. Rating

Here is the score and rating comparison table in descending order:

| Score Range | Rating |
| ----------- | ------ |
| 95-100      | AAA    |
| 90-95       | AA     |
| 80-90       | A      |
| 75-80       | BBB    |
| 65-75       | BB     |
| 60-65       | B      |
| 50-60       | CCC    |
| 45-50       | CC     |
| 40-45       | C      |
| 30-40       | DDD    |
| 20-30       | DD     |
| <20         | D      |

This table is used to assign the corresponding rating to the project based on its final security score. The rating system ranges from AAA (highest) to DDD (lowest).

\[1] AHP, <https://en.wikipedia.org/wiki/Analytic_hierarchy_process#Hierarchies_in_the_AHP>


# MPM

The MPM is the Meta Package Manager that are specifically designed to provide a more secured and light-weighted solution for the publishment, maintenance, distribution, integration, and security of the supply chain of Web3 projects, including not only the Web3 contracts, but also the web2 infrastructures. Based on MPM, we aim to provide a better integrated solution for the community to establish a more secured Web3 ecosystem. MPM consists of 6 main submodules, MPM Registry, MPM Advisory, MPM Client, MPM Backend, MPM Auditing, and MPM Configuration.

* MPM Registry is a private registry to maintain the artifacts and their corresponding metadata that are verified by us, and it also provides the comprehensive security profiles of the commonly used third-party libraries and smart contracts. Based on this, we can make comprehensive decisions on handling and mitigating security threats within users’ projects.
* &#x20;MPM Advisory is an advisory database to maintain the security related information (i.e., vulnerabilities) for both web2 and web3 components (i.e., third party libraries and smart contracts, etc.), including not only public vulnerabilities, but also vulnerabilities collected by our other powerful scanners. This also play an important role to mitigate security threats within users’ projects.
* MPM Client is the package manager client, with which users can not only easily manage their dependencies (i.e., smart contracts, third-party libraries, etc) in secured ways, but also obtain comprehensive profiles (i.e., from MetaScore) of their own projects before publishment or on-chain, by interacting with our powerful engines (i.e., MPM Auditing and MPM Backend).
* MPM Backend is the backend service that processes requests from MPM Client and make right decisions on remediation strategies by not only taking the potential security risks (i.e., Meta Advisory) into consideration, but also considering the non-functional properties (i.e., the profiles in MPM Registry) so that we can provide the most appropriate and comprehensive strategies on dependency management.
* &#x20;MPM Auditing is a front end of the engines behind MetaScore, which with, we are able to provide a comprehensive analysis of users’ projects before they are published or on-chain.
* MPM Configuration is a set of new configuration options realized by a new domain specific language for Web3 project configuration management, which not only offers a new and more light-weighted way for users to define their dependencies on external smart contracts, but also provides a flexible and configurable way for users to control the thresholds and priorities when deriving integrated solutions on dependency management.


# Getting Started with MetaScan

Discover the power of MetaScan: Your essential tool for secure smart contract and Web3 project scanning

This document describes the necessary steps you should follow to get started with using MetaScan. These steps cover the entire workflow, from account creation to obain security analysis report.

1. [Sign-up and sign-in](/getting-started/getting-started-with-metascan/sign-up-and-sign-in)
2. [Set up an integration (optional)](/getting-started/getting-started-with-metascan/set-up-an-integration-optional)
3. [Add projects](/getting-started/getting-started-with-metascan/add-projects)
4. [Scan for vulnerabilities](/getting-started/getting-started-with-metascan/scan-for-vulnerabilities)
5. [View scan results](/getting-started/getting-started-with-metascan/scan-for-vulnerabilities)
6. [Generate and download scan reports](/getting-started/getting-started-with-metascan/generate-and-download-scan-reports)


# Sign-Up and Sign-In

MetaScan is available at [https://app.metatrust.io.](https://app.metatrust.io)

You need to setup an account and sign-in with that account to access all the features.&#x20;

There are 2 ways to sign-in to MetaScan:

* Create an account with your email then sign-in&#x20;
* Sign in using an existing third-party account via OAuth login

## Create an Account

<table data-card-size="large" data-view="cards"><thead><tr><th align="center"></th><th data-hidden></th><th data-hidden></th><th data-hidden data-type="files"></th></tr></thead><tbody><tr><td align="center"><img src="/files/h5SHJSOBjtTw7GKjiCZp" alt=""></td><td></td><td></td><td></td></tr><tr><td align="center"><img src="/files/04S2pIx8pBopzPXDqnXV" alt=""></td><td></td><td></td><td></td></tr></tbody></table>

1. Click the link "Sign up now" on the sign-in page, , which redirects you to the sign-up form.
2. Fill in your email and passwords, accept our terms and privacy policy on the sign-up page, then click the button "Sign Up Now".
3. You will receive an email with a confirmation link in a minute or two. Click the link to confirm your email address. The link will open the MetaScan page and automatically log you into the platform.

## Sign In Using Third-Party Identity (OAuth)

If you'd like to sign in with your identity at a third-party service (like GitHub) without going through the sign-up process, follow these steps:

(We are going to use GitHub as an example here)

1. Click on the **GitHub icon** on the sign-in page.&#x20;
2. The browse will redirect to GitHub.&#x20;
3. If this is your first time using this sign-in method, you need to confirm to let MetaScan use your GitHub identity. Read the information on the GitHub page and click "**Authorize MetaTrustLabs**".
4. Your browser will redirect back to MetaScan and you will automatically sign-in.

{% hint style="info" %}
We are working hard to add support for other popular 3rd-party services, and you will be able to sign in with your Google or Twitter account soon.
{% endhint %}


# Set Up an Integration (Optional)

If you plan to scan your GitHub repositories for vulnerability, you need to setup an integration and grant access of your repositories to MetaScan.

{% hint style="info" %}
This step can be skipped if you plan to scan code in a public repository or in an uploaded zip-file.
{% endhint %}

## Integration Types

Users can set the appropriate source code platform where the projects to be scanned are located.

## Example: Setting up source code management integration

If you want to scan projects in Git's source code platform, you will need to use Git Repository Integration to connect. MetaScan has pre-built integrations for GitHub, with subsequent extensions for other repositories GitLab, Bitbucket, etc.

**First**, after the user logs in successfully, click \[Integrations] to enter its main interface.

<figure><img src="/files/BrzDjuxgEXg6Fn9ttkSL" alt=""><figcaption></figcaption></figure>

**Next**, click on the source code platform (e.g., GitHub) to integrate with MetaScan.

**Finally**, to grant MetaScan access to the source code platform, enter your account credentials and save your information when prompted.


# Add Projects

MetaScan assists users in scanning problematic projects to identify vulnerabilities in them. You first need to add a project.

You can add projects in two easy steps:

**Step 01:** Click \[Projects] -> \[Add Project], you can choose \[GitHub] or \[Upload] to get the projects you want to scan.

<figure><img src="/files/YlmvFAjmWwnIiv3aguUB" alt=""><figcaption></figcaption></figure>

**Step 02:** For GitHub selection as example 1, you can select the repositories stored in it.  For Upload selection as example 2, you can upload the local projects.

**Example 1**:  After selecting GitHub, you can select the project \[v3-core], and finally click the \[confirm] button to import this project.

<figure><img src="/files/gLDFFAR9hua2F8F5o7Ok" alt=""><figcaption></figcaption></figure>

After importing the project \[v3-core] successfully, you will see the following screenshot:

<figure><img src="/files/TicKcHjFtn3Ju2xtAoSE" alt=""><figcaption></figcaption></figure>

**Example 2**: You can also import projects by uploading local files following the guide.

<figure><img src="/files/Ue6EqPIPPoyY8rXKtpRZ" alt=""><figcaption></figcaption></figure>


# Scan for Vulnerabilities

We support flexible configuration of scanning parameters, mainly engine configuration and standardized configuration, before the project starts to be scanned.

## Flexible configuration

### **Engine configuration：**

After the user clicks the \[Start Scan] button located on the right side of the imported project, MetaScan will confirm the engine configuration with the user.

<figure><img src="/files/Ov63LA2HFR9za6V9YMsP" alt=""><figcaption></figcaption></figure>

### Standardized configuration：

Moreover, users can also click "Advanced Scan Settings" to set personalized parameter configuration.

<figure><img src="/files/CWgnnvpN4kcES1GhpfMh" alt=""><figcaption></figcaption></figure>

## Start scanning

After the project scanning parameters are configured, users can click the \[Start Scan] button to start scanning the project automatically. The project will be in scanning status.

<figure><img src="/files/exCfY0kHZYh0j49gWj8c" alt=""><figcaption></figcaption></figure>


# View Scan Results

After completing the scan, users can view the details of the scan results.

**Step 01**: Once the project scan is complete, users can directly view the scan results.

<figure><img src="/files/rVlEcevH2P9j0ZRMvor3" alt=""><figcaption></figcaption></figure>

**Step 02:** For scanned projects, users can click on the name of any engine on the left to navigate to the specific details page to check the detail.

<figure><img src="/files/lWv7O7hsUzSIB1Ye2Cdt" alt=""><figcaption></figcaption></figure>


# Generate and Download Scan Reports

After the project is scanned, the system will automatically generate a security report for the project, and users can download the report on demand to view the details.

In the upper right corner of the project's detail page, click on the \[Reports] drop-down menu and users can select the scanned engine to download the report in .PDF format.

<figure><img src="/files/JCcIxmnZoUYZnAUquhE6" alt=""><figcaption></figcaption></figure>


# How to use Security Prover

A step-by-step guide for using the scanning engine Security Prover on MetaScan

Here is a step-by-step guide for using the scanning engine Security Prover on MetaScan based on the demo contract code. You can also watch the [video instructions](https://youtu.be/CatvrkcJTNk).  (Video Link: <https://youtu.be/CatvrkcJTNk>)

1. Upload the smart contract to MetaScan.\
   Click "Add Projects" and select "Upload Files" to add the project that needs scanning.

   <div><figure><img src="/files/B29hG2lWqGLy3XA62345" alt=""><figcaption></figcaption></figure> <figure><img src="/files/YdhtKJw3OahRSvhcCCIC" alt=""><figcaption></figcaption></figure></div>
2. Select the appropriate project type based on the situation. Here we select "Framework-less Solidity Files" and click "Continue".

   <figure><img src="/files/JEkc7dvcpiweBGrY3AXV" alt=""><figcaption></figcaption></figure>
3. Upload a zip file of the project and click "Continue".

   <figure><img src="/files/KfNgEjxND10YzoVj6IDo" alt=""><figcaption></figcaption></figure>
4. Input a project name and click "Upload" to upload the project.

   <figure><img src="/files/6RcbnoY4Dfh6wLzvcriL" alt=""><figcaption></figcaption></figure>
5. Configure contract analysis settings and scan. Click "Start Scan" to prepare for scanning.

   <figure><img src="/files/nVZK3qHiyGGVJJq0TcsP" alt=""><figcaption></figcaption></figure>
6. Select "Security Prover" and fill in the name of the contract to verify in "Entry Contract", here we fill in "Token". Then click "Start Scan" to start security scanning.

   <figure><img src="/files/eh5EjS6PBySWeaEDQKNJ" alt=""><figcaption></figcaption></figure>

   <figure><img src="/files/7KgIKXcRgvxANX7pDuA6" alt=""><figcaption></figcaption></figure>
7. Review key metrics and information from the report.

   <figure><img src="/files/fHyQrWGpxUNreHtjHZIu" alt=""><figcaption></figcaption></figure>
8. Click on "EquailzationOfTransferBalances" under "Rules" and check the "Call Trace" information based on violation.\
   From the information, we know the violated condition is `assert(balanceBefore == balanceAfter);`\
   From the "Rule Call Resolutions" on the right, we know that when msg.sender is the same as $to, it will violate the check condition

   <figure><img src="/files/R73u5GzZAiYu458Iy2sR" alt=""><figcaption></figcaption></figure>
9. Click on the "transfer" in the "Call Trace" to check deeper call stack information.\
   In `uint256 senderAmount = _balances[sender];` senderAmount is 20000\
   In `uint256 recipientAmount = _balances[recipient];` recipientAmount is 20000

   <figure><img src="/files/RzuqilKbgb6PZ3pRHI62" alt=""><figcaption></figcaption></figure>
10. After calling `_balances[sender] = senderAmount.sub(amount);`, `_balances[sender]` becomes 19900

    <figure><img src="/files/c9AA5gWPLUHzX7ZVBs9E" alt=""><figcaption></figcaption></figure>
11. After calling `_balances[recipient] = recipientAmount.add(amount);`, `_balances[recipient]` becomes 20100

    <figure><img src="/files/7yC2cCKXGAFFRJgXJYm9" alt=""><figcaption></figcaption></figure>

**Thus the assertion `assert(balanceBefore == balanceAfter);` is finally violated.**<br>


# MetaScan

## Overview

By incorporating four major security engines, MetaScan can continuously analyze and review the quality of smart contract project source code, and can quickly detect security vulnerabilities, duplicate code and other issues in the project.&#x20;

MetaScan can greatly improve the efficiency of detecting vulnerabilities in smart contracts and effectively reduce the risk of missing security risks.


# Projects

#### **Step01: Import a Project**

&#x20;      Click \[Projects] -> \[Add Project], Users can choose the following two methods to add projects to be scanned, as shown in the following figures.

<figure><img src="/files/hpzJkKqUrycSjo46p9gY" alt=""><figcaption></figcaption></figure>

**Method 1: By GitHub**

&#x20;      After selecting GitHub, you can select the project \[v3-core], and finally click the \[confirm] button to import this project.

<figure><img src="/files/DtIDcjiLvzmgStlHZFIq" alt=""><figcaption></figcaption></figure>

**Method 2: Upload**

&#x20;You can also import projects by uploading local files following the guide.

<figure><img src="/files/uo9tLxwG8MlHoUodDVoe" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/5bq5zMMD8d1ALMQigQ8p" alt=""><figcaption></figcaption></figure>

&#x20;     The main screen for selecting the file to upload will then pop up. The user can click on the \[upload] icon in the middle to upload the document, or drag document to that area to complete the operation of uploading files. For our example here, we uploaded the local file: v3-core-main.zip

<figure><img src="/files/u4taBZ9p38Q7Spjf9Ih3" alt=""><figcaption></figcaption></figure>

&#x20;     Finally, after uploading the file successfully, click the \[Upload] button to complete the local upload.

<figure><img src="/files/dwiYLCN5yYsiVQqpMffi" alt=""><figcaption></figcaption></figure>

&#x20;     After successfully uploading local files, the main screen displays the currently uploaded projects.

<figure><img src="/files/W8GgBT7gxAV2764TiEF6" alt=""><figcaption></figcaption></figure>

#### **Step02:** Setting the scan configuration

#### **Engine configuration：**

After the user clicks the \[Start Scan] button located on the right side of the imported project, MetaScan will confirm the engine configuration with the user.

<figure><img src="/files/kWs4zO71kuWTEdQYgRUy" alt=""><figcaption></figcaption></figure>

#### Standard configuration

&#x20;     Moreover, users can also click "Advanced Scan Settings" to set personalized parameter configuration.

<figure><img src="/files/YQQoBVSd3PCp4z59DwWX" alt=""><figcaption></figcaption></figure>

#### **Step03: Start Scanning**

&#x20;     After the project scanning parameters are configured, users can click the \[Start Scan] button to start scanning the project automatically. The project will be in scanning status.

<figure><img src="/files/I3fnjvnOhBszHgP5QXem" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/RVzRsiqmQaceJ5KxD2dq" alt=""><figcaption></figcaption></figure>


# Reports

Once the project scan is complete, users can directly view the scan results.

**Step01:** Users can click on the name of any engine on the left to navigate to the specific details page to check the detail.

<figure><img src="/files/KS2k0MJ5G9Kh1v3jeg8k" alt=""><figcaption></figcaption></figure>

**Step02:** The information in the details page can be exported as a report. The user needs to first click on the \[report] button, and then in the drop-down menu, select the desired engine scan report. The system will automatically generate and download the report.

After the download is successful, you can view the report immediately according to the prompt.

<figure><img src="/files/TVhI7IweFZIsfaZEop06" alt=""><figcaption></figcaption></figure>


# Users and Organizations

Each account can create different organizations, add different members under the organization, and share projects within the members.

## Create Organization

**Step01:** Click \[Personal], a dialog box will pop up.

<figure><img src="/files/zEaLvlojZJeIa0dnR8uA" alt=""><figcaption></figcaption></figure>

**Step02:** Click the \[+] button to bring up a dialog box to create an organization.

<figure><img src="/files/lpMP8gihWlRKu1i4uYFd" alt=""><figcaption></figcaption></figure>

**Step03:** Fill in the Organization name and click \[Submit] to store it.

<figure><img src="/files/HEpS3tmvl4uLjrfEiM7i" alt=""><figcaption></figcaption></figure>

**Step04:** Finally, in order to view the organization just created, users can click on the Personal Center in the upper right corner of the page to view and edit organization information.

<figure><img src="/files/MNmJWcsOnwzfa1cOBWDR" alt=""><figcaption></figcaption></figure>

## Add organization members

For adding organization members, users should first select organization.

Click \[Organization] in the Personal Center to enter the main interface of Organization. Users can click on the currently displayed organization, or switch between different organizations. In our example, aptos is selected.

<figure><img src="/files/U2iORo9b1qa41FSL13G7" alt=""><figcaption></figcaption></figure>

**Step01:** Click the \[Invite a member] button.

<figure><img src="/files/17zbgP1e47p7tGcVDi1p" alt=""><figcaption></figcaption></figure>

**Step02:** In the member invitation dialog box, you need to fill in the email and select role of the member to be invited. Then click \[Submit] to save.

<figure><img src="/files/TzphKoWl0yn2I4DIH9Lv" alt=""><figcaption></figcaption></figure>

**Step03:** After adding members successfully, the current list of members and their status will be displayed in the member list.

<figure><img src="/files/8JZbZxx5aJeOX1Hl6wkb" alt=""><figcaption></figcaption></figure>

**Step04:** After the invited user receives the email, he/she needs to click the invitation link in the email to enter the MetaTrust website, and then click the \[Join] button. After the system gives the message "Save successfully", the user can become a member of the organization.

<figure><img src="/files/Pa6qevfKcxhA7XrNfJqm" alt=""><figcaption></figcaption></figure>

**Step05:** Finally,  Refresh the main screen of the organization and you can see that the status of the invited user has changed to joined.

<figure><img src="/files/IbFB8q42yDj6Vc14kzz0" alt=""><figcaption></figcaption></figure>


# FAQs

Frequently Asked Questions

## How to ensure accurate and valid scan results?

In order for our scan engines to produce accurate and valid scan results, the projects imported should fulfill the following prerequisites:

* Projects should contain smart contracts written in Solidity language (.sol files)
* Projects should be able to compile successfully
* For mono-repos – repositories that contain multiple projects, it is necessary to specify the sub-directory of a specific project you want to scan for issues. This is configurable in the "***Advanced Settings***" section in the *Start Scan* dialog.\
  \
  For example: the repository in the following screenshot contains 3 sub-projects and each of them is a standalone, hardhat-based web3-project. It is then necessary to make sure the sub-path setting is set to a specific sub-project directory when the scan is started.<br>

  <div align="center"><figure><img src="/files/N2sN3tY0gerYhfIIJ0OF" alt=""><figcaption></figcaption></figure></div>

  <figure><img src="/files/Y6hzPRxRlB2r83DI8cen" alt=""><figcaption></figcaption></figure>

## What to do if the security scan fails?

There could be various reasons that prohibit the scan engines to delivery the final scan results. The most common problems are:

1. Invalid project
2. Missing project dependencies&#x20;
3. Unsuccessful compilation of the project

## What smart contract / web3 frameworks are currently supported?

## What smart contract formats / languages are currently supported?


# Glossary

To make the user documentation easier to use, we have developed specialized terminology, as described below:

* **B**

  * **Broker**&#x20;

  &#x20;     A system that takes the source code and builds the deployable application (such as a Security Analyzer).

* **D**

  * **Dependency**

  &#x20;     When your application uses another package, this other package becomes dependent on your software.

  &#x20;      (1)A direct dependency is a package you include in your project.

  &#x20;      (2)An indirect dependency (also known as a deep, chained, or transitive dependency) is a package used by one of your direct dependencies.

  * &#x20;**Dependency tree**

  &#x20;      (Also known as Dependency path) A hierarchical graph shows the dependencies of a software application. It includes direct and indirect dependencies, and levels may be deep.

* **E**

  * **Environment**

  &#x20;     It can refer to a MetaTrust Environment, a project attribute, or an interface for working with MetaTrust, such as the MetaTrust CLI, Web UI, or an IDE.

  * **Exploit**

  &#x20;     Demonstration of how to exploit the vulnerability. When an exploit is widely published, it is commonly referred to as an exploit in the wild.

  * **Exploit Maturity**

  &#x20;     A measure of the usefulness of an exploit, based on whether the exploit is in the wild, and how "helpful" the exploit is to an attacker. See Evaluating and prioritizing vulnerabilities.

* **F**

  * **Fixable / Partially fixable**

  &#x20;     A measure whether a vulnerability can be fixed by MetaTrust, by applying a patch, upgrade, or pin. See Fixed in version vs. fixable attributes in vulnerabilities.

  * **Fix PR**

  &#x20;     A pull request with an automatic fix for vulnerabilities that MetaTrust can offer the user.

* **G**

  * **Git**

  &#x20;     A distributed version-control system for tracking changes in source code during software development.

* **I**

  * **IDE**

  &#x20;     Integrated Development Environment. An application gives facilities for software development, typically with a source code editor, build automation tools, and a debugger.

  * **Integrations**

  &#x20;     Third-party products, applications, and platforms that MetaTrust works with, for example, SCM systems such as GitHub.

  * **Issue**

    License issues, vulnerabilities, or misconfigurations identified and listed by MetaTrust.<br>

* **L**

  * **Library**
  * &#x20; A specific type of package.

* **M**

  * **Manifest**

  &#x20;     A file that contains metadata about other files in the package.

  * **Monitor**

  &#x20;     A run of the MetaTrust **monitor** command that tests the project and uploads results to MetaTrust.

* **O**

  * **Organization**
  * &#x20; An organization in MetaTrust is a way to collect and organize your projects. Members of organizations can then access these projects.

* **P**

  * **Package**

  &#x20;      A group of files and additional metadata about those files, used by package managers.

  * **Package manager**

  &#x20;     A set of tools that automates and manages packages of bundled files, and are usually specific to a language. For example, npm.

  * **Package registry**

  &#x20;     A software package hosting service that allows customers to host packages and code in one place.

  * **Pinnable**

  &#x20;     A fix type: define and "pin" a specific version of an indirect dependency to avoid a direct dependency pulling in a vulnerable version.

  * **Project**

  &#x20;     An external item that Metascan, with configuration to define how to run that scan. Projects appear on the Projects menu on the MetaTrust dashboard. See Introduction to projects.<br>

* **R**

  * **Repository**

  &#x20;     A storage area that contains all elements necessary for the distribution of an application.

  * **Resource**

  &#x20;     A cloud infrastructure entity such as an AWS S3 bucket, Identity & Access Management (IAM) role, or Virtual Private Cloud (VPC) flows log.

  * **Rule**

  &#x20;     A security policy that checks cloud infrastructure and infrastructure as code (IaC) for misconfigurations that can lead to security problems.

* **S**

  * **SAST**

  &#x20;     Static Application Security Testing. A method of securing software by examining the source code of proprietary software and identifying the source of vulnerabilities. See also DAST.

  * **SCA**

  &#x20;     Software Composition Analysis. This technique is used to identify open-source and third-party components of an application, including their known security vulnerabilities and the usual adversarial licensing restrictions.

  * **SCM**

  &#x20;     Source Code Management. Also known as a code repo / repository / version control system. The method used by developers to store their source code and track changes to code. SCM helps resolve conflicts when merging updates from multiple contributors. GitHub is an example of a common SCM system.

  * **SDLC**

  &#x20;     Software Development Life Cycle. A process followed by a development team describing how to develop and maintain software.

  * **Security policy**

  &#x20;     A set of criteria for evaluating open-source vulnerabilities. Security policies enable you to set custom rules to prioritize or de-prioritize specific vulnerabilities automatically. The MetaTrust Default Security Policy is enabled by default, or you can create your security policy. See Security policies.

  * **Severity**

  &#x20;     A severity level is applied to a vulnerability or a license issue, to indicate the risk for that item in an application. See Severity levels.

* **V**

  * **Vulnerability** &#x20;

  &#x20;     A security vulnerability identified by MetaScan. See Fixing vulnerabilities.


# MetaTrust 产品

## 关于 MetaTrust

MetaTrust专注于为WEB 3.0开发者提供安全可靠的基础设施，我们的团队由学术界和行业顶尖的安全专家组成，致力于创新和完善解决方案，保障用户数据和资产安全。

## MetaTrust 解决方案

构建web3.0项目全生命周期的安全管理平台，包含四款核心产品MPM、MetaScan、MetaScout、MetaScore。

<figure><img src="https://1892930214-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXwKHdN6p38PW7Li7k59G%2Fuploads%2Fai1Ln2uLZrOx9aHiDLIc%2Fimage.png?alt=media&#x26;token=c755b8bc-fd0f-4cfc-8c30-6a80511fc206" alt=""><figcaption><p>我们的工具和解决方案涵盖所有的攻击面</p></figcaption></figure>

<figure><img src="/files/ukJNnqI4KqsSbWNhc3e9" alt=""><figcaption></figcaption></figure>


# MetaScan

## 简介

MetaScan采用了一种将开发者放在首位的革命性方法。它将多个尖端的安全扫描引擎整合到一个具有前所未有的速度和准确性的平台中，确保应用程序的每个层次都得到保护，而不仅仅是智能合约层。

* **MetaScan安全平台包括多个关键引擎：**
  * Security Analyzer：检测智能合约中的安全漏洞。
  * Security Prover：使用形式化方法证明智能合约无漏洞。
  * Open Source Analyzer：供应链分析工具。
  * IP Analyzer：检测由代码克隆引起的智能合约中的漏洞。
  * Code style: 检测合约代码质量

MetaScan能够在整个软件开发生命周期的早期发现开发者开源依赖中的漏洞。

**如何运行MetaScan：**\
MetaScan环境 MetaScan环境是您可以访问所选产品的方式： \
**WEB：**&#x4D;etaScan Web界面（app.metatrust.io）提供了基于浏览器的体验，以及诸如配置设置、过滤和修复发现的问题以及报告等功能。


# Security Analyzer

## 简介

Security Analyzer是一款自动静态分析工具，旨在检测智能合约中的漏洞。我们采用了上下文敏感、流敏感和价值敏感的静态分析技术。首先，我们收集并分析了几乎所有已知的漏洞智能合约。然后，我们设计了威胁分析模型，以准确地抽象这些漏洞的模式。接下来，我们开发了100多条规则来自动检测这些漏洞。总共，我们识别了12类漏洞，如下所示：

* 编译器：源于Solidity编译器的漏洞，如0.5.9版本中ABIEncoderV2的数组使用。
* 跨链：与跨链桥接相关的问题，如私钥泄露。
* 区块链：与区块链API使用相关的问题，如block.number、GasLeft、block.difficulty等。
* 语言：智能合约语言中的常见漏洞，如重入、整数溢出。
* ERC：由ERC标准引发的问题，如函数缺少事件、事件发射缺少索引。
* 加密：与加密算法及其使用相关的漏洞，如签名可变性、ecrecover使用。
* 受控资源：涉及受控资源的漏洞，如访问控制。
* 协议：协议（如DeFi）设计和实现中的漏洞，包括经济模型安全。
* DeFi流动性模型：由于在经济模型中使用易于操纵的价格依赖性而导致的异常结算和奖励收集。
* DeFi经济模型：复杂的DeFi行为组合形成的危险DeFi经济模型。
* NFT：NFT铸造过程中额外铸造代币，导致项目方损失，如虚假存款。
* DAO：危险的DAO投票设计，导致主要权限被攻击者操纵，如基于闪电贷的DAO投票攻击。

我们致力于为客户提供专业的智能合约安全扫描服务。


# Security Prover

## 简介

Prover是一个动态扫描引擎，能够运行代码并探索其所有执行过程的状态空间。在探索过程中，Prover根据执行特征（如property变化和执行路径）来检测是否存在漏洞。同时，通过一些充分的约束条件，Prover能够证明代码中不包含某些关键漏洞，如 reentrancy。因此，Prover引擎既具有漏洞检测功能，又能验证代码中是否存在某些关键漏洞。

\
为实现Prover产品，我们构建了基于语义层的符号执行引擎，支持自动生成代码状态空间，并允许用户用Solidity编写Prover脚本以挖掘状态空间。

Prover的漏洞检测功能包括：编译合约文件生成AST树；动态执行语句，记录执行过程；最后依据状态空间、执行路径和内置规则判断是否存在漏洞。

Prover的安全性证明在获取状态空间后，定义各类漏洞的安全证明条件，如重入漏洞，从而证明代码中不会发生相应漏洞。

Prover的property证明通过用户自定义MAIN函数，验证合约执行过程中合约的property不会违反规则。

相比静态引擎，Prover具有更高的可靠性和更低的误报率，因为其分析的代码状态空间是真实可执行的。


# Open Source Analyzer

## &#x20;简介

**Open Source Analyzer**用于识别、监控和管理软件中的各个组件及其依赖关系。为开发者和安全专家提供了深入了解软件构成的途径，从而更有效地控制风险并确保系统安全。主要特点包括：

1. 开源组件识别：SCA能够自动检测软件中使用的开源组件和版本信息，有助于跟踪和管理开源依赖项。
2. 许可证合规性：SCA可审查软件组件的许可证，确保企业遵循相关法规和合规要求。
3. 安全漏洞检测：SCA能识别已知安全缺陷和风险，协助开发者及时修补漏洞并降低系统安全风险。
4. 依赖关系解析：SCA可分析组件间的依赖结构，帮助开发者了解组件交互关系及可能的潜在风险点。


# Code Style

## &#x20;简介

Code Style引擎是一种代码质量分析工具，对合约代码进行静态分析，以识别编码问题、潜在错误和不符合规范的代码。主要特点包括：

1. 代码风格检查：确保代码遵循预设编码规范，提高一致性和可读性。
2. 潜在错误检测：静态分析揭示可能导致崩溃、性能降低或逻辑错误的问题，提供修复建议。
3. 代码优化建议：分析性能瓶颈和不必要的复杂度，提供结构和性能优化方案。
4. 可维护性分析：评估代码可维护性，识别需重构部分，提高可维护性和可扩展性。

使用Code Style引擎有助于确保合约代码的稳定性、可维护性，提高项目质量和可靠性。


# IP Analyzer

## &#x20;简介：

克隆引擎专为项目IP分析和智能合约安全问题检测提供高效且有效的解决方案 主要特色包含：

1. **高级别的代码克隆检测：**&#x5BF9;项目、文件、函数及行级别进行详细的克隆检测，确保全面覆盖，通过分析已知安全问题的模式，及时发现克隆代码中的潜在漏洞，帮助用户采取预防措施。
2. &#x20;**开源组件洞察：**&#x63D0;供关于导入和克隆代码的详细信息，如流行度、使用情况和成熟度，帮助开发者更好地了解项目中开源组件的使用情况。


# MetaScore

## 简介

MetaScore 是一个创新的平台，致力于通过深度分析Web3项目中智能合约代码，为用户提供全面且有价值的安全视角。作为一个价值中立的平台，MetaScore自动识别项目安全风险，服务于投资者、项目方、开发者以及Web3新媒体等多元用户群体。我们提供的服务内容涵盖项目安全排名、实时项目安全风险推送、Web3大数据趋势看板和Web3项目技术趋势等多方面。

首先，为实现项目安全排名，我们构建了一个基于多维度的Web3项目安全评分和评级模型。通过专有引擎扫描智能合约代码，我们识别潜在风险并进行综合评分。这有助于投资者全面评估Web3项目的安全性，做出明智的决策。同时，项目方也能了解其项目在行业中的安全地位，并采取相应措施提升安全性。

其次，依托MetaScout的全天候多链交易监控和Migration Attack Analyzer的迁移攻击识别，MetaScore为用户实时推送关注项目的风险信息。这使得投资者和项目方能够及时响应风险，保护资产并避免财务损失。

再者，我们从多个角度展示Web3大数据趋势看板，为各利益相关者揭示整体安全风险状况，同时为Web3新媒体提供持续的新闻素材。

最后，通过IP Analyzer的代码克隆分析，我们为每个Web3项目提供MetaStack分析，展示项目中所用技术框架及模板。我们还从宏观角度呈现行业技术框架的演变，帮助项目构建者追踪先进安全技术，降低安全风险。

综上所述，MetaScore通过全面的安全分析和风险评估，助力Web3社区信心满满地构建和投资去中心化项目，推动Web3向前发展。

需要注意的是，为防止安全风险信息被恶意利用，MetaScore平台针对不同用户类型，展示差异化的安全风险信息。对普通投资者，我们仅展示各维度识别到的风险数量统计信息。在自动识别并人工确认某个项目存在严重风险后，我们会及时通知项目方，并在核实身份后提供具体风险位置。同时，我们提供相应的修复建议，帮助项目方在短时间内解决问题。通过这种方式，MetaScore确保了安全信息不被恶意利用，同时为项目方提供了及时的安全风险提示和解决方案，以保护整个Web3生态系统的安全与稳定。

通过不断优化我们的服务和技术，MetaScore致力于成为行业内最值得信赖的Web3项目安全分析平台。我们的目标是为投资者、项目方、开发者和Web3新媒体等多元用户群体提供全方位的安全服务，推动整个Web3行业的健康发展。我们相信，通过我们的努力和专业能力，MetaScore将赢得广大用户的信赖与支持，为构建更安全的Web3世界贡献力量。


# MetaScout

## &#x20;简介

MetaScout是一个动态的实时智能合约安全监控平台，主要包括如下进行监控。

* On chain Monitoring：用于治理攻击的交易分析、市场价格波动监测、社会情绪监测等
* Continuous Security Monitoring：通过持续监测和评估安全态势，开发者可以确保他们的智能合约保持最佳安全状态，从而降低攻击和损失的风险
* Online Abnormal Behavior Monitoring：基于监控的行为攻击进行分析安全事件.

<figure><img src="/files/QoFZXeDTDJDoA73jjN6G" alt=""><figcaption></figcaption></figure>


# MPM

## 简介

MPM是一种元包管理器，旨在为Web3项目的发布、维护、分发和集成提供安全、轻量级解决方案，涵盖Web3合约和Web2基础设施。我们致力于为社区构建更安全的Web3生态系统，提供卓越的集成方案。MPM包含6个主要子模块：MPM注册表、MPM咨询、MPM客户端、MPM后端、MPM审计和MPM配置。

* MPM注册表：私有注册表，维护已验证工件及元数据，提供全面的第三方库和智能合约安全配置文件，实现用户项目安全威胁的全面处理和缓解。
* MPM咨询：咨询数据库，维护Web2和Web3组件的安全信息，包括公开漏洞和其他扫描器收集的漏洞，为缓解用户项目安全威胁发挥关键作用。
* MPM客户端：包管理器客户端，可安全、轻松地管理依赖项，并与MPM审计和后端引擎互动，为用户项目提供全面概况（MetaScore）。
* MPM后端：处理MPM客户端请求的后端服务，综合考虑潜在安全风险和非功能性属性，提供最佳、全面的依赖管理策略。
* MPM审计：支持MetaScore的引擎前端，为用户项目提供全面分析，确保发布或上链前的安全性。
* MPM配置：新颖、轻量级的Web3项目配置管理，提供灵活可配置的依赖管理集成解决方案的阈值和优先级控制。

作为一家智能合约安全扫描公司，我们的目标是提供专业、精简且高效的解决方案。


# MetaScan 快速上手


# 注册账号

访问地址：<https://app.metatrust.io。&#x20>;

**有两种方式登录MetaScan：**&#x20;

1.使用您的电子邮件创建一个帐户然后登录&#x20;

2.使用现有的第三方帐户通过OAuth登录

<figure><img src="/files/fzSl2U2f46mDUXosZ5ay" alt=""><figcaption></figcaption></figure>

**创建邮箱帐户**

1. 点击登录页面上的“立即注册”链接，在注册页面上填写您的电子邮件和密码，接受我们的条款和隐私政策，然后点击“立即注册”按钮。
2. 您将在一到两分钟内收到一封带有确认链接的电子邮件。3.点击该链接将打开MetaScan页面并自动登录到平台。

**使用第三方身份（OAuth）登录**&#x20;

如果您想使用第三方服务（如GitHub）的身份而不经过注册流程登录，请按照以下步骤操作： （我们在这里使用GitHub作为示例）

1. 点击登录页面上的GitHub图标。&#x20;
2. 浏览器将重定向到GitHub。 如果这是您第一次使用此登录方法，您需要允许MetaScan使用您的GitHub身份，阅读GitHub页面上的信息，然后点击“授权MetaTrustLabs”。 您的浏览器将重定向回MetaScan，您将自动登录。


# 添加集成

所有集成工具会展示Integration页面，集成工具含仓库类、IDE类、通知类等。此页面支持对单个集成工具进行管理，管理包含取消关联、切换公共仓库和私有仓库等。**以GitHub为例：**

1. 点击设置图标
2. 弹窗内可点击“**Disconnect”可取消账号关联**
3. **Scope项中可以切换公共仓库和私有仓库**

<div><figure><img src="/files/zayUXI34azvCNBoLuLkE" alt=""><figcaption></figcaption></figure> <figure><img src="/files/WaXeO4LkTsycI5rmklzq" alt=""><figcaption></figcaption></figure></div>


# 添加项目

**扫描项目前需要先添加项目，项目要求：**

必须包含完整的文件：合约(如：contracts), 框架配置(如：hardhat.config.js)、依赖声明(如：package.json)等，并且删除node\_modules、build 目录等中间文件，才能保证编译成功扫描成功。 如下图：

<figure><img src="/files/Dh3mTQiUhZEaekzDCRmr" alt=""><figcaption></figcaption></figure>

框架目前支持：Solidity、Hardhat、Truffle、Foundry、Brownie、Embark、Etherlime、Waffle。

**添加项目方式有三种：**

<figure><img src="/files/spc3S4FquqoODlf1Vx24" alt=""><figcaption></figcaption></figure>

\
**第一种：从GitHub仓储库添加**&#x20;

需要授权仓储库账号，并且选择私有库还是公共库，关联成功后，可以勾选需要导入的项目。如果想取消关联的账号，或者切换公有/私有库需要在“Integration ”中修改。

<figure><img src="/files/HjwE2ByT4S4nWxA1bzs4" alt=""><figcaption></figcaption></figure>

\
**第二种：添加公共仓库Public Repository的地址**&#x20;

把地址粘贴到Repository URL里，目前主要支持github的公共仓库，格式：[https://github.com/xxxxxx/](https://github.com/emptysetsquad/dollar)xxxx

<figure><img src="/files/5dv2d2AHrAmT6x2C7U89" alt=""><figcaption></figcaption></figure>

**第三种：上传本地项目（Upload Files）**

把需要扫描的完整项目，打包成zip文件

<figure><img src="/files/YXkSxKhB352wUW4ZaxVP" alt=""><figcaption></figcaption></figure>

其他说明：

1. 如果不需要配置扫描参数，可以勾选“Start scan after project creation”，项目添加成功后会自动开始扫描。

<figure><img src="/files/YwZQqhm8uIVeEo9Qpkoj" alt=""><figcaption></figcaption></figure>

2. 当前如果没有合适的项目，可以先点击示例项目（Add Sample Projects），进行演示。

<figure><img src="/files/TPn2rKulhqFG2nMkg9bV" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lJlIhkk14XIIbX0v0yqE" alt=""><figcaption></figcaption></figure>

<br>


# 扫描漏洞

导入项目后

**第一步：点击“Start Scan”**&#x5F00;始扫描。

<figure><img src="/files/Y0lvbjIgCtXfFTD1H6BR" alt=""><figcaption></figcaption></figure>

\
**第二步：配置扫描参数|**

在“Scan Settings”下，可以对扫描参数进行灵活配置，同时可以选择特定的引擎，默认建议全部引擎勾选，这样扫描更全面。

<figure><img src="/files/mTV2j8Zd68YgBUJDOJ4i" alt=""><figcaption></figcaption></figure>

**参考配置中包含以下两项：**

**配置常用参数（Scan Settings)：** 对版本号（Code Branch）、分支（Code Commit）、扫描路径（Workspace Path）进行自定义配置。 路径格式：dir1 or dir1/dir2 （相对路径）

<figure><img src="/files/vibgsNO4gzjFkNx0p7CA" alt=""><figcaption></figcaption></figure>

**配置高级参数（Advanced Scan Settings）：** 可以对过滤文件（**Ignored files）**、环境文件（.env）等进行配置。**第三步：扫描中**项目一般在几分钟内就能完成，扫描中的项目，点击进度条，可查看当前扫描到达的节点。

<figure><img src="/files/Pij1MPf2wx7S0jHzlhJE" alt=""><figcaption></figcaption></figure>

**第三步：扫描中**

项目一般在几分钟内就能完成，扫描中的项目，点击进度条，可查看当前扫描到达的节点。

<figure><img src="/files/ePYbCwb6P6rrNqY901lD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/g26ZUrwRW4FsEVM6s38P" alt=""><figcaption></figcaption></figure>


# 查看扫描结果

完成扫描后，用户可以从项目详情页中查看扫描结果(Issues)及数量、扫描日志（ScanLog)、项目设置、对比、扫描历史等

<figure><img src="/files/kF5asSkLCSx7Zh8a4tBU" alt=""><figcaption></figcaption></figure>

**扫描结果状态有：失败、有漏洞、无漏洞**

**失败结果：**&#x20;

项目扫描失败时，会在项目列表页，或者详情页的scanlog页会展示失败原因及解决方案，详细说明请阅读 详细失败原因说明

<figure><img src="/files/fgKJnIYDwKIuDTfQZzLk" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/AZPOOSOICGXT8Q1eYusb" alt=""><figcaption></figcaption></figure>

**有漏洞结果：**

漏洞分为5个等级：Critical、High risk、Medium risk、Low risk、Informational

在**项目详情页>Issues页下，会显示所有漏洞卡片，其中卡片内**标红部分为问题代码，需要重点关注，同时也会提供问题描述（Description）、修复建议（Recommendation）。

<figure><img src="/files/jIWawva0gltA4DYWucZH" alt=""><figcaption><p>列表页：有漏洞状态</p></figcaption></figure>

<figure><img src="/files/jIATEBLQH4u2siYAGkfi" alt=""><figcaption><p>详情页：有漏洞状态</p></figcaption></figure>

**无漏洞结果：**&#x8BF4;明当前版本漏洞数为0，无漏洞。

<figure><img src="/files/lGiuB86t18YFhTyfU7qZ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/W4tdMHujRA7EHeLq2370" alt=""><figcaption></figcaption></figure>


# 生成并下载扫描报告

项目扫描完成后，系统会自动为该项目生成安全报告，用户可以按需下载报告查看详情。&#x20;

在项目详情页面右上角点击“Scan Reports”下拉菜单，可单引擎下载，也可综合引擎下载，点击下载按钮，就会生成PDF报告

<figure><img src="/files/D8M8CFuQpLDqceh1Maln" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/KPNjFiFtI06ttRZIgivD" alt=""><figcaption></figcaption></figure>


# 词汇表


