Blacksail Finance Info

Blacksail Finance is an advanced smart contract yield compounding suite built on the Sonic Blockchain network. Blacksail helps users earn more cryptocurrency by automatically compounding their DeFi rewards for their crypto tokens into their original assets, allowing users to easily earn more of their favorite holdings.

Blacksail Finance Logo

TrustNet Score

The TrustNet Score evaluates crypto projects based on audit results, security, KYC verification, and social media presence. This score offers a quick, transparent view of a project's credibility, helping users make informed decisions in the Web3 space.

67.00
PoorExcellent

Real-Time Threat Detection

Real-time threat detection, powered by Cyvers.io, is currently not activated for this project.

This advanced feature provides continuous monitoring and instant alerts to safeguard your assets from potential security threats. Real-time detection enhances your project's security by proactively identifying and mitigating risks. For more information, click here.

TrustNet DataPulse

There are currently no DeFi contracts accessible at this time.

Security Assessments

"Static AnalysisDynamic AnalysisSymbolic ExecutionSWC CheckManual Review"
Contract address
N/A
Network N/A
License N/A
Compiler N/A
Type N/A
Language Solidity
Onboard date 2024/12/18
Revision date In progress

Summary and Final Words

No crucial issues found

The contract does not contain issues of high or medium criticality. This means that no known vulnerabilities were found in the source code.

Contract owner cannot mint

It is not possible to mint new tokens.

Contract owner cannot blacklist addresses.

It is not possible to lock user funds by blacklisting addresses.

Contract owner cannot set high fees

The fees, if applicable, can be a maximum of 25% or lower. The contract can therefore not be locked. Please take a look in the comment section for more details.

Contract cannot be locked

Owner cannot lock any user funds.

Token cannot be burned

There is no burn function within the contract.

Ownership is not renounced

Contract can be manipulated by owner functions.

Contract is not upgradeable

The contract does not use proxy patterns or other mechanisms to allow future upgrades. Its behavior is locked in its current state.

Scope of Work

This audit encompasses the evaluation of the files listed below, each verified with a SHA-1 Hash. The team referenced above has provided the necessary files for assessment.

The auditing process consists of the following systematic steps:

  1. Specification Review: Analyze the provided specifications, source code, and instructions to fully understand the smart contract's size, scope, and functionality.
  2. Manual Code Examination: Conduct a thorough line-by-line review of the source code to identify potential vulnerabilities and areas for improvement.
  3. Specification Alignment: Ensure that the code accurately implements the provided specifications and intended functionalities.
  4. Test Coverage Assessment: Evaluate the extent and effectiveness of test cases in covering the codebase, identifying any gaps in testing.
  5. Symbolic Execution: Analyze the smart contract to determine how various inputs affect execution paths, identifying potential edge cases and vulnerabilities.
  6. Best Practices Evaluation: Assess the smart contracts against established industry and academic best practices to enhance efficiency, maintainability, and security.
  7. Actionable Recommendations: Provide detailed, specific, and actionable steps to secure and optimize the smart contracts.

A file with a different Hash has been intentionally or otherwise modified after the security review. A different Hash may indicate a changed condition or potential vulnerability that was not within the scope of this review.

Final Words

The following provides a concise summary of the audit report, accompanied by insightful comments from the auditor. This overview captures the key findings and observations, offering valuable context and clarity.


Ownership Privileges
Blacksail_StrategyV3.sol
  • The owner can update the vault contract address.
  • The owner can enable/disable the harvest on deposit setting in the contract.
  • The owner can withdraw the reward tokens.
  • The owner can pause/un-pause the contract.
  • The owner can update the withdrawal fees to not more than 0.1%.
  • The owner can update the slippage tolerance value to not more than 15%.
Blacksail_Vault.sol
  • The owner can propose a new Strategy implementation in the contract.
  • The owner can upgrade the proposed strategy after the approval delay has passed.

Note - This Audit report consists of a security analysis of the Blacksail smart contract. This analysis did not include functional testing (or unit testing) of the contract’s logic. Moreover, we only audited one token contract for the Blacksail team. Other contracts associated with the project were not audited by our team. We recommend investors do their own research before investing.

Files and details

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Functions
public

/

State variables
public

/

Total lines
of code

/

Capabilities
Hover on items

/

Findings and Audit result

high Issues | 1 findings

Resolved

#1 high Issue
Unsafe use of tx.origin
Blacksail_StrategyV3.sol
L150
L192
L212
Description

Using tx.origin in a Solidity smart contract is generally not safe due to its vulnerability to phishing attacks. If an attacker deploys a malicious contract and tricks a user into interacting with it, the attacker's contract can invoke your harvest(), withdraw() function by passing along the user's address as tx.origin. tx.origin does not differentiate between the original user and intermediate contracts. This creates ambiguity in authorization, making your code more prone to misuse. Avoid using tx.origin for security-critical checks. Rely on msg.sender and enforce robust authentication mechanisms like access control or whitelisting.

medium Issues | 7 findings

Resolved

#1 medium Issue
Missing 'isContract' check.
Blacksail_StrategyV3.sol
L141-144
Description

The contract lacks a validation check to ensure that specific parameters are contract addresses. Without this check, there is a risk that non-contract addresses (such as externally owned accounts, or EOAs) could be mistakenly set for parameters intended to reference other contracts. This could lead to failures in executing critical interactions within the contract, as EOAs do not support contract-specific functions. To mitigate this, Implement a validation check to ensure that parameters designated as contract addresses are verified as such. This can be done using Solidity’s Address library function isContract, which checks if an address has associated contract code.

Resolved

#2 medium Issue
Missing access control.
Blacksail_StrategyV3.sol
L155-162
Description

The function is declared public, allowing anyone to call it. If this action needs to be performed by specific roles (e.g., only the owner or a trusted operator), unrestricted access could be problematic. For example, an attacker could spam this function unnecessarily, leading to increased gas usage. There must be a check so that the specific roles can call that function.

Resolved

#3 medium Issue
Missing Non-reentrant check.
Blacksail_Vault.sol
L131-148
Description

The contract contains the functionality in which the claim function (and similar functions like withdraw), making an external call to transfer ERC20 tokens using the transfer function. Since the contract hasn't yet marked the claim as completed (i.e., updated the claimed variable), the attacker can exploit this to re-enter the claim function, repeatedly withdrawing tokens. The transfer happens first (interaction with an external contract) before the internal state is updated. The nonReentrant modifier ensures that any attempts to call the claim function again during execution are blocked, providing an additional safeguard. Therefore, It is recommended to do the check-effect-transaction method or use the non-reentrant modifier to prevent the code from this issue.

Resolved

#4 medium Issue
Missing Non-reentrant check.
Blacksail_StrategyV3.sol
L211-214 176-201
Description

The contract contains the functionality in which the claim function (and similar functions like withdraw), making an external call to transfer ERC20 tokens using the transfer function. Since the contract hasn't yet marked the claim as completed (i.e., updated the claimed variable), the attacker can exploit this to re-enter the claim function, repeatedly withdrawing tokens. The transfer happens first (interaction with an external contract) before the internal state is updated. The nonReentrant modifier ensures that any attempts to call the claim function again during execution are blocked, providing an additional safeguard. Therefore, It is recommended to do the check-effect-transaction method or use the non-reentrant modifier to prevent the code from this issue.

Resolved

#5 medium Issue
Insufficient Slippage Protection
Blacksail_StrategyV3.sol
L260-283
Description

Setting params.amountOutMinimum = 0 leaves the swap vulnerable to slippage and price manipulation, as the swap will accept any output amount. To mitigate this, Calculate a reasonable amountOutMinimum based on market conditions to ensure value is preserved during the swap.

Resolved

#6 medium Issue
Missing zero check
Blacksail_StrategyV3.sol
L233-247
Description

It is recommended to check that the value is not zero. The function assumes sufficient reward_token and native_token balances without verifying them before transfers. Add require statements to check balances and allowances.

Resolved

#7 medium Issue
The owner can withdraw tokens from the reward pool
Blacksail_StrategyV3.sol
L337-340
Description

The panic function is a critical emergency safeguard to protect funds during unexpected situations. It temporarily pauses the contract and withdraws funds from an external reward pool to ensure the safety of assets. However, it introduces centralization risks that need to be mitigated through governance mechanisms or multi-signature control. also, the owner can implement a time lock to prevent immediate execution of the panic function, allowing for community review in decentralized setups. Moreover, Allow the owner to withdraw only up to a certain percentage of the funds, reducing the risk of over-withdrawal.

low Issues | 6 findings

Resolved

#1 low Issue
Floating pragma solidity version
Blacksail_StrategyV3.sol
L3
Description

Adding the constant version of solidity is recommended, as this prevents the unintentional deployment of a contract with an outdated compiler that contains unresolved bugs.

Resolved

#2 low Issue
Floating pragma solidity version
Blacksail_Vault.sol
L3
Description

Adding the constant version of solidity is recommended, as this prevents the unintentional deployment of a contract with an outdated compiler that contains unresolved bugs.

Resolved

#3 low Issue
Missing events arithmetic
Blacksail_StrategyV3.sol
L382-386
L329-334
Description

It is recommended to emit all the critical parameter changes.

Resolved

#4 low Issue
Missing Visibility
Blacksail_Vault.sol
L21
Description

It is recommended to add a 'public', 'private', or 'internal' modifier in the contract.

Resolved

#5 low Issue
Missing Error Handling for External Calls
Blacksail_StrategyV3.sol
L260-283
Description

external calls to IUniswapRouterV3.exactInput and IIchiDepositHelper.forwardDepositToICHIVault may fail for various reasons, including insufficient token balances, invalid parameters, or issues within the external contract itself. try-catch can be used to handle errors gracefully when calling external contracts. If the external call fails, the catch block executes, allowing the contract to handle the error or revert with an appropriate message.

Resolved

#6 low Issue
Missing events
Blacksail_Vault.sol
L89-107
Description

It is recommended to emit all the critical changes.