Use a solidity version of at least 0.8.12 to get string.concat() instead of abi.encodePacked(,)
Use a solidity version of at least 0.8.13 to get the ability to use using for with a list of free functions
Index event fields make the field more quickly accessible to off-chain tools that parse events. However, note that each index field costs extra gas during emission, so it's not necessarily best to index the maximum allowed per event (three fields).
Each event should use three indexed fields if there are three or more fields, and gas usage is not particularly of concern for the events in question. If there are fewer than three fields, all of the fields should be indexed.
Events that are declared but not used may be indicative of unused declarations where it makes sense to remove them for better readability/maintainability/auditability, or worse indicative of a missing emit which is bad for monitoring or missing logic that would have emitted that event.
4: import "./oz/interfaces/IERC20.sol";
5: import "./oz/libraries/SafeERC20.sol";
6: import "./utils/Owner.sol";
7: import "./oz/utils/Pausable.sol";
8: import "./oz/utils/ReentrancyGuard.sol";
9: import "./interfaces/IVotingEscrow.sol";
10: import "./interfaces/IBoostV2.sol";
11: import "./utils/Errors.sol";
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L4-L11
#### <ins>Recommended Mitigation Steps</ins>
Use specific imports syntax per solidity docs recommendation.
### <a href="#Summary">[NC‑6]</a><a name="NC‑6"> Lines are too long
Usually lines in source code are limited to 80 characters. Today's screens are much larger so it's reasonable to stretch this in some cases. Since the files will most likely reside in GitHub, and GitHub starts using a scroll bar in all cases when the length is over 164 characters, the lines below should be split when they reach that length
Reference: https://docs.soliditylang.org/en/v0.8.10/style-guide.html#maximum-line-length
#### <ins>Proof Of Concept</ins>
239: // Check that the user has enough boost delegation available & set the correct allowance to this contract
Summary
Low Risk Issues
constructor
Total: 4 contexts over 1 issues
Non-critical Issues
Total: 17 contexts over 6 issues
Low Risk Issues
[LOW‑1] Missing parameter validation in
constructor
Some parameters of constructors are not checked for invalid values.
Proof Of Concept
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L132-L137
Recommended Mitigation Steps
Validate the parameters.
Non Critical Issues
[NC‑1] Use a more recent version of Solidity
Use a solidity version of at least 0.8.12 to get string.concat() instead of abi.encodePacked(,)
Use a solidity version of at least 0.8.13 to get the ability to use using for with a list of free functions
Proof Of Concept
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L2
Recommended Mitigation Steps
Consider updating to a more recent solidity version.
[NC‑2] Event Is Missing Indexed Fields
Index event fields make the field more quickly accessible to off-chain tools that parse events. However, note that each index field costs extra gas during emission, so it's not necessarily best to index the maximum allowed per event (three fields).
Each event should use three indexed fields if there are three or more fields, and gas usage is not particularly of concern for the events in question. If there are fewer than three fields, all of the fields should be indexed.
Proof Of Concept
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L85
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L115
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L117
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L119
[NC‑3] Implementation contract may not be initialized
OpenZeppelin recommends that the initializer modifier be applied to constructors. Per OZs Post implementation contract should be initialized to avoid potential griefs or exploits. https://forum.openzeppelin.com/t/uupsupgradeable-vulnerability-post-mortem/15680/5
Proof Of Concept
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L132-L137
[NC‑4] Unused event may be unused code or indicative of missed emit/logic
Events that are declared but not used may be indicative of unused declarations where it makes sense to remove them for better readability/maintainability/auditability, or worse indicative of a missing emit which is bad for monitoring or missing logic that would have emitted that event.
Proof Of Concept
https://github.com/code-423n4/2022-10-paladin/tree/main/contracts/WardenPledge.sol#L96
Recommended Mitigation Steps
Add emit or remove event declaration.
[NC‑5] Non-usage of specific imports
The current form of relative path import is not recommended for use because it can unpredictably pollute the namespace. Instead, the Solidity docs recommend specifying imported symbols explicitly. https://docs.soliditylang.org/en/v0.8.15/layout-of-source-files.html#importing-other-source-files
Proof Of Concept
239: // Check that the user has enough boost delegation available & set the correct allowance to this contract
261: // based on the Boost bias & the Boost duration, to take in account that the delegated amount decreases