Mismatch between the natspec comment and the documentation. In scope to the contest it is specified that collateral token will be only WETH
, LINK
USDC
, WBTC
but in PerpetualVault::initialize
function in natspec
comment it is specified that collateral token can be ETH
, WETH
, BTC
, LINK
, UNI
, USDC
, USDT
, DAI
, FRAX
.
Because of this, it can be confusing for developers and users.
If you don't consider adding these tokens in the future, the vulnerability is that users can send ETH
to the contract and thus lose it. If you are going to add these tokens in future implementations, users can also lose e.g. ETH
, thinking that there is a conversion of ether to WETH
and vice versa. There is also a vulnerability for using the USDT
token. The _transferToken
function is called in the _handleReturn
function, which in turn passes the token to the recipient in the try block and in case of revert handles this case in the catch block where it sends this token to the treasury. The vulnerability is that USDT
is a weird token and in case of an error it will return false, but the catch block does not catch errors as false. The token is transferred via normal transfer, not safeTransfer. So the user may not get his tokens as well as the treasury.
Remove unnecessary tokens in natSpec
comments, or optimise the functions for all these tokens
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.
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.