safeApprove() should be replaced with safeIncreaseAllowance() in ParaSwapUtils.sol#L23
IERC20.approve() has risks.
Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender’s allowance to 0 and set the desired value afterwards:
According to :
safeApprove() is Deprecated. This function has issues similar to the ones found in IERC20.approve
, and its usage is discouraged.
Whenever possible, use safeIncreaseAllowance
and safeDecreaseAllowance
instead.
Deprecated function safeApprove() should not be used
manually reviewed
replace safeApprove() with safeIncreaseAllowance() in function ParaSwapUtils.sol#swap()
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.