Solutions

Company

Resources

Blog

Contact

Login

    • Assurance

      Smart Contract Assessment

      Securing code integrity, protecting digital assets

      Blockchain Layer 1 Assessment

      Assessing protocols, securing blockchain foundations

      Code Security Audit

      Uncovering flaws, strengthening software integrity

      Web Application Penetration Testing

      Exposing weaknesses, fortifying digital defenses

      Cloud Infrastructure Penetration Testing

      Securing configurations, protecting critical environments

      Red Team Exercise

      Simulating real-world attacks, strengthening defenses

      AI Red Teaming

      Testing AI systems against real threats

      AI Security Assessment

      Securing AI models, data, and pipelines

    • Advisory

      AI Advisory

      Guiding secure, strategic AI adoption forward

      Risk Assessment

      From unknown threats to actionable insights

      Blockchain Architecture Assessment

      Optimizing architecture for tomorrow’s networks

      Compliance Readiness

      Stay ready as regulations evolve

      Custody and Key Management Assessment

      Securing the heart of digital custody

      Technical Due Diligence

      See the risks before you invest

      Technical Training

      Empower your teams to secure what matters

    • Who We Are

      The best security engineers in the world

      Careers

      Work with the elite

      Who Trusts Us

      The trusted security advisor for blockchain and financial services industries

      Brand

      Access official logos, fonts, and guidelines

      Service Commitments

      Committed to Protecting Your Data

    • Audits

      In-depth evaluations of smart contracts and blockchain infrastructures

      BVSS

      Blockchain Vulnerability Scoring System

      Disclosures

      All the latest vulnerabilities discovered by Halborn

      Case Studies

      How Halborn’s solutions have empowered clients to overcome security issues

      Reports

      Comprehensive reports and data

  • Blog

  • Contact

  • Login

THIS WEBSITE USES COOKIES

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you've provided to them or that they've collected from your use of their services. You consent to our cookies if you continue to use our website. Learn More.

STAY CURRENT WITH HALBORN

Subscribe to the monthly Halborn Digest for our top blogs and videos, major company announcements, new whitepapers, webinar and event invites, and one exclusive interview.

ADVISORY SERVICES

AI AdvisoryRisk AssessmentBlockchain Architecture AssessmentCompliance ReadinessCustody and Key Management AssessmentTechnical Due DiligenceTechnical Training

ASSURANCE SERVICES

AI Security AssessmentAI Red TeamingSmart Contract AssessmentBlockchain Layer 1 AssessmentCode Security AuditWeb Application Penetration TestingCloud Infrastructure Penetration TestingRed Team Exercise

COMPANY

Who We AreWho Trusts UsService CommitmentsCareersBrandBlogContact

RESOURCES

AuditsDisclosuresReportsBVSSCase Studies
Halborn Logo
Privacy PolicyTerms of UseVulnerability Disclosure Policy

© Halborn 2026. All rights reserved.

Background

// Security Assessment

04.05.2022 - 06.17.2022

Smart Contract Assessment

Moonwell

Halborn logotext
← Back to Audits

Smart Contract Assessment - Moonwell


Prepared by:

Halborn Logo

HALBORN

Last Updated 03/11/2026

Date of Engagement: April 5th, 2022 - June 17th, 2022

Summary

100% of all REPORTED Findings have been addressed

All findings

18

Critical

0

High

0

Medium

3

Low

3

Informational

12


Table of Contents

  • 1. Introduction
  • 2. Audit summary
  • 3. Test approach & methodology
  • 4. Scope
  • 5. Risk methodology
  • 6. Scope
  • 7. Assessment summary & findings overview
  • 8. Findings & Tech Details
    1. 8.1 Expired tokens are not considered in the voting power
    2. 8.2 Old tokens are not recoverable when the new token is set
    3. 8.3 Owner can reset allocations - delegations
    4. 8.4 Missing events for admin only functions that change critical parameters
    5. 8.5 Unneeded initialization of uint256 variables to 0
    6. 8.6 Missing zero address checks
    7. 8.7 Using ++i consumes less gas than i+=1 in loops
    8. 8.8 Caching the length in the for loops
    9. 8.9 Revert string size optimization
    10. 8.10 Missing checks for non-zero transfer value calls
    11. 8.11 Block with gas limit
    12. 8.12 Experimental keyword usage
    13. 8.13 Upgrade at least pragma 0.8.10
    14. 8.14 Open todos
    15. 8.15 Changing function visibility from public to external can save gas
    16. 8.16 Direct usage of ecrecover allows signature malleability
    17. 8.17 Missing events
    18. 8.18 Optimize unsigned integer comparison
  • 9. Automated Testing

1. INTRODUCTION

Moonwell Finance engaged Halborn to conduct a security audit on their smart contracts beginning on 2022-04-05 and ending on 2022-06-17. The security assessment was scoped to the smart contracts provided to the Halborn team.

2. AUDIT SUMMARY

The team at Halborn was provided a week for the engagement and assigned a full-time security engineer to audit the security of the smart contract. The security engineer is a blockchain and smart-contract security expert with advanced penetration testing, smart-contract hacking, and deep knowledge of multiple blockchain protocols.

The purpose of this audit is to:

    • Ensure that smart contract functions operate as intended.

    • Identify potential security issues with the smart contracts.

In summary, Halborn identified some security risks that were addressed by the Moonwell Finance team.

3. TEST APPROACH & METHODOLOGY

Halborn performed a combination of manual and automated security testing to balance efficiency, timeliness, practicality, and accuracy regarding the scope of the smart contract audit. While manual testing is recommended to uncover flaws in logic, process, and implementation; automated testing techniques help enhance coverage of smart contracts and can quickly identify items that do not follow security best practices. The following phases and associated tools were used throughout the term of the audit:

    • Research into architecture and purpose.

    • Smart Contract manual code review and walkthrough.

    • Graphing out functionality and contract logic/connectivity/functions(solgraph)

    • Manual Assessment of use and safety for the critical Solidity variables and functions in scope to identify any arithmetic related vulnerability classes.

    • Dynamic Analysis (ganache-cli, brownie, hardhat).

4. SCOPE

\begin{enumerate} \item Moonwell Finance Token Sale Contracts \begin{enumerate} \item Repository: \href{https://github.com/moonwell-fi/moonwell-contracts-private/tree/726dcbaef18670d344fa5621c23c4db0e403583a/contracts/tokensale}{Token Sale} \item Commit ID: \href{https://github.com/moonwell-fi/moonwell-contracts-private/tree/726dcbaef18670d344fa5621c23c4db0e403583a/contracts/tokensale}{726dcbaef18670d344fa5621c23c4db0e403583a} \item New PR : \href{ https://github.com/moonwell-fi/moonwell-contracts-private/pull/43 }{PR} \item New Commit : \href{ https://github.com/moonwell-fi/moonwell-contracts-private/tree/9c51e4860c3f768190036ddcc7dbc4ef3d497c1f/contracts/tokensale }{New Commit} \end{enumerate} \item Out-of-Scope \begin{enumerate} \item test/*.sol \end{enumerate} \end{enumerate}

Out-of-scope: External contract, libraries and financial related attacks.

FIX Commit ID : 762cdc4cd9a8d09f29765f9e143b25af0ebe9720

TAG : artemis-v1

5. RISK METHODOLOGY

Halborn assesses the severity of findings using either the Common Vulnerability Scoring System (CVSS) framework or the Impact/Likelihood Risk scale, depending on the engagement. CVSS is an industry standard framework for communicating characteristics and severity of vulnerabilities in software. Details can be found in the CVSS Specification Document published by F.I.R.S.T.
Vulnerabilities or issues observed by Halborn scored on the Impact/Likelihood Risk scale are measured by the LIKELIHOOD of a security incident and the IMPACT should an incident occur. This framework works for communicating the characteristics and impacts of technology vulnerabilities. The quantitative model ensures repeatable and accurate measurement while enabling users to see the underlying vulnerability characteristics that were used to generate the Risk scores. For every vulnerability, a risk level will be calculated on a scale of 5 to 1 with 5 being the highest likelihood or impact.
RISK SCALE - LIKELIHOOD
  • 5 - Almost certain an incident will occur.
  • 4 - High probability of an incident occurring.
  • 3 - Potential of a security incident in the long term.
  • 2 - Low probability of an incident occurring.
  • 1 - Very unlikely issue will cause an incident.
RISK SCALE - IMPACT
  • 5 - May cause devastating and unrecoverable impact or loss.
  • 4 - May cause a significant level of impact or loss.
  • 3 - May cause a partial impact or loss to many.
  • 2 - May cause temporary impact or loss.
  • 1 - May cause minimal or un-noticeable impact.
The risk level is then calculated using a sum of these two values, creating a value of 10 to 1 with 10 being the highest level of security risk.
Critical
High
Medium
Low
Informational
  • 10 - CRITICAL
  • 9 - 8 - HIGH
  • 7 - 6 - MEDIUM
  • 5 - 4 - LOW
  • 3 - 1 - VERY LOW AND INFORMATIONAL

6. SCOPE

Out-of-Scope: New features/implementations after the remediation commit IDs.

7. Assessment Summary & Findings Overview

Critical

0

High

0

Medium

3

Low

3

Informational

12

Impact x Likelihood

Likelihood

Impact

HAL-01

HAL-01

HAL-04

HAL-04

HAL-05

HAL-05

HAL-02

HAL-02

HAL-03

HAL-03

HAL-06

HAL-06

HAL-07

HAL-07

HAL-08

HAL-08

HAL-09

HAL-09

HAL-10

HAL-10

HAL-11

HAL-11

HAL-12

HAL-12

HAL-13

HAL-13

HAL-14

HAL-14

HAL-15

HAL-15

HAL-16

HAL-16

HAL-17

HAL-17

HAL-18

HAL-18

Security analysisRisk levelRemediation Date
EXPIRED TOKENS ARE NOT CONSIDERED IN THE VOTING POWERMediumSolved - 06/16/2022
OLD TOKENS ARE NOT RECOVERABLE WHEN THE NEW TOKEN IS SETMediumSolved - 04/13/2022
OWNER CAN RESET ALLOCATIONS - DELEGATIONSMediumRisk Accepted
MISSING EVENTS FOR ADMIN ONLY FUNCTIONS THAT CHANGE CRITICAL PARAMETERSLowNot Applicable
UNNEEDED INITIALIZATION OF UINT256 VARIABLES TO 0LowSolved - 04/13/2022
MISSING ZERO ADDRESS CHECKSLowNot Applicable
USING ++I CONSUMES LESS GAS THAN I+=1 IN LOOPSInformationalSolved - 04/13/2022
CACHING THE LENGTH IN THE FOR LOOPSInformationalSolved - 04/13/2022
REVERT STRING SIZE OPTIMIZATIONInformationalAcknowledged
MISSING CHECKS FOR NON-ZERO TRANSFER VALUE CALLSInformationalSolved - 04/13/2022
BLOCK WITH GAS LIMITInformationalAcknowledged
EXPERIMENTAL KEYWORD USAGEInformationalSolved - 04/13/2022
UPGRADE AT LEAST PRAGMA 0.8.10InformationalSolved - 04/13/2022
OPEN TODOSInformationalSolved - 06/16/2022
CHANGING FUNCTION VISIBILITY FROM PUBLIC TO EXTERNAL CAN SAVE GASInformationalSolved - 06/16/2022
DIRECT USAGE OF ECRECOVER ALLOWS SIGNATURE MALLEABILITYInformationalSolved - 06/16/2022
MISSING EVENTSInformationalSolved - 06/16/2022
OPTIMIZE UNSIGNED INTEGER COMPARISONInformationalNot Applicable

8. Findings & Tech Details

8.1 EXPIRED TOKENS ARE NOT CONSIDERED IN THE VOTING POWER

//

Medium

Description
Score
Impact: 4
Likelihood: 2
Recommendation
Remediation Comment

8.2 OLD TOKENS ARE NOT RECOVERABLE WHEN THE NEW TOKEN IS SET

//

Medium

Description
Score
Impact: 3
Likelihood: 3
Recommendation
Remediation Comment

8.3 OWNER CAN RESET ALLOCATIONS - DELEGATIONS

//

Medium

Description
Score
Impact: 3
Likelihood: 3
Recommendation
Remediation Comment

8.4 MISSING EVENTS FOR ADMIN ONLY FUNCTIONS THAT CHANGE CRITICAL PARAMETERS

//

Low

Description
Score
Impact: 3
Likelihood: 1

8.5 UNNEEDED INITIALIZATION OF UINT256 VARIABLES TO 0

//

Low

Description
Score
Impact: 3
Likelihood: 1
Recommendation
Remediation Comment

8.6 MISSING ZERO ADDRESS CHECKS

//

Low

Description
Score
Impact: 2
Likelihood: 2

8.7 USING ++I CONSUMES LESS GAS THAN I+=1 IN LOOPS

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.8 CACHING THE LENGTH IN THE FOR LOOPS

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.9 REVERT STRING SIZE OPTIMIZATION

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.10 MISSING CHECKS FOR NON-ZERO TRANSFER VALUE CALLS

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.11 BLOCK WITH GAS LIMIT

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.12 EXPERIMENTAL KEYWORD USAGE

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.13 UPGRADE AT LEAST PRAGMA 0.8.10

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.14 OPEN TODOS

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.15 CHANGING FUNCTION VISIBILITY FROM PUBLIC TO EXTERNAL CAN SAVE GAS

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.16 DIRECT USAGE OF ECRECOVER ALLOWS SIGNATURE MALLEABILITY

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.17 MISSING EVENTS

//

Informational

Description
Score
Impact: 1
Likelihood: 1
Recommendation
Remediation Comment

8.18 OPTIMIZE UNSIGNED INTEGER COMPARISON

//

Informational

Description
Score
Impact: 1
Likelihood: 1

9. Automated Testing

Halborn strongly recommends conducting a follow-up assessment of the project either within six months or immediately following any material changes to the codebase, whichever comes first. This approach is crucial for maintaining the project’s integrity and addressing potential vulnerabilities introduced by code modifications.

Table of Contents

  • 1. Introduction
  • 2. Audit summary
  • 3. Test approach & methodology
  • 4. Scope
  • 5. Risk methodology
  • 6. Scope
  • 7. Assessment summary & findings overview
  • 8. Findings & Tech Details
    1. 8.1 Expired tokens are not considered in the voting power
    2. 8.2 Old tokens are not recoverable when the new token is set
    3. 8.3 Owner can reset allocations - delegations
    4. 8.4 Missing events for admin only functions that change critical parameters
    5. 8.5 Unneeded initialization of uint256 variables to 0
    6. 8.6 Missing zero address checks
    7. 8.7 Using ++i consumes less gas than i+=1 in loops
    8. 8.8 Caching the length in the for loops
    9. 8.9 Revert string size optimization
    10. 8.10 Missing checks for non-zero transfer value calls
    11. 8.11 Block with gas limit
    12. 8.12 Experimental keyword usage
    13. 8.13 Upgrade at least pragma 0.8.10
    14. 8.14 Open todos
    15. 8.15 Changing function visibility from public to external can save gas
    16. 8.16 Direct usage of ecrecover allows signature malleability
    17. 8.17 Missing events
    18. 8.18 Optimize unsigned integer comparison
  • 9. Automated Testing

// Download the full report

Smart Contract Assessment

* Use Google Chrome for best results

** Check "Background Graphics" in the print settings if needed