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

Audit name:

[SCA] Alien.fun | Alien-Contracts | Sep2024

Date:

Oct 11, 2024

Table of Content

→Introduction
→Audit Summary
→System Overview
→Potential Risks
→Findings
→Appendix 1. Definitions
→Appendix 2. Scope
→Disclaimer

Want a comprehensive audit report like this?

Introduction

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

Alien.fun is a decentralized platform built on blockchain technology that makes it easy to create, collect, and trade vanity tokens or meme coins entirely peer-to-peer (P2P).

Document

NameSmart Contract Code Review and Security Analysis Report for Alien.fun
Audited ByDavid Camps Novi
Approved ByGrzegorz Trawinski
Websitehttps://www.alien.fun→
Changelog27/09/2024 - Preliminary Report; 10/10/2024 - Final Report
PlatformArbitrum
LanguageSolidity
TagsFactory, Token Sales.
Methodologyhttps://hackenio.cc/sc_methodology→
  • Document

    Name
    Smart Contract Code Review and Security Analysis Report for Alien.fun
    Audited By
    David Camps Novi
    Approved By
    Grzegorz Trawinski
    Changelog
    27/09/2024 - Preliminary Report; 10/10/2024 - Final Report
    Platform
    Arbitrum
    Language
    Solidity
    Tags
    Factory, Token Sales.

Review Scope

Repositoryhttps://github.com/AlienDotFun/Alien-Contracts→
Commit3a5c3b9

Audit Summary

14Total Findings
7Resolved
7Accepted
0Mitigated

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

Documentation quality

  • Functional requirements is partially missed.

    • General business proposition is provided.

    • Contracts description and requirements are not provided.

  • Technical description is not provided.

Code quality

  • The development environment is not configured.

  • NatSpec is not provided.

Test coverage

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

  • Tests cannot be run due to the misconfiguration of the codebase.

System Overview

Alien.fun is a decentralized platform built on blockchain technology that makes it easy to create, collect, and trade vanity tokens or meme coins entirely peer-to-peer (P2P). It consists of the following contracts:

  • AlienFunToken - Custom ERC20 token contract used as the standard of deployed tokens.

  • AlienFunBondingCurve - Defines the token buyout or sale of deployed tokens.

  • AlienFunTokenFactory - Allows a user to deploy an ERC20 token, based on the former two standard contracts.

Privileged roles

  • Owner - The system owner can

    • Update the different control parameters:  fee receiver, fee percentage, minimum ETH buy amount.

    • Fund the token creator.

    • Withdraw native and ERC20 tokens from the AlienFunBondingCurve contract.

Potential Risks

The project uses Solidity version 0.8.20 or higher, which includes the introduction of the PUSH0 (0x5f) opcode. This opcode is currently supported on the Ethereum mainnet but may not be universally supported across other blockchain networks. Consequently, deploying the contract on chains other than the Ethereum mainnet, such as certain Layer 2 (L2) chains or alternative networks, might lead to compatibility issues or execution errors due to the lack of support for the PUSH0 opcode. In scenarios where deployment on various chains is anticipated, selecting an appropriate Ethereum Virtual Machine (EVM) version that is widely supported across these networks is crucial to avoid potential operational disruptions or deployment failures. However, the development team specified that the project will be only deployed on Arbitrum. Hence this would only be problematic in case of new deployments.

The contract AlienFunBondingCurve includes the functions emergencyWithdraw() and emergencyETHWithdraw(), which allow the system owner to retrieve any amount of tokens from the contract at will, without any restrictions.

Findings

F-2024-6344 Precision Loss in ETH Amount Calculation in sellTokens Function
Status
fixed
Severity

Medium
F-2024-6333Users can Lose Funds if Contract Balance is Insufficient
Status
accepted
Severity

Medium
F-2024-6336Unchecked Slippage Parameters May Lead to Loss of Funds
Status
fixed
Severity

Low
F-2024-6335Accounting Mismatch due to Missing Checks in Token Withdraw
Status
accepted
Severity

Low
F-2024-6332Requirement Violation due to Imprecise Check
Status
fixed
Severity

Low
F-2024-6330ERC20 Tokens can Be Transferred for Free
Status
fixed
Severity

Low
F-2024-6339Division by Zero in Token Price Calculation
Status
accepted
Severity

Observation
F-2024-6334Best Practice Violation: Arbitrary Variable Naming
Status
accepted
Severity

Observation
F-2024-6329Unoptimized Access Control
Status
accepted
Severity

Observation
F-2024-6328Missing Events for Key Value Updates
Status
accepted
Severity

Observation
Code
―
Title
Status
Severity
F-2024-6344 Precision Loss in ETH Amount Calculation in sellTokens Function
fixed

Medium
F-2024-6333Users can Lose Funds if Contract Balance is Insufficient
accepted

Medium
F-2024-6336Unchecked Slippage Parameters May Lead to Loss of Funds
fixed

Low
F-2024-6335Accounting Mismatch due to Missing Checks in Token Withdraw
accepted

Low
F-2024-6332Requirement Violation due to Imprecise Check
fixed

Low
F-2024-6330ERC20 Tokens can Be Transferred for Free
fixed

Low
F-2024-6339Division by Zero in Token Price Calculation
accepted

Observation
F-2024-6334Best Practice Violation: Arbitrary Variable Naming
accepted

Observation
F-2024-6329Unoptimized Access Control
accepted

Observation
F-2024-6328Missing Events for Key Value Updates
accepted

Observation
1-10 of 14 findings

Identify vulnerabilities in your smart contracts.

Appendix 1. Definitions

Severities

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.
  • 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.

Potential Risks

The "Potential Risks" section identifies issues that are not direct security vulnerabilities but could still affect the project’s performance, reliability, or user trust. These risks arise from design choices, architectural decisions, or operational practices that, while not immediately exploitable, may lead to problems under certain conditions. Additionally, potential risks can impact the quality of the audit itself, as they may involve external factors or components beyond the scope of the audit, leading to incomplete assessments or oversight of key areas. This section aims to provide a broader perspective on factors that could affect the project's long-term security, functionality, and the comprehensiveness of the audit findings.

Appendix 2. Scope

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

Scope Details

Repositoryhttps://github.com/AlienDotFun/Alien-Contracts→
Commit3a5c3b9
Whitepaper-
Requirementshttps://docs.alien.fun→
Technical Requirements-

Assets in Scope

AlienFunBondingCurve.sol - AlienFunBondingCurve.sol
AlienFunToken.sol - AlienFunToken.sol
AlienFunTokenFactory.sol - AlienFunTokenFactory.sol

Disclaimer