Audit · firm’s term: audit report
QuillAudits reviewed Hund on 6 May 2024: 7 findings, 0 critical; all marked fixed.
Report hosted on quillaudits.com.
Trustblock does not review code.
Statuses are the security firm’s own, from its report.
| Severity | Open | Acknowledged | Fixed |
|---|---|---|---|
| Critical | 0 | 0 | 0 |
| High | 0 | 0 | 2 |
| Medium | 0 | 0 | 2 |
| Low | 0 | 0 | 3 |
The staking program functions, such as create_state, create_pool, update_pool, amount, stake, unstake, and withdraw, lack proper input validation on function parameters. This deficiency can lead to unintended behavior, such as setting total points to 0, which can cause a division by zero panic. Additionally, unchecked input values can result in the creation of states or pools with invalid parameters, leading to potential exploits and disruption of normal operations
The create_state function allows any user to create a new state with a specified id without any restrictions. Since the create_pool function requires the authority of an existing state, and only one pool can be created per id within the range of 0 to 12, an attacker can create 12 different states using create_state with ids from 0 to 12. This would prevent legitimate users from creating new states or pools, effectively causing a denial of service (DoS) attack on the staking program.
The variable amount_multipler is defined and initialized in the create_pool function, but it is not used in any calculations or further logic within the staking program. This unused variable introduces unnecessary complexity.
The staking program functions contain multiple instances of the unwrap method, which can lead to panics if an error occurs. The unwrap method forces a program to terminate if the result is an Err, which can be exploited by attackers to cause unintentional crashes. This lack of proper error handling can lead to unintended crashes
Several functions within the solana_token_staking program lack necessary event emissions. Emitting events is crucial for providing transparency and traceability of important actions and state changes within the smart contract. The missing events include: 1. create_state 2. fund_reward_token 3. withdraw
The program lacks NatSpec (Ethereum Natural Specification Format) documentation for its functions and data structures. NatSpec is a standardized format for documenting programs and is used to provide clear and detailed explanations of the purpose, inputs, outputs, and behavior of the contract's functions and data structures.
The withdraw function allows anyone with the authority to call the function and drain the reward amount and pool amount from the pool and reward vault without proper authorization checks. There is no verification that the reward amount and pool amount are indeed present or have been inputted by the user. Additionally, there are no checks to ensure that the user is authorized to perform the withdrawal.
The report names a repository or files. Open the report to see its scope.
Repository and files the report names (2)
350 projects reviewed · 459 reports · latest Apr 2025
See QuillAudits’s auditsSomething wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.
Tell us