Platform: Code4rena
Start Date: 16/01/2024
Pot Size: $80,000 USDC
Total HM: 37
Participants: 178
Period: 14 days
Judge: Picodes
Total Solo HM: 4
Id: 320
League: ETH
Rank: 112/178
Findings: 1
Award: $39.34
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: peanuts
Also found by: 0xAsen, 0xHelium, 0xSmartContract, 0xepley, DedOhWale, K42, LinKenji, Sathish9098, ZanyBonzy, catellatech, fouzantanveer, foxb868, hassanshakeel13, hunter_w3b, jauvany, kaveyjoe, kinda_very_good, klau5, niroh, rspadi, yongskiws
39.3353 USDC - $39.34
Overview
Salty.IO is a Decentralized Exchange on Ethereum which uses Automatic Atomic Arbitrage (AAA) to generate yield and provide Zero Fees on all swaps. With AAA, market inefficiencies are arbitraged at swap time to create profits - which are then distributed to liquidity providers and stakers and used to form Protocol Owned Liquidity (POL) for the DAO. Additionally, Salty.IO provides USDS, an overcollateralized ERC20 stablecoin native to the protocol which uses WBTC/WETH LP as collateral. The exchange is 100% decentralized at launch - with all parameters, regional exclusions, whitelisting, and contracts controlled by the DAO itself.
Analysis of the codebase (What’s unique? What’s using existing patterns?):
*Unique:
*Existing Patterns:
*Strengths:
*Weaknesses:
External Contract Dependencies: Salty.io relies on external contracts from Openzepplin, Uniswapv3, and Chainlink. If any of these contracts have vulnerabilities, it would affect the protocol.
Test Coverage: The test coverage provided by Salty.io is 99% however, 100% test coverage is recommended.
Like any smart contract-based system, Salty.io is exposed to potential coding bugs or vulnerabilities. Exploiting these issues could result in the loss of funds or manipulation of the protocol.
The documentation of the Salty.io protocol is quite comprehensive and detailed, providing a solid overview of how the Salty.io protocol is structured and how its various aspects function. I would also recommend adding quality Medium articles, it’s a great way to provide an indepth look at many of the topics in the project and is used by many blockchain projects.
See automated findings here The 4naly3er report can be found here.
Previous ABDK audit can be found here. Previous Trail of Bits audit can be found here.
The Salty.io architecture seems solid in general, none the less here are some areas that could be improved:
Testing and Simulations: I recommend creating a live testnet app. Here is an example from The Open Dollar protocol. Conduct thorough testing of all contracts and functions and simulations to understand how they will behave under various market conditions.
I recommend rewriting some of the tests in the codebase for this audit to use the actual contracts instead of mock addresses like in some cases. This will offer greater confidence during system deployment.
Gas Optimizations
Other recommendations
My analysis of the Salty.io Protocol Included understanding the architecture, mechanism, overall codebase and possible risks associated to the protocol.
Day 1: I spent time reading the different available articles in order to have a deep understanding of the protocol.
Day 2: I analyzed the codebase for better understanding, Performed a Mechanism review and investigated possible systemic risks, and centralization risks.
Day 3: I dedicated this day to coming up with possible Architecture recommendations after identifying possible risks and prepared the final analysis report.
Conclusion
Analysing this codebase and its architectural choices has been a delightful experience. Inherently complex systems greatly benefit from strategically implemented simplifications, and I believe this project has successfully struck a harmonious balance between the imperative for simplicity and the challenge of managing complexity. I hope that I have been able to offer a valuable overview of the methodology utilised during the analysis of the contracts within scope, along with pertinent insights for the project team and any party interested in analysing this codebase.
24 hours
#0 - c4-judge
2024-02-03T14:55:15Z
Picodes marked the issue as grade-b