We express our gratitude to the Gable Finance team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Gable is a protocol creating the liquidity market on Radix DLT. Users can borrow funds without collateral in the form of flash loans, as well as earn staking rewards and interest earnings from supplying their tokens to the protocol.
Review Scope
10/10
10/10
66.66%
10/10
The system users should acknowledge all the risks summed up in the risks section of the report
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
Gable is a protocol creating the liquidity market on Radix DLT. Users can borrow funds without collateral in the form of flash loans, as well as earn staking rewards and interest earnings from supplying their tokens to the protocol.
Users that are staking XRD on the Gable validator receive liquid staking units (LSU tokens) that can be deposited in the flashloan pool to earn some interest.
Borrowers that take loans repay it with some interest that is then split 50-50 between the users that deposited LSU and the smart contract owner.
The owner of the contract could perform multiple administrative changes, like changing interest rates, updating suppliers key value store, deposit and withdraw liquidity to the pool directly, depositing and withdrawing validator node ownership token, as well as perform unstaking and claiming operations.
The admin role can perform most of the owner’s actions, except from depositing and withdrawing liquidity and validator node ownership token.
The total Documentation quality score is 10 out of 10.
Functional and technical requirements were provided.
Technical description and diagrams were provided.
The code implements complex calculations logic with small amounts of descriptions and requirements.
The total Code quality score is 10 out of 10.
The development environment is configured.
The code is readable and easy to digest.
Most of the methods are described with appropriate comments.
Test cases are well described with requirements.
Code coverage of the project could not be directly calculated with common tools likely due to the lack of support for Scrypto. Nevertheless, taking into account the functional coverage and the number of tests available in the code repository, the tests cover approximately 66.66% of the codebase.
Deployment and basic user interactions are covered with tests.
Negative cases coverage is missed.
Interaction with validator and methods associated with these operation are not covered
Upon auditing, the code was found to contain 0 critical, 1 high, 2 medium, and 5 low severity issues. Out of these, 8 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.
The comprehensive audit of the customer's smart contract yields an overall score of 8.7. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
The smart contract could be upgraded and its functionality may be changed.
Centralization and the owner's ability to withdraw the whole liquidity from the pool might be dangerous, if his wallet/badge will be compromised.
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2023-0151 | Owner could withdraw more than he has deposited as owner_liquidity | Fixed | High | |
F-2023-0153 | Missing validations in multiple calculations could lead to unexpected state | Fixed | Medium | |
F-2023-0152 | Missing upper bound on interest rate change | Fixed | Medium | |
F-2023-0158 | Test functions should be removed | Fixed | Low | |
F-2023-0157 | Floating Language Version | Fixed | Low | |
F-2023-0156 | Wrong limit for the size of box | Fixed | Low | |
F-2023-0155 | Owner is able to unlock and update royalties for function calls | Fixed | Low | |
F-2023-0154 | Macros used for debugging should not be used in production code | Fixed | Low | |
I-2023-0042 | Former name is mentioned | Fixed | Observation | |
I-2023-0041 | Suggestions for idiomatic code style | Fixed | Observation |
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
Severity
Description
Severity
Description
Severity
Description
The scope of the project includes the following smart contracts from the provided repository:
flashloan-pool/src/events.rs
flashloan-pool/src/lib.rs