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

Audit name:

[SCA] EarnTV | ERC20 + ERC721 + Staking | Jul2023

Date:

Jul 25, 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 EarnTV team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.

EarnTV is a freemium web3 streaming service in the AVOD (Advertising-supported Video on Demand) and SVOD markets.

titlecontent
PlatformPolygon
LanguageSolidity
TagsERC20 token, Staking, ERC721 token, Subscription
Timeline05/07/2023 - 24/07/2023
Methodologyhttps://hackenio.cc/sc_methodology→

    Review Scope

    Repositoryhttp://gitlabrepo.v2softinc.com/bpachai_git/uprime→
    Commit241611a179e6c73eed2e28b1addac616506a71aa

    Audit Summary

    Total9.7/10
    Security Score

    10/10

    Test Coverage

    98.78%

    Code Quality Score

    9/10

    Documentation Quality Score

    10/10

    17Total Findings
    14Resolved
    0Accepted
    2Mitigated

    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 EarnTV
    Audited ByHacken
    Websitehttps://earntv.io/→
    Changelog11/07/2023 – Initial Review
    24/07/2023 - Second Review
    • Document

      Name
      Smart Contract Code Review and Security Analysis Report for EarnTV
      Audited By
      Hacken
      Changelog
      11/07/2023 – Initial Review
      24/07/2023 - Second Review

    System Overview

    EarnTV is a freemium web3 streaming service in the AVOD (Advertising-supported Video on Demand) and SVOD markets with the following contracts:

    • RewardToken — Simple ERC-20 token that mints all initial supply to a deployer. Additional minting is not allowed. It has the following attributes: \-Name: RewardEarnTV. \-Symbol: rETV. \-Decimals: 18. \-Total supply: 500m tokens.

    • ParentEarnTv — The contract is an ERC-20 token implementation with additional administrative and security features. It allows the contract owner and administrators to perform bulk token transfers, burn tokens, pause/unpause the contract, and withdraw any stuck Ether or ERC-20 tokens.

    • IssueETV — The contract enables the issuance of ETV tokens in bulk. It allows the contract owner to set thresholds for transfers, add or remove issuers, and withdraw stuck ERC-20 tokens or Ether.

    • GoldETV — The contract is used for minting non-fungible tokens (NFTs) representing subscriptions to a EarnTv service.

    • SilverETV — The contract is used for minting non-fungible tokens (NFTs) representing subscriptions to a EarnTv service.

    • BronzeETV — The contract is used for minting non-fungible tokens (NFTs) representing subscriptions to a EarnTv service.

    • IERC5643.sol — Extension of EIP-721. It proposes an additional interface for NFTs to be used as recurring, expirable subscriptions. The interface includes functions to renew and cancel the subscription.

    • IERC20Extended — Simple interface for ParentEarnTv.sol

    Privileged roles

    ParentEarnTv.sol

    \-onlyOwner privilege roles:

    • addAdmins(): Add admins address in the contract.

    • removeAdmins(): Remove admins address from the contract.

    • setIssuerContract(): Set the issuer contract address.

    • updateMaxTransferLimit(): Updates max account transfer limit.

    • updateTimeBetweenSubmissions(): Updates time between submissions.

    • withdrawAll(): Transfer all BNBs/ETHs stored in the contract to the caller.

    • withdrawStuckTokens(): Transfer stuck ERC20 tokens from within the contract.

    • transferOwnership(): Transfers ownership of the contract to a new account.

    • cancelTransferOwnership(): Cancel ownership transfer request.

    \-onlyIssuerContractOrOwner privilege roles:

    • bulkTransfer(): Moves tokens amount from tokenOwner to recipients.

    \-onlyAdminOrOwner privilege roles:

    • pause(): Pause the contract.

    • unpause() : Unpause the contract.

    IssueETV.sol

    \-onlyIssuer privilege roles:

    • issueBulkETVToken(): Moves tokens amount from tokenOwner to recipients.

    • withdrawAll(): Transfer all BNBs/ETHs stored in the contract to the caller.

    • withdrawStuckTokens(): Transfer stuck ERC20 tokens from within the contract.

    \-onlyOwner privilege roles:

    • updateThreshold(): Increase transfer threshold value for the contract.

    • addIssuers(): Add issuers address in the contract.

    • removeIssuers(): Remove issuers address from the contract.

    • transferOwnership(): Transfers ownership of the contract to a new account.

    GoldETV.sol

    \-onlyOwnerOrAdmin privilege roles:

    • updateBaseURI(): Sets new URI value.

    • safeMintAndRenewSubscription(): Mint GoldETV Subscription NFTs to the recipient addresses.

    • pause(): Pause the contract.

    • unpause(): Unpause the contract.

    • renewSubscription(): Renews a subscription for a given token ID by extending its expiration date.

    \-onlyOwner privilege roles:

    • withdrawContractEth(): Transfer all ETHs from this contract to owner.

    • transferOwnership(): Transfers ownership of the contract to a new account.

    • cancelTransferOwnership(): Cancel ownership transfer request.

    • updateAdmin(): Update the contract admin address.

    SilverETV.sol

    \-onlyOwnerOrAdmin privilege roles:

    • updateBaseURI(): Sets new URI value.

    • safeMintAndRenewSubscription(): Mint GoldETV Subscription NFTs to the recipient addresses.

    • pause(): Pause the contract.

    • unpause(): Unpause the contract.

    • renewSubscription(): Renews a subscription for a given token ID by extending its expiration date.

    \-onlyOwner privilege roles:

    • withdrawContractEth(): Transfer all ETHs from this contract to owner.

    • transferOwnership(): Transfers ownership of the contract to a new account.

    • cancelTransferOwnership(): Cancel ownership transfer request.

    • updateAdmin(): Update the contract admin address.

    BronzeETV.sol

    \-onlyOwnerOrAdmin privilege roles:

    • updateBaseURI(): Sets new URI value.

    • safeMintAndRenewSubscription(): Mint GoldETV Subscription NFTs to the recipient addresses.

    • pause(): Pause the contract.

    • unpause(): Unpause the contract.

    • renewSubscription(): Renews a subscription for a given token ID by extending its expiration date.

    \-onlyOwner privilege roles:

    • withdrawContractEth(): Transfer all ETHs from this contract to owner.

    • transferOwnership(): Transfers ownership of the contract to a new account.

    • cancelTransferOwnership(): Cancel ownership transfer request.

    • updateAdmin(): Update the contract admin address.

    Executive Summary

    Documentation quality

    The total Documentation quality score is 10 out of 10.

    • Functional requirements are provided.

    • Technical description is provided.

    Code quality

    The total Code quality score is 9 out of 10.

    • The development environment is configured.

    Test coverage

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

    • Deployment and user interactions are covered with tests.

    Security score

    Upon auditing, the code was found to contain 0 critical, 1 high, 6 medium, and 8 low severity issues. Out of these, 13 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 9.7. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.

    Risks

    ERC-5643: Subscription NFTs proposal still under review and it is not recommended to use. https://eips.ethereum.org/EIPS/eip-5643 .

    The Reward Token is a dummy ERC20 with no detailed utility.

    The protocol is extremely centralized and the owner gets minted the totality of the tokens.

    ETV token transfers are blocked if the contract is paused.

    The solution for issue M01 depends on tools that are currently outside the scope of the audit.

    Findings

    F-2023-1200Requirement Violation
    Status
    fixed
    Severity

    High
    F-2023-1206 Missing Validation
    Status
    fixed
    Severity

    Medium
    F-2023-1205Funds Lock
    Status
    fixed
    Severity

    Medium
    F-2023-120Missing Validation
    Status
    fixed
    Severity

    Medium
    F-2023-120 Data Consistency
    Status
    fixed
    Severity

    Medium
    F-2023-1202Copy of Well-Known Contract
    Status
    fixed
    Severity

    Medium
    F-2023-1201Requirement Violation
    Status
    mitigated
    Severity

    Medium
    F-2023-121 Possible Integer Overflow
    Status
    fixed
    Severity

    Low
    F-2023-121Checks-Effects-Interactions Pattern Violation
    Status
    fixed
    Severity

    Low
    F-2023-1212 Best Practice Violation - Long Numeric Literal
    Status
    fixed
    Severity

    Low
    Code
    ―
    Title
    Status
    Severity
    F-2023-1200Requirement Violation
    fixed

    High
    F-2023-1206 Missing Validation
    fixed

    Medium
    F-2023-1205Funds Lock
    fixed

    Medium
    F-2023-120Missing Validation
    fixed

    Medium
    F-2023-120 Data Consistency
    fixed

    Medium
    F-2023-1202Copy of Well-Known Contract
    fixed

    Medium
    F-2023-1201Requirement Violation
    mitigated

    Medium
    F-2023-121 Possible Integer Overflow
    fixed

    Low
    F-2023-121Checks-Effects-Interactions Pattern Violation
    fixed

    Low
    F-2023-1212 Best Practice Violation - Long Numeric Literal
    fixed

    Low
    1-10 of 17 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

    Repositoryhttp://gitlabrepo.v2softinc.com/bpachai_git/uprime→
    Commit241611a179e6c73eed2e28b1addac616506a71aa
    WhitepaperProvided
    RequirementsProvided
    Technical RequirementsProvided

    Contracts in Scope

    BronzeETV.sol - BronzeETV.sol
    GoldETV.sol - GoldETV.sol
    IERC20Extended.sol - IERC20Extended.sol
    IERC5643.sol - IERC5643.sol
    IssueETV.sol - IssueETV.sol
    EarnTv.sol - EarnTv.sol
    RewardToken.sol - RewardToken.sol
    SilverETV.sol - SilverETV.sol
    StakeETV.sol - StakeETV.sol
    NFTSubscription.sol - NFTSubscription.sol

    Disclaimer