Platform: Code4rena
Start Date: 10/02/2022
Pot Size: $30,000 USDC
Total HM: 5
Participants: 24
Period: 3 days
Judge: harleythedog
Total Solo HM: 3
Id: 86
League: ETH
Rank: 19/24
Findings: 1
Award: $90.97
🌟 Selected for report: 0
🚀 Solo Findings: 0
90.9726 USDC - $90.97
The following source units are imported but not referenced in the contract:
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
Check all imports and remove all unused/unreferenced and unnecessary imports.
public
to generate the getter function can make the code simpler and cleanercontract ZeroExStorage is Ownable { address private _swapTarget; /// @notice Returns the address of 0x swaptarget function swapTarget() external view returns (address) { return _swapTarget; } /// @notice Update the address of 0x swaptarget function updatesSwapTarget(address swapTargetValue) external onlyOwner { _swapTarget = swapTargetValue; } }
Can be changed to:
contract ZeroExStorage is Ownable { address public swapTarget; /// @notice Update the address of 0x swaptarget function updatesSwapTarget(address swapTargetValue) external onlyOwner { swapTarget = swapTargetValue; } }
_msgSender()
Direct use of msg.sender
vs internal call of _msgSender()
.
ZeroExStorage(operatorStorage).transferOwnership(msg.sender);
_token.safeTransfer(msg.sender, _amount);
require(supportedFactories[msg.sender], "OFH: FORBIDDEN");
require(msg.sender == weth, "FS: ETH_SENDER_NOT_WETH");
amount = _releaseToken(_msgSender(), _tokens[i]); _tokens[i].safeTransfer(_msgSender(), amount); emit PaymentReleased(_msgSender(), address(_tokens[i]), amount);
_token.safeTransferFrom(_msgSender(), address(this), _amount);
Consider replacing _msgSender()
with msg.sender
for consistency.
#0 - maximebrugel
2022-02-15T15:08:37Z
_msgSender()
" (Disputed)The one with msg.sender
are used when meta transactions are not supported (sender is WETH, Nested Factory,...)
#1 - harleythedogC4
2022-03-01T02:21:25Z
My personal judgements:
#2 - harleythedogC4
2022-03-03T02:27:16Z
Now, here is the methodology I used for calculating a score for each QA report. I first assigned each submission to be either non-critical (1 point), very-low-critical (5 points) or low-critical (10 points), depending on how severe/useful the issue is. The score of a QA report is the sum of these points, divided by the maximum number of points achieved by a QA report. This maximum number was 26 points, achieved by https://github.com/code-423n4/2022-02-nested-findings/issues/66.
The number of points achieved by this report is 2 points. Thus the final score of this QA report is (2/26)*100 = 8.