
Trestle wTIA Bridge audit
A private security review of Trestle (modular blockchain infrastructure), conducted with Three Sigma and completed on 27th January 2024 over 3 days. 0xSimao disclosed 14 findings: 1 high severity, 7 medium, 5 low and 1 informational.
What Trestle is
Trestle connects Celestia's modular network with Ethereum's protocols and users: a bridge between the two chains that brings Wrapped TIA (wTIA) to Ethereum for trading and building on the asset.
Scope
A three-day Three Sigma review of the bridge pair: the wTIA token contract and the Trestle bridge logic that mints it on arrival and releases it on the way back.
High severity findings
Medium severity findings
- Stuck tokens due to not using SafeTransfer
- Swaps should use the deadline argument on top of minimumAmountOut
- On tax sells, swaps are vulnerable to MEV
- createAmmPairWith() in initialize() will revert if the pair already exists
- Amounts to distribute are added directly to tokenPerShare, skipping using rewardPerToken
- Possible to mint or burn infinite shares, stealing all rewards or making transfers fail
- address(0) can be added as a pair, triggering taxes on burn
Low severity findings
- totalShares update should add before reducing to avoid underflows
- Users may send tokens before the dead block period to an address to blacklist it
- Native transfers should use Openzeppelin's .sendValue()
- Missing events
- Ownable2Step is preferred over Ownable
Informational findings
The report