Platform: Code4rena
Start Date: 11/11/2022
Pot Size: $90,500 USDC
Total HM: 52
Participants: 92
Period: 7 days
Judge: LSDan
Total Solo HM: 20
Id: 182
League: ETH
Rank: 24/92
Findings: 3
Award: $570.40
🌟 Selected for report: 0
🚀 Solo Findings: 0
88.5851 USDC - $88.59
The function that updates the daoCommissionPercentage
has a check that the percentage is not more than 100%, but 100% would be a valid value with the current implementation. This is not good for the protocol though, because if a malicious or compromised DAO address sets it to 100% this will mean that on a claimRewardsAsNodeRunner()
call, the recipient will get 0 rewards and the “dao” will get 100% of the reward amount, essentially rugging rewards.
The impact is all node runner rewards can be stolen by the “dao” but it requires a malicious or a compromised dao account
Add a sensible upper limit to the commission percentage, for example 5%.
#0 - c4-judge
2022-11-21T22:03:46Z
dmvt marked the issue as duplicate of #190
#1 - c4-judge
2022-12-02T17:19:00Z
dmvt marked the issue as satisfactory
6.2548 USDC - $6.25
The method responsible for setting a whitelist status of a node runner has the following check
require(isNodeRunnerWhitelisted[_nodeRunner] != isNodeRunnerWhitelisted[_nodeRunner], "Unnecessary update to same status");
which will always result in false
because it is comparing the same values.
This results in the whole whitelisting functionality being impossible to use with the current state of the code.
Update the check to look like isNodeRunnerWhitelisted[_nodeRunner] != isWhitelisted
#0 - c4-judge
2022-11-21T22:04:39Z
dmvt marked the issue as duplicate of #67
#1 - c4-judge
2022-11-30T11:41:56Z
dmvt marked the issue as satisfactory
#2 - C4-Staff
2022-12-21T00:11:17Z
JeeberC4 marked the issue as duplicate of #378
🌟 Selected for report: 0xSmartContract
Also found by: 0x4non, 0xNazgul, 0xRoxas, 0xdeadbeef0x, 0xmuxyz, 9svR6w, Awesome, Aymen0909, B2, Bnke0x0, CloudX, Deivitto, Diana, Franfran, IllIllI, Josiah, RaymondFam, ReyAdmirado, Rolezn, Sathish9098, Secureverse, SmartSek, Trust, Udsen, a12jmx, aphak5010, brgltd, bulej93, c3phas, ch0bu, chaduke, chrisdior4, clems4ever, cryptostellar5, datapunk, delfin454000, fs0c, gogo, gz627, hl_, immeas, joestakey, lukris02, martin, nogo, oyc_109, pashov, pavankv, peanuts, pedr02b2, rbserver, rotcivegaf, sahar, sakman, shark, tnevler, trustindistrust, zaskoh, zgo
475.5642 USDC - $475.56
previewAccumulatedETH
Codebase is currently using Solidity version 0.8.13 - it is a best practice to use latest Solidity version as you can get compiler optimisations and bugfixes.
The codebase is using floating pragma (for example ***pragma*** solidity ^0.8.13;
) - Always use a concrete version so you get the same bytecode on each compilation for certain.
Here you can see all security advisories for the OpenZeppelin library and you can see that the version used in the codebase
"@openzeppelin/contracts": "^4.5.0", "@openzeppelin/contracts-upgradeable": "4.5.0",
is not entirely safe. The contracts that are vulnerable are not used, but this is still a best practice for security - use latest version that has all security patches.
address
to address payable
even though it is not neededOwnableSmartWalletFactory require(owner !**=** address(*0*), 'Wallet cannot be address 0');
- should be Owner cannot be address 0
LPToken require(**msg.sender** **==** deployer, "Only savETH vault");
should be Only Deployer
SavETHVault require(address(**this**).balance **>=** _amount, "Insufficient withdrawal amount");
should be Insufficient balance in vault to withdraw
Allows a LP token owner to burn their tokens
→ Allows an LP token owner to burn their tokens
depoistor
→ depositor
== false
or == true
on boolean expressionsThere are 20+ occurrences of == false
or == true
in the code - just use !boolexpr
for == false
and boolexpr
for == true
Remove the TODO comment or resolve it
type(uint256).max
instead of 2 ** 256 - 1
Use the built-in type(uint256).max
The event CurrentStamp
is not used and is also in the middle of the smart contract. Remove it
burn()
Both GiantLP::burn and LPToken::burn have a _recipient
named parameter. There is no recipient
in a “burn” so rename parameter to “account” or “burnFrom”.
This should not be an issue since those contracts are only used to be cloned, but it is still a good practice to initialise them yourself
call
or do ERC20::transfer
cals are missing nonReentrant
modifierOwnableSmartWallet
inherits from OZ’s Ownable and also LiquidStakingManager
has the updateDAOAddress
functionality. Both are doing them in a one-step way, consider using a two-step ownership transfer pattern.
#0 - c4-judge
2022-12-02T21:43:03Z
dmvt marked the issue as grade-a