Platform: Code4rena
Start Date: 25/08/2022
Pot Size: $75,000 USDC
Total HM: 35
Participants: 147
Period: 7 days
Judge: 0xean
Total Solo HM: 15
Id: 156
League: ETH
Rank: 10/147
Findings: 3
Award: $2,283.64
π Selected for report: 0
π Solo Findings: 0
1714.8718 DAI - $1,714.87
https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L265-L289 https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L240-L262 https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L205-L236 https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L180-L201 https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L159-L176 https://github.com/code-423n4/2022-08-olympus/blob/main/src/modules/VOTES.sol#L1
When all contracts have been deployed and/or initialized, the OlympusVotes contract does not mint an initial token supply. This would allow users to be able to submit proposals, then vote and execute proposals if there has been no token supply (totalSupply = 0) after 1 week of proposal activation.
Manual review
An initial VOTES token supply should be minted. and to accommodate the initial supply, some changes to the if-statement
if (netVotes * 100 < VOTES.totalSupply() * EXECUTION_THRESHOLD) { revert NotEnoughVotesToExecute(); }
#0 - fullyallocated
2022-09-01T22:13:34Z
Technically correct, but the production version will use a different version of the token that has an initial supply. We can consider adding in a minimum token threshold though for proposal execution
#1 - fullyallocated
2022-09-01T22:29:21Z
Duplicate of #392
π Selected for report: carlitox477
https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L279
The OlympusGovernance.executeProposal() function makes an external call to kernel contract before updating the state variable activeProposal
. This does not follow the CEI pattern and allows the function to be possibly be re-entered to execute the proposal multiple times before the proposal is deactivated.
https://github.com/code-423n4/2022-08-olympus/blob/main/src/policies/Governance.sol#L279
Manual review
A non-reentrant modifier or mutex may be necessary. Alternatively, the check-effect-interact pattern should be implemented.
#0 - fullyallocated
2022-09-04T03:12:51Z
Duplicate of #132
π Selected for report: zzzitron
Also found by: 0x040, 0x1f8b, 0x52, 0x85102, 0xDjango, 0xNazgul, 0xNineDec, 0xSky, 0xSmartContract, 0xkatana, 8olidity, Aymen0909, Bahurum, BipinSah, Bnke0x0, CRYP70, CertoraInc, Ch_301, Chandr, Chom, CodingNameKiki, Deivitto, DimSon, Diraco, ElKu, EthLedger, Funen, GalloDaSballo, Guardian, IllIllI, JansenC, Jeiwan, Lambda, LeoS, Margaret, MasterCookie, PPrieditis, PaludoX0, Picodes, PwnPatrol, RaymondFam, ReyAdmirado, Rohan16, Rolezn, Ruhum, Sm4rty, StevenL, The_GUILD, TomJ, Tomo, Trust, Waze, __141345__, ajtra, ak1, apostle0x01, aviggiano, bin2chen, bobirichman, brgltd, c3phas, cRat1st0s, carlitox477, cccz, ch13fd357r0y3r, cloudjunky, cryptphi, csanuragjain, d3e4, datapunk, delfin454000, devtooligan, dipp, djxploit, durianSausage, eierina, enckrish, erictee, fatherOfBlocks, gogo, grGred, hansfriese, hyh, ignacio, indijanc, itsmeSTYJ, ladboy233, lukris02, martin, medikko, mics, natzuu, ne0n, nxrblsrpr, okkothejawa, oyc_109, p_crypt0, pfapostol, prasantgupta52, rajatbeladiya, rbserver, reassor, ret2basic, robee, rokinot, rvierdiiev, shenwilly, sikorico, sorrynotsorry, tnevler, tonisives, w0Lfrum, yixxas
54.3128 DAI - $54.31
Occurrences Kernel.executeAction() - is missing zero address validation, allowing the executor and/or admin address to be able to be set to address(0) Kernel.grantRole() - Address(0) can be granted role due to no check for zero address input
Single step critical actionsThe executeAction() function carries out some critical actions which should be broken down into two step calls. e.g change of admin and change of executor
Missing event and emit Policy.setActiveStatus()
Return values ignored Kernel._reconfigurePolicies(Keycode) ignores return value by dependents[i].configureDependencies()
CEI pattern not followed The following functions do not follow the Check-Effect-Interact pattern
Occurrences Kernel.activatePolicy() - calls policy.configureDependencies() before updating state variables Kernel.pruneFromDependents() - calls policy.configureDependencies() before updating state variables OlympusTreasury.repayLoan() in TRSRY.sol - external call token_.safeTransferFrom() before state variables reserveDebt and totalDebt updates. Operator.initialize() - external calls before state variables updates.Operator.operate() - external calls before state variables updates