Preliminary Report
Copyright Β© 2022 by Verilog. All rights reserved.
Mar 20, 2022
by Verilog Audit
This is the preliminary audit report to summarize the most urgent and critical issues found by the Verilog Audit. We will list the major concerns and findings here. Once the issues below are all resolved, we can proceed to a lower-level security and improvement analysis.
InformationalMinorMediumMajorCritical
Total | Acknowledged | Resolved | |
---|---|---|---|
Critical | 0 | 0 | 0 |
Major | 1 | 1 | 1 |
Medium | 1 | 1 | 1 |
Minor | 1 | 1 | 1 |
Informational | 3 | 3 | 0 |
none ;)
broadcastOrder()
function calls at OrderBookWithFee.sol
MajorbroadcastOrder()
function for unlimited times given they provide correct _order
and _signature
. Non-users can also observe exisiting _order
and _signature
, and then perform mimicry attack.Reentrancy Risk at OrderBookWithFee.sol
function broadcastOrder()
. medium
Description: address _notificationTarget
parameter can be passed by users.
Thus, users can pass an attacker contract address such as below to get benefit from the rewards.
Recommendation: Protect broadcastOrder()
with nonReentrant
modifier.
Result: Discussed with project team, nonReentrancy protection will be added, and they have no intention of giving out higher reward than fee.
Missing reentrancy protection at OrderMixin._fillOrderTo()
. minor
Description: missing reentrancy protection at OrderMixin._fillOrderTo()
. The function _fillOrderTo()
transfers asset from maker to target first. Then have a function call with data passed by msg.sender
. It calls the function notifyFillOrder
of the address decoded from the data, which gives oppotunities to the reentrancy actions.
Recommendation: transfer msg.sender
's token to maker first or add a nonReentrant modifier to protect this function.
Result: Acknowledged without action due to low risk
OrderBookWithFee.sol
does not include functionalites in OrderMixin.sol
and OrderRFQMixin.sol
. Informational
Description: The broadcast and fee payment mechanism is stand-alone and does not include OrderFill()
functions. In this case, users can bypass the fee payment and use order book functions solely.
Recommendation: Discussion needed
Result: Discussed with project team, and this design is made intentionally.
Do not transfer reward if the contract has insufficient token amount. Informational
Description: In OrderBookRewardDistributor.sol L83
, notifyOrderBroadcasted()
function does not transfer reward if the contract has insufficient token amount.
Recommendation: Transfer all the remaining tokens as reward.
Result: Acknowledged without action
Informational Duplicate code. Informational
Description: In Permitable.sol
, the _permit()
and _permitMemory()
functions are duplicates. Permit memory
is never used.
Recommendation: Replace _permitMemory()
with _permit()
. Permit calldata
is more gas-efficient.
Result: Acknowledged without action due to low risk