Platform: Code4rena
Start Date: 06/09/2022
Pot Size: $90,000 USDC
Total HM: 33
Participants: 168
Period: 9 days
Judge: GalloDaSballo
Total Solo HM: 10
Id: 157
League: ETH
Rank: 111/168
Findings: 1
Award: $60.78
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Lambda
Also found by: 0x1337, 0x1f8b, 0x4non, 0x85102, 0xA5DF, 0xNazgul, 0xSmartContract, 0xbepresent, 0xc0ffEE, 8olidity, Aymen0909, B2, Bnke0x0, CRYP70, Captainkay, CertoraInc, Ch_301, Chom, ChristianKuri, CodingNameKiki, Deivitto, Diana, DimitarDimitrov, ElKu, EthLedger, Franfran, Funen, GimelSec, JansenC, Jeiwan, Jujic, Lead_Belly, MEP, MasterCookie, MiloTruck, Noah3o6, PPrieditis, PaludoX0, Picodes, PwnPatrol, R2, Randyyy, RaymondFam, Respx, ReyAdmirado, Rolezn, Samatak, Tointer, Tomo, V_B, Waze, _Adam, __141345__, a12jmx, ak1, asutorufos, azephiar, ballx, bharg4v, bin2chen, bobirichman, brgltd, bulej93, c3phas, cccz, ch0bu, cloudjunky, cryptonue, cryptostellar5, cryptphi, csanuragjain, d3e4, datapunk, davidbrai, delfin454000, dharma09, dic0de, dipp, djxploit, eierina, erictee, fatherOfBlocks, gogo, hansfriese, hyh, imare, indijanc, izhuer, jonatascm, ladboy233, leosathya, lucacez, lukris02, m9800, martin, minhtrng, ne0n, neumo, oyc_109, p_crypt0, pashov, pauliax, pcarranzav, pedr02b2, peritoflores, pfapostol, rbserver, ret2basic, robee, rvierdiiev, sach1r0, sahar, scaraven, sikorico, simon135, slowmoses, sorrynotsorry, tnevler, tonisives, volky, yixxas, zkhorse, zzzitron
60.7775 USDC - $60.78
Unchecked Arrays in the execute Function,The lengths of _targets,_values, and _calldatas may all be different. The for loop in the code relies on _targets.
function execute( address[] calldata _targets, uint256[] calldata _values, bytes[] calldata _calldatas, bytes32 _descriptionHash ) external payable onlyOwner { // Get the proposal id bytes32 proposalId = hashProposal(_targets, _values, _calldatas, _descriptionHash); // Ensure the proposal is ready to execute if (!isReady(proposalId)) revert EXECUTION_NOT_READY(proposalId); // Remove the proposal from the queue delete timestamps[proposalId]; // Cache the number of targets uint256 numTargets = _targets.length; // Cannot realistically overflow unchecked { // For each target: for (uint256 i = 0; i < numTargets; ++i) { // Execute the transaction (bool success, ) = _targets[i].call{ value: _values[i] }(_calldatas[i]); // Ensure the transaction succeeded if (!success) revert EXECUTION_FAILED(i); } } emit TransactionExecuted(proposalId, _targets, _values, _calldatas); }
vscode
if (numTargets != _values.length) revert PROPOSAL_LENGTH_MISMATCH(); if (numTargets != _calldatas.length) revert PROPOSAL_LENGTH_MISMATCH();
#0 - GalloDaSballo
2022-09-16T01:37:49Z
You would get a revert which would be ungracefully handled, I think QA-Refactoring is more appropriate
#1 - GalloDaSballo
2022-09-28T22:48:02Z
R