The provided Solidity code implements a utility library ParaSwapUtils
for interacting with the ParaSwap protocol. However, it contains a critical vulnerability due to the hardcoded address of the AugustusSwapper
contract (0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57
). According to the ParaSwap documentation, the address of AugustusSwapper
varies across different blockchain networks. This hardcoding limits the code's portability and functionality on chains where the AugustusSwapper
address differs from the hardcoded value.
The address of AugustusSwapper
is hardcoded as 0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57
in the _validateCallData
function.
If the AugustusSwapper
address changes (e.g., due to an upgrade or migration), the _validateCallData will always revert.
Portability: The code cannot be deployed on chains where the AugustusSwapper
address differs from the hardcoded value.
Functionality: If deployed on an unsupported chain, the swap
function will fail due to the invalid AugustusSwapper
address.
Maintenance: If the AugustusSwapper
address changes (e.g., due to an upgrade or migration), the code may revert.
The impact is Medium, the likelihood is Low, so the severity is Low.
Maunal Review
Make the AugustusSwapper
address a parameter of the swap
function, allowing it to be dynamically specified by the caller.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.