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

Audit name:

[SCA] Angel Block | Staking | Apr2023

Date:

May 14, 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 Angel Block team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

AngelBlock is a non-custodial, protocol based fundraising infrastructure that allows to conduct token based raises in a more transparent, decentralized, and democratized manner.

titlecontent
PlatformEVM
LanguageSolidity
TagsStaking
Timeline03/04/2023 - 18/05/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Audit Summary

    Total10/10
    Security Score

    10/10

    Test Coverage

    100%

    Code Quality Score

    10/10

    Documentation Quality Score

    10/10

    15Total Findings
    8Resolved
    0Accepted
    5Mitigated

    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 Angel Block
    Audited ByHacken
    Websitehttps://angelblock.io→
    Changelog10/04/2023 - Initial Review
    18/05/2023 - Second Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for Angel Block
      Audited By
      Hacken
      Changelog
      10/04/2023 - Initial Review
      18/05/2023 - Second Review

    System Overview

    AngelBlock is a non-custodial, protocol based fundraising infrastructure that allows to conduct token based raises in a more transparent, decentralized, and democratized manner.

    The audit is focused on the Staking part of the system. It consists of following contracts:

    • AbstractPool – an abstract smart contract which basically describes the pool for accumulating deposited funds.

    • DepositPool – a pool smart contract inherited AbstractPool, which stores deposited assets and ERC721(NFTs) from staking. Tokens and NFTs are part of the ecosystem and are clearly defined in the smart contract. A smart contract has a keeper who can withdraw funds from the smart contract.

    • AbstractStaking – an abstract smart contract which basically describes a staking mechanism. It is available to update the state of the contract based on the compounding interest and rewards. It ensures that the compounding process only happens if there are sufficient rewards and an hour has passed since the last compounding action. As a deposit are accepted ERC20 and ERC721(NFTs) tokens.

    • TholosStaking – a staking smart contract inherited AbstractStaking. It has extended functionality for calculating rewards. Unstaking is only possible after a 10 day period after the unstake request.

    • NFTDataOperator – a smart contract calculates the ERC20 tokens equivalent for a given amount of WETH tokens based on the current and previous NFT collection floor prices and volumes. It also ensures that the calculated ERC20 per ERC721(NFTs) value is within the allowed local cap range. The contract allows updating the local cap values and is configurable by the owner.

    • INFTDataOperator – an interface for NFTDataOperator smart contract.

    • ITholosStaking – an interface for TholosStaking smart contract.

    • IStaking – an interface describes basic staking functions. TholosStaking smart contract inherits this interface.

    • IPool – an interface for the deposit pool. Describes ERC20 interactions.

    • IPool721 – an interface for the deposit pool. Describes ERC721(NFTs) interactions.

    Privileged roles

    • The 'keeper' of the DepositPool smart contract is able to withdraw native ERC20 and ERC721 (NFTs) tokens from the balance of the smart contract.

    • The ‘owner' of the NFTDataOperator is available to change cap range.

    • The ‘admin’ of the TholosStaking is available to configure the state of the  smart contract.

    • The ‘manager’ of the TholosStaking is available to set maxNftRewardCap value.

    • The ‘nft operator’ of the TholosStaking is available to set the rate between ERC20 native token and ERC721(NFT).

    • The ‘upgrader’ of the TholosStaking is available to upgrade the smart contract.

    Privileged roles

    • Provide more documentation and explanation of the project's  technical part.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 10 out of 10.

    • Functional requirements are provided and detailed.

    • Technical description is sufficient:

      • NatSpec is provided and sufficient.

      • Run instructions are provided.

    Code quality

    The total Code quality score is 10 out of 10.

    • The development environment is configured.

    • The code is well organized and follows best practices.

    Test coverage

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

    • Test coverage is sufficient.

    Security score

    Upon auditing, the code was found to contain 0 critical, 2 high, 1 medium, and 12 low severity issues. Out of these, 8 issues have been addressed and resolved, leading to a Security score of 10 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 10. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    The TholosStaking smart contract uses a queue to handle unstake requests. If the unstake queue size equals ten (10), it is impossible to withdraw assets.

    The deposit and withdrawal of ERC721 assets are only supported for the EOA wallets. In case of using Multi-sig or other smart contracts for interaction with staking contracts, it is a user responsibility to check if ERC721 tokens are supported.

    The vulnerability in AbstractStaking.sol could manifest when the rewardPool's balance is depleted or its transfer allowance is insufficient, potentially preventing users from withdrawing their funds. Additionally, this system presents a risk of gas inefficiency due to the unnecessary storage updates and token transfers in its design.

    Findings

    F-2023-0062Invalid Calculations; Requirements Violation
    Status
    mitigated
    Severity

    High
    F-2023-0061Denial Of Service
    Status
    mitigated
    Severity

    High
    F-2023-0063Requirements Violation
    Status
    fixed
    Severity

    Medium
    F-2023-0075Gas Optimization
    Status
    unfixed
    Severity

    Low
    F-2023-0074Unchecked Transfer
    Status
    mitigated
    Severity

    Low
    F-2023-0073Code Clarity
    Status
    unfixed
    Severity

    Low
    F-2023-0072OpenZeppelin Deprecated Function
    Status
    fixed
    Severity

    Low
    F-2023-0071Code Consistency
    Status
    fixed
    Severity

    Low
    F-2023-0070Gas Optimization
    Status
    fixed
    Severity

    Low
    F-2023-0069Redundant Code
    Status
    fixed
    Severity

    Low
    Code
    ―
    Title
    Status
    Severity
    F-2023-0062Invalid Calculations; Requirements Violation
    mitigated

    High
    F-2023-0061Denial Of Service
    mitigated

    High
    F-2023-0063Requirements Violation
    fixed

    Medium
    F-2023-0075Gas Optimization
    unfixed

    Low
    F-2023-0074Unchecked Transfer
    mitigated

    Low
    F-2023-0073Code Clarity
    unfixed

    Low
    F-2023-0072OpenZeppelin Deprecated Function
    fixed

    Low
    F-2023-0071Code Consistency
    fixed

    Low
    F-2023-0070Gas Optimization
    fixed

    Low
    F-2023-0069Redundant Code
    fixed

    Low
    1-10 of 15 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/angel-block/angelblock-contracts→
    Commitea726f7
    WhitepaperProvided→
    RequirementsProvided→
    Technical RequirementsProvided→

    Contracts in Scope

    contracts
    staking
    AbstractStaking.sol - contracts › staking › AbstractStaking.sol
    NFTDataOperator.sol - contracts › staking › NFTDataOperator.sol
    TholosStaking.sol - contracts › staking › TholosStaking.sol
    pools
    AbstractPool.sol - contracts › pools › AbstractPool.sol
    DepositPool.sol - contracts › pools › DepositPool.sol
    utils
    Configurable.sol - contracts › utils › Configurable.sol
    interfaces
    INFTDataOperator.sol - contracts › interfaces › INFTDataOperator.sol
    IPool.sol - contracts › interfaces › IPool.sol
    IPool721.sol - contracts › interfaces › IPool721.sol
    IStaking.sol - contracts › interfaces › IStaking.sol
    ITholosStaking.sol - contracts › interfaces › ITholosStaking.sol

    Disclaimer