Q2 2026 Security & Compliance Report67 incidents, $764M in losses, 88% from operational failures.
Get the report →

Audit name:

[SCA] Alacrity LSD | Staking | Jun2023

Date:

Aug 15, 2023

Table of Content

→Introduction
→Audit Summary
→Document Information
→System Overview
→Executive Summary
→Risks
→Findings
→Appendix 1. Severity Definitions
→Appendix 2. Scope
→Disclaimer

Want a comprehensive audit report like this?

Introduction

We express our gratitude to the Alacrity LSD team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

The Alacrity LSD Protocol audit scope consists of a staking and rewarding protocol that accepts ERC20 and native token staking for stakers, and distributes rewards according to their staked values.

titlecontent
PlatformEVM
LanguageSolidity
TagsStaking; ERC20 Token
Timeline16/06/2023 - 18/08/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttps://github.com/AlacrityProtocolLSD/smartcontracts→
    Commit204f265d3447faa59cc9586614146e035ccf9ca3

    Audit Summary

    Total2/10
    Security Score

    9/10

    Test Coverage

    0%

    Code Quality Score

    7/10

    Documentation Quality Score

    7/10

    22Total Findings
    15Resolved
    0Accepted
    1Mitigated

    The system users should acknowledge all the risks summed up in the risks section of the report

    Document Information

    This report may contain confidential information about IT systems and the intellectual property of the Customer, as well as information about potential vulnerabilities and methods of their exploitation.

    The report can be disclosed publicly after prior consent by another Party. Any subsequent publication of this report shall be without mandatory consent.

    Document

    NameSmart Contract Code Review and Security Analysis Report for Alacrity LSD
    Audited ByHacken
    Websitehttps://linktr.ee/alacritylsd→
    Changelog23/06/2023 - Initial Review
    21/07/2023 - Second Review
    18/08/2023 - Third Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Alacrity LSD
      Audited By
      Hacken
      Changelog
      23/06/2023 - Initial Review
      21/07/2023 - Second Review
      18/08/2023 - Third Review

    System Overview

    The Alacrity LSD Protocol audit scope consists of a staking and rewarding protocol that accepts ERC20 and native token staking for stakers, and distributes rewards according to their staked values. Both the staking token and reward token can be configured, and different taking pools can be managed by admin addresses.

    The core contracts of the system are the following;

    StakingPool.sol - The staking contract for a single ERC20 token staking and reward token.

    StakingPoolFactory.sol - The contract that handles creation and management of several staking pools, including native token staking.

    EthStakingPool.sol - The staking pool contract for the native token.

    CurrencyTransferLib.sol - The helper library for transferring native tokens.

    RewardsDistributionRecipient.sol - Helper extendable contract to allow calls restricted to rewards distributor.

    IVEALSD.sol - Interface for the vote escrow token of Alacrity.

    IALSD.sol - Interface for the platforms native token.

    IWETH.sol - Interface for native token wrapper.

    IStakingPool.sol - Interface for the Staking Pool.

    Privileged roles

    • Owner: Can interact with the StakingPoolFactory.sol and use its privileged functions, such as deploying new pools, withdrawing excess rewards, and adding rewards to pools.

    • rewardsDistribution: This is the StakingPoolFactory.sol contract. It can trigger privileged functions in the staking pool contracts, such as changing reward rate by notifying reward amount and withdrawing excess rewards.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 7 out of 10.

    • Functional requirements are provided.

    • Technical description is provided.

    • Development environment description is not provided.

    • NatSpec is not sufficient.

    Code quality

    The total Code quality score is 7 out of 10.

    • Solidity style guides are not followed.

    • Missing zero address checks.

    • The Development Environment was not configured.

    Test coverage

    Code coverage of the project is 0% (branch coverage).

    • Tests were not provided.

    Security score

    Upon auditing, the code was found to contain 2 critical, 2 high, 3 medium, and 4 low severity issues. Out of these, 8 issues have been addressed and resolved, leading to a Security score of 9 out of 10.

    All identified issues are detailed in the “Findings” section of this report.

    Summary

    The comprehensive audit of the customer's smart contract yields an overall score of 2. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    There are out of scope external calls made in the StakingPoolFactory.sol contracts' addRewards function. The security of the functionality cannot be verified.

    Users cannot get their rewards from the system unless the owner adds rewards via StakingPoolFactory contract. The timing and quantity of reward additions are determined by a centralized mechanism.

    The ALSD and veALSD contracts are not part of the audit scope, and their security cannot be verified.

    Findings

    F-2023-0583Data Inconsistency
    Status
    fixed
    Severity

    Critical
    F-2023-0582Invalid Calculations
    Status
    fixed
    Severity

    Critical
    F-2023-0585Funds Lock
    Status
    fixed
    Severity

    High
    F-2023-0584Contradiction In Function Name
    Status
    fixed
    Severity

    High
    F-2023-0588Denial of Service
    Status
    fixed
    Severity

    Medium
    F-2023-0587Unverifiable Logic
    Status
    mitigated
    Severity

    Medium
    F-2023-0586Missing Validation
    Status
    fixed
    Severity

    Medium
    F-2023-0592Missing Event Emitting
    Status
    fixed
    Severity

    Low
    F-2023-0591Floating Pragma
    Status
    fixed
    Severity

    Low
    F-2023-0590Empty Function
    Status
    unfixed
    Severity

    Low
    Code
    ―
    Title
    Status
    Severity
    F-2023-0583Data Inconsistency
    fixed

    Critical
    F-2023-0582Invalid Calculations
    fixed

    Critical
    F-2023-0585Funds Lock
    fixed

    High
    F-2023-0584Contradiction In Function Name
    fixed

    High
    F-2023-0588Denial of Service
    fixed

    Medium
    F-2023-0587Unverifiable Logic
    mitigated

    Medium
    F-2023-0586Missing Validation
    fixed

    Medium
    F-2023-0592Missing Event Emitting
    fixed

    Low
    F-2023-0591Floating Pragma
    fixed

    Low
    F-2023-0590Empty Function
    unfixed

    Low
    1-10 of 22 findings

    Identify vulnerabilities in your smart contracts.

    Appendix 1. Severity Definitions

    When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.

    Reference on how risk scoring is done is available through the repository in our Github organization:

    Severity

    Description

    Critical
    Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

    High
    High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

    Medium
    Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

    Low
    Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.
    • Severity

      Critical

      Description

      Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.

      Severity

      High

      Description

      High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.

      Severity

      Medium

      Description

      Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.

      Severity

      Low

      Description

      Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.

    Appendix 2. Scope

    The scope of the project includes the following smart contracts from the provided repository:

    Scope Details

    Repositoryhttps://github.com/AlacrityProtocolLSD/smartcontracts→
    Commit204f265d3447faa59cc9586614146e035ccf9ca3
    WhitepaperProvided→
    RequirementsProvided→
    Technical RequirementsProvided

    Contracts in Scope

    EthStakingPool.sol - EthStakingPool.sol
    RewardsDistributionRecipient.sol - RewardsDistributionRecipient.sol
    StakingPool.sol - StakingPool.sol
    StakingPoolFactory.sol - StakingPoolFactory.sol
    interfaces
    IALSD.sol - interfaces › IALSD.sol
    IStakingPool.sol - interfaces › IStakingPool.sol
    IVEALSD.sol - interfaces › IVEALSD.sol
    IWETH.sol - interfaces › IWETH.sol
    lib
    CurrencyTransferLib.sol - lib › CurrencyTransferLib.sol

    Disclaimer