Omniscia Boson Protocol Audit

ReentrancyGuardBase Code Style Findings

ReentrancyGuardBase Code Style Findings

RGB-01C: Outdated Documentation of Reentrancy Guard

TypeSeverityLocation
Code StyleReentrancyGuardBase.sol:L38, L46-L47

Description:

The linked documentation lines of the ReentrancyGuardBase contract are taken from the original bool-based implementation by OpenZeppelin, however, the implementation used by the Boson Protocol is uint256 based as the linked EIP-2200 regarding gas refunds is no longer valid.

Example:

contracts/protocol/bases/ReentrancyGuardBase.sol
36modifier nonReentrant() {
37 ProtocolLib.ProtocolStatus storage ps = ProtocolLib.protocolStatus();
38 // On the first call to nonReentrant, _notEntered will be true
39 require(ps.reentrancyStatus != ENTERED, REENTRANCY_GUARD);
40
41 // Any calls to nonReentrant after this point will fail
42 ps.reentrancyStatus = ENTERED;
43
44 _;
45
46 // By storing the original value once again, a refund is triggered (see
47 // https://eips.ethereum.org/EIPS/eip-2200)
48 ps.reentrancyStatus = NOT_ENTERED;
49}

Recommendation:

We advise the documentation lines of the contract to be corrected reflecting the new functionality it represents.

Alleviation (44009967e4f68092941d841e9e0f5dd2bb31bf0b):

The documentation of the contract has been properly updated to reflect its logic as advised.