This repository has been archived by the owner on May 26, 2023. It is now read-only.
bulej93 - use abi.encodeCall instead of abi.encodeWithSelector #222
Labels
Excluded
Excluded by the judge without consulting the protocol or the senior
Non-Reward
This issue will not receive a payout
bulej93
medium
use abi.encodeCall instead of abi.encodeWithSelector
Summary
using abi.encodeWithSelector isnt type safe, the function will still execute with the wrong data types
Vulnerability Detail
if you pass in the wrong data types when using abi.encodeWithSelector the function will still run to completion and not return an error even though it failed.
Impact
the expected results wont appear because you wont be able to tell if the function worked or not
Code Snippet
https://github.com/sherlock-audit/2023-01-uxd/blob/main/contracts/external/layer-zero/lzApp/NonblockingLzApp.sol#L25
Tool used
https://blog.soliditylang.org/2021/12/20/solidity-0.8.11-release-announcement/
OpenZeppelin/openzeppelin-contracts#3693
Manual Review
Recommendation
use abi.encodeCall
The text was updated successfully, but these errors were encountered: