Platform: Code4rena
Start Date: 11/05/2022
Pot Size: $150,000 USDC
Total HM: 23
Participants: 93
Period: 14 days
Judge: LSDan
Total Solo HM: 18
Id: 123
League: ETH
Rank: 92/93
Findings: 1
Award: $83.25
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: IllIllI
Also found by: 0v3rf10w, 0x1f8b, 0x4non, 0xKitsune, 0xNazgul, 0xf15ers, 0xkatana, BowTiedWardens, CertoraInc, DavidGialdi, FSchmoede, Fitraldys, Funen, GimelSec, Hawkeye, JC, Kaiziron, Kthere, MaratCerby, MiloTruck, NoamYakov, QuantumBrief, Randyyy, Ruhum, SmartSek, SooYa, Tadashi, TerrierLover, Tomio, UnusualTurtle, WatchPug, Waze, _Adam, antonttc, asutorufos, bobirichman, c3phas, catchup, csanuragjain, cthulhu_cult, defsec, delfin454000, ellahi, fatherOfBlocks, hansfriese, hyh, jayjonah8, joestakey, kenta, marcopaladin, mics, minhquanym, orion, oyc_109, reassor, rfa, robee, sach1r0, samruna, sashik_eth, sikorico, simon135, unforgiven, z3s, zmj
83.2512 USDC - $83.25
The contract : https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol at function checks if the msg.sender is the operator using if condition instead of modifier, this consumes gas more than using a modifier
see :
function mint(address _to, uint256 _amount) external { require(totalSupply() != 0, "Not initialised"); if (msg.sender != operator) { // dont error just return. if a shutdown happens, rewards on old system // can still be claimed, just wont mint cvx return; }
consumed :
gas 30114 gas transaction cost 26186 gas execution cost 26186 gas
Using :
modifier isOperator() { require(msg.sender == operator,"not operator"); } function mint(address _to, uint256 _amount) isOperator external { require(totalSupply() != 0, "Not initialised"); }
consumed :
gas 30113 gas transaction cost 26185 gas execution cost 26185 gas
#0 - 0xMaharishi
2022-05-25T17:42:49Z
Incorrect as we don't want to revert. Also, only saves ONE gas
#1 - dmvt
2022-07-04T17:15:39Z
Technically accurate. Letting it stand, although the value is low to non-existent.