Introduction
We express our gratitude to the HELLO Labs team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
HELLO Labs is the future of crypto and entertainment creating TV shows, games, NFTs and, much more. The ecosystem is built on the HELLO Token allowing exclusive access to watch our shows and play our games.
| title | content |
|---|---|
| Platform | EVM |
| Language | Solidity |
| Tags | Bridge, Voting |
| Timeline | 30/04/2024 - 01/05/2024 |
| Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
|---|---|
| Repository | https://github.com/0xSimbo/hello-labs-killer-whales/tree/feat/voting-swap/src→ |
| Commit | 2653a80c55d26d7f1c524fa94ceff1050bd93893 |
Review Scope
- Commit
- 2653a80c55d26d7f1c524fa94ceff1050bd93893
Audit Summary
10/10
100%
7/10
8/10
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 | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for HELLO Labs |
| Audited By | Seher Saylik |
| Approved By | Ataberk Yavuzer |
| Website | https://www.hello.one/→ |
| Changelog | 01/05/2024 - Preliminary Report |
| 15/05/2024 - Final Report |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for HELLO Labs
- Audited By
- Seher Saylik
- Approved By
- Ataberk Yavuzer
- Website
- https://www.hello.one/→
- Changelog
- 01/05/2024 - Preliminary Report
- 15/05/2024 - Final Report
System Overview
Hello Labs is a Solana-Ethereum cross-chain bridge for Hello tokens along with a Voting mechanism that consists on the following contracts:
HelloBridge — is a base bridging mechanism of tokens between different blockchains. It allows users to deposit Hello tokens on one chain and claim them on another, with specified signers providing necessary signatures for claiming. Additionally, it supports functionalities such as pausing deposits and claims, updating supported chains, and migrating the contract to another address.
HelloBridgeSolanaAdapter — a contract that serves as an adapter for the Solana blockchain, facilitating the interaction with the HelloBridge contract to send and receive tokens between Ethereum and Solana chains. It allows users to deposit tokens from Ethereum to Solana and withdraw tokens from Solana to Ethereum, while also providing functionalities to pause deposits and withdrawals, approve the bridge contract, and update the bridge and store addresses
HelloBridgeStore — a contract that acts as storage for tracking users' deposits and withdrawals for the HelloBirdge contract. It maintains mappings that record the total HelloToken deposits and withdrawals for each user and chain. The contract also ensures that only the authorized bridge contract can update these mappings.
VotingSwap — a contract that executes a voting mechanism where users can cast votes by swapping tokens. It allows users to cast votes by providing a signature that authorizes specific calls to be executed. Votes are cast by swapping tokens for a specified minimum output, and the corresponding number of votes is added to a project.
Privileged roles
The owner of the HelloBridge contract can set the withdrawal signers, set the supported chains, pause/unpause the deposits or claims, set the bridge storage, migrate the bridge to another contract.
The owner of the HelloBridgeSolanaAdapter can pause/unpause the deposits or claims, set the bridge address, set the HelloBridge storage address.
The owner of the HelloBridgeStore contract can set the bridge contract,
The owner of the VotingSwap contract can change the signer, rescue ERC20 or native tokens from the platform.
Executive Summary
Documentation quality
The total Documentation quality score is 8 out of 10.
Functional requirements are partially provided.
Technical description is provided.
NatSpec is provided.
Code quality
The total Code quality score is 7 out of 10.
The code violates some best practices.
The development environment is configured.
Test coverage
Code coverage of the project is 100% (branch coverage).
As the coverage tool couldn't be measured, the score is specified as 0.
Deployment and basic user interactions are covered with tests.
Tests for HelloBridgeSolanaAdapter are not provided.
Some negative cases coverage is missed.
Interactions by several users are not tested thoroughly.
Security score
Upon auditing, the code was found to contain 3 critical, 1 high, 0 medium, and 6 low severity issues. Out of these, 5 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.2. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Risks
Withdrawals and deposits on the Solana-Ethereum cross-chain bridge are subject to potential pause by the owner. This introduces a risk of disruption to user transactions which might result in delays or loss of access to funds.
The security of external calls executed within the castVotes() function cannot be verified as they are included in the signature signed by the protocol and specified by the protocol owner. These external calls involve off-chain logic, which falls outside the scope of this audit.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2024-1871 | Unpredictable Claiming Order Leading to Funds Lock | fixed | Critical | |
| F-2024-1811 | Signature Can Be Frontrunned When Withdrawing on Ethereum Network | fixed | Critical | |
| F-2024-1809 | Withdrawal Calculations Mismatch in withdrawFromSolana() | fixed | Critical | |
| F-2024-1806 | Double Spending in castVotes() Function By A Malicious Actor | fixed | High | |
| F-2024-1861 | abi.encodePacked() Should Not Be Used With Dynamic Types | accepted | Low | |
| F-2024-1825 | Missing Contract Existence Checks Before low-level Call | accepted | Low | |
| F-2024-1824 | Use Ownable2Step Rather Than Ownable | accepted | Low | |
| F-2024-1822 | Missing Checks For address(0) In constructor/initializers | accepted | Low | |
| F-2024-1821 | Centralization Risk For Privileged Functions | fixed | Low | |
| F-2024-1820 | Return values of transfer()/transferFrom() not checked | accepted | Low |
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 | |
|---|---|
| Repository | https://github.com/0xSimbo/hello-labs-killer-whales/tree/feat/voting-swap/src→ |
| Commit | 2653a80c55d26d7f1c524fa94ceff1050bd93893 |
| Whitepaper | N/a |
| Requirements | https://github.com/0xSimbo/hello-labs-killer-whales/tree/feat/voting-swap/README.md→ |
| Technical Requirements | https://github.com/0xSimbo/hello-labs-killer-whales//README.md→ |
Scope Details
- Commit
- 2653a80c55d26d7f1c524fa94ceff1050bd93893
- Whitepaper
- N/a
- Technical Requirements
- https://github.com/0xSimbo/hello-labs-killer-whales//README.md→