An Ethereum-based DEX with zero swap fees, yield-generating Automatic Arbitrage, and a native WBTC/WETH backed stablecoin.
Platform: Code4rena
Start Date: 16/01/2024
End Date: 30/01/2024
Period: 14 days
Status: Completed
Pot Size: $80,000 USDC
Participants: 178
Reporter: PaperParachute
Judge: Picodes
Id: 320
League: ETH
0xpiken | 1/178 | $9,530.29 | 10 | 2 | 1 | 7 | 0 | - | 0 | 0 |
t0x1c | 2/178 | $5,264.15 | 11 | 0 | 0 | 10 | 1 | - | 0 | 0 |
zzebra83 | 3/178 | $2,659.20 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
handsomegiraffe | 4/178 | $2,659.20 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
0xRobocop | 5/178 | $2,551.96 | 13 | 3 | 0 | 9 | 0 | - | 0 | 0 |
Banditx0x | 6/178 | $2,252.86 | 9 | 2 | 0 | 6 | 0 | - | 0 | 0 |
klau5 | 7/178 | $2,147.70 | 11 | 2 | 0 | 8 | 0 | 0 | 0 | - |
niroh | 8/178 | $1,723.82 | 5 | 0 | 0 | 2 | 0 | - | - | - |
oakcobalt | 9/178 | $1,452.86 | 7 | 1 | 0 | 5 | 0 | - | 0 | 0 |
Bauchibred | 10/178 | $1,268.77 | 2 | 0 | 0 | 1 | 0 | - | 0 | 0 |
Auditor per page
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.
Futher details about the project can be found at https://docs.salty.io
The Salty.IO codebase is divided up into the following folders:
/arbitrage - handles searching for arbitrage opportunities at user swap time - with the actual arbitrage swaps being done within Pools.sol itself.
/dao - handles creating governance proposals, voting, acting on successful proposals and managing POL (Protocol Owned Liquidity). DAO adjustable parameters are stored in ~Config.sol contracts and are stored on a per folder basis.
/launch - handles the initial airdrop, initial distribution, and bootstrapping ballot (a decentralized vote by the airdrop recipients to start up the DEX and distribute SALT).
/pools - a core part of the exchange which handles liquidity pools, swaps, arbitrage, and user token deposits (which reduces gas costs for multiple trades) and pools contribution to recent arbitrage trades (for proportional rewards distribution).
/price_feed - implements a redundant price aggregator (initially using Chainlink, Uniswap v3 TWAP and the Salty.IO reserves) to provide the BTC and ETH prices used by the overcollateralized stablecoin framework.
/rewards - handles global SALT emissions, SALT rewards (which are sent to liquidity providers and stakers), and includes a rewards emitter mechanism (which emits a percentage of rewards over time to reduce rewards volatility).
/stable - includes the USDS contract and collateral functionality which allows users to deposit WBTC/WETH LP as collateral, borrow USDS (which mints it when borrowed), repay USDS (which burns it) and allow users to liquidate undercollateralized positions.
/staking - implements a staking rewards mechanism which handles users receiving rewards proportional to some "userShare". What the userShare actually represents is dependent on the contract that derives from StakingRewards.sol (namely Staking.sol which handles users staking SALT, and CollateralAndLiquidity.sol which handles users depositing collateral and liquidity).
/ - includes the SALT token, the default AccessManager (which allows for DAO controlled geo-restriction) and the Upkeep contract (which contains a user callable performUpkeep() function that ensures proper functionality of ecosystem rewards, emissions, POL formation, etc).
Futher technical details about each component can be found at https://tech.salty.io
forge build
To run unit tests
Note - the RPC URL needs to be a Sepolia RPC (e.g. https://rpc.sepolia.org)
COVERAGE="yes" NETWORK="sep" forge test -vv --rpc-url http://x.x.x.x:yyy
The 4naly3er report can be found here.
Automated findings output for the audit can be found here within 24 hours of audit opening.
Note for C4 wardens: Anything included in this Automated Findings / Publicly Known Issues
section is considered a publicly known issue and is ineligible for awards.
isContract
was deliberate.src/arbitrage/tests/*
src/dao/tests/*
src/dev/*
src/launch/tests/*
src/pools/tests/*
src/price_feed/tests/*
src/rewards/tests/*
src/root_tests/*
src/scenario_tests/*
src/stable/tests/*
src/staking/tests/*
lib/*
- If you have a public code repo, please share it here: - How many contracts are in scope?: 35 - Total SLoC for these contracts?: 3,288 - How many external imports are there?: 58 - How many separate interfaces and struct definitions are there for the contracts within scope?: 29 interfaces , 8 structs - Does most of your code generally use composition or inheritance?: Composition - How many external calls?: 96 - What is the overall line coverage percentage provided by your tests?: 99 - Is this an upgrade of an existing system?: False - Check all that apply (e.g. timelock, NFT, AMM, ERC20, rollups, etc.): AMM, ERC-20 Token - Is there a need to understand a separate part of the codebase / get context in order to audit this part of the protocol?: False - Please describe required context: - Does it use an oracle?: Chainlink - Describe any novel or unique curve logic or mathematical models your code uses: - Is this either a fork of or an alternate implementation of another project?: no - Does it use a side-chain?: no - Describe any specific areas you would like addressed:
Employees of Salty.IO and employees' family members are ineligible to participate in this audit.