Introduction
We express our gratitude to the Shuttle Labs team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Shuttle Labs is multi-chain decentralized exchange that utilizes Lit Protocol to enable \<10 second cross chain swaps.
Document | |
|---|---|
| Name | Smart Contract Code Review and Security Analysis Report for Shuttle Labs |
| Audited By | Seher Saylik |
| Approved By | Grzegorz Trawiński |
| Website | bridgesmarter.com→ |
| Changelog | 22/01/2025 - Preliminary Report |
| 30/01/2025 - Final Report | |
| Platform | Base, Optimism, Arbitrum, Polygon, BSC, Avalanche, Ethereum |
| Language | Solidity |
| Tags | Bridge, Vault |
| Methodology | https://hackenio.cc/sc_methodology→ |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Shuttle Labs
- Audited By
- Seher Saylik
- Approved By
- Grzegorz Trawiński
- Website
- bridgesmarter.com→
- Changelog
- 22/01/2025 - Preliminary Report
- 30/01/2025 - Final Report
- Platform
- Base, Optimism, Arbitrum, Polygon, BSC, Avalanche, Ethereum
- Language
- Solidity
- Tags
- Bridge, Vault
- Methodology
- https://hackenio.cc/sc_methodology→
Review Scope | |
|---|---|
| Repository | https://github.com/Shuttle-Labs/genius-contracts→ |
| Commit | f57f67b |
Review Scope
- Commit
- f57f67b
Audit Summary
The system users should acknowledge all the risks summed up in the risks section of the report
Documentation quality
Functional requirements are partially provided.
Technical description is not provided.
Code quality
The code contains some gas-inefficient usages.
The development environment is configured.
Test coverage
Code coverage could not measured due to an error occurred when running “forge coverage” command.
System Overview
Shuttle Labs is a bridge solution with the following contracts:
GeniusGasTank — a contract that facilitates gasless sponsored transactions by leveraging Permit2 functionality for token approvals, batching transactions, and executing them via a proxy.
GeniusVaultCore — a contract that provides cross-chain liquidity management and swaps by utilizing stablecoins as the primary asset, ensuring efficient asset handling and order processing. It incorporates staking, order creation, and liquidity rebalancing mechanisms.
GeniusRouter — a contract that enables transaction aggregation by handling token approvals, transfers, and calls to external contracts through Permit2 and a proxy. It facilitates operations like swaps, order creation, and cross-chain transactions by interacting with GeniusVault and other contracts.
GeniusActions — a contract that manages actions within the Genius Protocol by enabling their addition, removal, and modification.
GeniusVault — a contract that acts as a cross-chain stablecoin bridge with integrated price-based deposit protection, ensuring secure handling of stablecoin transactions. It leverages Chainlink price feeds to safeguard against stablecoin depegging and includes features for fee collection, order creation, and liquidity management.
GeniusProxyCall — a contract that allows for aggregating and executing multiple operations, including token approvals, transfers, and calls to other contracts, in a single transaction.
MultiSendCallOnly — contract is a utility that allows batching multiple transactions into a single execution, where each transaction is a call operation (direct external function call with optional value transfer).
GeniusErrors — a library that defines a comprehensive set of custom error types for use within the Genius protocol.
Privileged roles
The admin of the GeniusActions contract can;
set the orchestrators
set the commit hash
add a new action
update an action's status
update an action's IPFS hash
The Sentinel role of the GeniusActions contract can;
disable an action
disable an orchestrator
The admin of the GeniusGasTank contract can;
set the fee recipient
set the proxy call contract
unpause the contract
The admin or orchestrator role of GeniusVault contract can;
claim fees
The admin role of GeniusVaultCore contract can;
set rebalance threshold
set the proxy call contract
unpause the contract
set the price feed address
set target chain minimum fee amount
set stable coin price boundaries
set max order amount
The orchestrator role of GeniusVaultCore contract can;
set rebalance threshold
cancel an order
Potential Risks
All bridge operations are executed by orchestrators, which operate off-chain. This reliance introduces potential risks, as malicious actors may target orchestrators to disrupt operations, manipulate transactions, or exploit vulnerabilities in their off-chain processes. Additionally, the centralized nature of orchestrator-driven execution could expose the system to risks of collusion, downtime, or compromise, which may impact the security and reliability of the bridge operations.
The swap data or call data to handle stable coins passed during proxy calls is provided by orchestrators off-chain and cannot be verified. This introduces a significant risk as the validity and accuracy of the data cannot be inherently verified on-chain.
The bridging operations rely on staked tokens, creating a risk where user funds may be temporarily inaccessible or unavailable for withdrawal if they are actively being utilized in a bridging process.
The use of unlimited token approvals (e.g., type(uint256).max) in approveTokenExecute and similar functions leaves the protocol exposed to potential vulnerabilities if the approved contracts or addresses are compromised.
Findings
Code ― | Title | Status | Severity | |
|---|---|---|---|---|
| F-2025-8438 | Missing Minimum Order Amount Validation in Genius Protocol Contracts | accepted | Medium | |
| F-2025-8418 | Lack of Order Cancellation and Validation | fixed | Medium | |
| F-2025-8292 | Stale or Incorrect Price Data from Chainlink's latestRoundData | fixed | Medium | |
| F-2025-8289 | Improper Token Amount Conversion Leading to Free Minting and Token Burn | fixed | Medium | |
| F-2025-8412 | Accounting Issues Related to Possible Fee-on-Transfer Tokens in Genius Contracts | accepted | Low | |
| F-2025-8360 | Missing Chain ID in Message Signature Can Cause Replay Attacks | fixed | Low | |
| F-2025-8433 | Use != 0 Instead of > 0 for Gas Optimization | fixed | Observation | |
| F-2025-8432 | Use of Magic Numbers in Percentage Validation | fixed | Observation | |
| F-2025-8430 | Floating Pragma | fixed | Observation | |
| F-2025-8429 | Inconsistent Use of revert and require Statements | fixed | Observation |
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
Appendix Scope
The scope of the project includes the following smart contracts from the provided repository:
Scope Details | |
|---|---|
| Repository | https://github.com/Shuttle-Labs/genius-contracts→ |
| Commit | f57f67be65e8797506fd8d78ddfe7cd933639c6e |
| Retest commit | 5212a9c9dbfa3b8aa552d3e4df0850dfb1f8e5d9 |
| Whitepaper | N/A |
| Requirements | https://shuttlelabs.notion.site/Genius-Docs-159eae0682dd47a39446ac9bb7b7afda→ |
| Technical Requirements | N/A |
Scope Details
- Commit
- f57f67be65e8797506fd8d78ddfe7cd933639c6e
- Retest commit
- 5212a9c9dbfa3b8aa552d3e4df0850dfb1f8e5d9
- Whitepaper
- N/A
- Technical Requirements
- N/A
Assets in Scope
Appendix 3. Additional Valuables
Verification of System Invariants
During the audit of Shuttle Labs, Hacken followed its methodology by performing fuzz-testing on the project's main functions. Foundry →, a tool used for fuzz-testing, was employed to check how the protocol behaves under various inputs. Due to the complex and dynamic interactions within the protocol, unexpected edge cases might arise. Therefore, it was important to use fuzz-testing to ensure that several system invariants hold true in all situations.
Fuzz-testing allows the input of many random data points into the system, helping to identify issues that regular testing might miss. A specific Echidna fuzzing suite was prepared for this task, and throughout the assessment, 9 invariants were tested over 10,000 runs. This thorough testing ensured that the system works correctly even with unexpected or unusual inputs.
Invariant | Test Result | Run Count |
|---|---|---|
GeniusVaultCore::stakeDeposit(), GeniusVaultCore::stakeWithdraw() Depositing and withdrawing any amount of stablecoin should not lose funds | Failed | 10k |
GeniusVaultCore::stakeDeposit(), GeniusVaultCore::stakeWithdraw() Should deposit and withdraw any amount successfully | Passed | 10k |
GeniusVault::createOrder() Should revert when an invalid amount of fee is provided | Passed | 10k |
GeniusVault::createOrder() Order hashes must be unique when different seeds provided | Passed | 10k |
GeniusRouter::swapAndCreateOrder() When creating an order with any amount , it should receive the correct stable coin amount | Passed | 10k |
GeniusRouter::swapAndCreateOrder() When creating an order with any amount , the vault should receive the fee | Passed | 10k |
GeniusRouter::swapAndCreateOrderPermit2() It should revert when an invalid token address is provided by the orchestrator | Passed | 10k |
GeniusRouter::swapAndCreateOrderPermit2() It should revert when an invalid nonce is provided by the orchestrator | Passed | 10k |
GeniusRouter::createOrderPermit2() It should revert when invalid amount is provided by the orchestrator | Passed | 10k |
Invariant
GeniusVaultCore::stakeDeposit(),GeniusVaultCore::stakeWithdraw()Depositing and withdrawing any amount of stablecoin should not lose fundsTest Result
- Failed
Run Count
- 10k
Invariant
GeniusVaultCore::stakeDeposit(),GeniusVaultCore::stakeWithdraw()Should deposit and withdraw any amount successfullyTest Result
- Passed
Run Count
- 10k
Invariant
GeniusVault::createOrder()Should revert when an invalid amount of fee is providedTest Result
- Passed
Run Count
- 10k
Invariant
GeniusVault::createOrder()Order hashes must be unique when different seeds providedTest Result
- Passed
Run Count
- 10k
Invariant
GeniusRouter::swapAndCreateOrder()When creating an order with any amount , it should receive the correct stable coin amountTest Result
- Passed
Run Count
- 10k
Invariant
GeniusRouter::swapAndCreateOrder()When creating an order with any amount , the vault should receive the feeTest Result
- Passed
Run Count
- 10k
Invariant
GeniusRouter::swapAndCreateOrderPermit2()It should revert when an invalid token address is provided by the orchestratorTest Result
- Passed
Run Count
- 10k
Invariant
GeniusRouter::swapAndCreateOrderPermit2()It should revert when an invalid nonce is provided by the orchestratorTest Result
- Passed
Run Count
- 10k
Invariant
GeniusRouter::createOrderPermit2()It should revert when invalid amount is provided by the orchestratorTest Result
- Passed
Run Count
- 10k
Additional Recommendations
The smart contracts in the scope of this audit could benefit from the introduction of automatic emergency actions for critical activities, such as unauthorized operations like ownership changes or proxy upgrades, as well as unexpected fund manipulations, including large withdrawals or minting events. Adding such mechanisms would enable the protocol to react automatically to unusual activity, ensuring that the contract remains secure and functions as intended.
To improve functionality, these emergency actions could be designed to trigger under specific conditions, such as:
Detecting changes to ownership or critical permissions.
Monitoring large or unexpected transactions and minting events.
Pausing operations when irregularities are identified.
These enhancements would provide an added layer of security, making the contract more robust and better equipped to handle unexpected situations while maintaining smooth operations.