Platform: Code4rena
Start Date: 18/10/2022
Pot Size: $75,000 USDC
Total HM: 27
Participants: 144
Period: 7 days
Judge: gzeon
Total Solo HM: 13
Id: 170
League: ETH
Rank: 112/144
Findings: 1
Award: $0.00
π Selected for report: 0
π Solo Findings: 0
π Selected for report: oyc_109
Also found by: 0x040, 0x1f8b, 0x5rings, 0xNazgul, 0xSmartContract, 0xZaharina, 0xsam, 0xzh, 2997ms, Amithuddar, Aymen0909, B2, Bnke0x0, Deivitto, Diana, Dinesh11G, Franfran, JC, JrNet, Jujic, KingNFT, KoKo, Mathieu, Metatron, Mukund, Olivierdem, PaludoX0, Pheonix, Picodes, RaymondFam, RedOneN, ReyAdmirado, Rolezn, Saintcode_, Satyam_Sharma, Shinchan, Tagir2003, Tomio, Waze, Yiko, __141345__, adriro, ajtra, aysha, ballx, beardofginger, bobirichman, brgltd, bulej93, catchup, catwhiskeys, cdahlheimer, ch0bu, chaduke, chrisdior4, cryptostellar5, cylzxje, d3e4, delfin454000, dharma09, djxploit, durianSausage, emrekocak, erictee, exolorkistis, fatherOfBlocks, gianganhnguyen, gogo, halden, hxzy, i_got_hacked, iepathos, karanctf, leosathya, lucacez, lukris02, lyncurion, m_Rassska, martin, mcwildy, mics, nicobevi, peanuts, peiw, rbserver, ret2basic, rotcivegaf, ryshaw, sakman, sakshamguruji, saneryee, sikorico, skyle, svskaushik, tnevler, vv7, w0Lfrum, zishansami
0 USDC - $0.00
&&
operator can be broken down in multiple require statements to save gas.If youβre using the Optimizer at 200, instead of using the &&
operator in a single require statement to check multiple conditions, Consider using multiple require statements with 1 condition per require statement:
Instances include:
require(_bondedOperators[operator] == 0, "HOLOGRAPH: operator is bonded"); require( _bondedAmounts[operator] == 0, "HOLOGRAPH: operator is bonded");
HolographERC721.sol#L263 require(success && selector == InitializableInterface.init.selector, "ERC721: coud not init PA1D"); HolographERC721.sol#L464 require((ERC165(to).supportsInterface(ERC165.supportsInterface.selector) &&ERC165(to).supportsInterface(ERC721TokenReceiver.onERC721Received.selector) &&ERC721TokenReceiver(to).onERC721Received(address(this), from, tokenId, data) ==ERC721TokenReceiver.onERC721Received.selector) ,"ERC721: onERC721Received fail");
Holographer.sol#L166 require(success && selector == InitializableInterface.init.selector, "initialization failed");
Please, note that this might not hold true at a higher number of runs for the Optimizer (10k). However, it indeed is true at 200.
It's better to refactor these into a modifier or function if they start to grow in number.
HolographBridge.sol#L203 & #L255 : (_registry().isHolographedContract(holographableContract) || address(_factory()) ==holographableContract,"HOLOGRAPH: not holographed"); HolographBridge.sol#L214 & #L270 : (selector == Holographable.bridgeOut.selector, "HOLOGRAPH: bridge out failed");
HolographOperator.sol#L728 require(_operatorPods.length >= pod, "HOLOGRAPH: pod does not exist"); HolographOperator.sol#L739 require(_operatorPods.length >= pod, "HOLOGRAPH: pod does not exist"); HolographOperator.sol#L756 require(_operatorPods.length >= pod, "HOLOGRAPH: pod does not exist"); HolographOperator.sol#L839 require(_utilityToken().transferFrom(msg.sender, address(this), amount), "HOLOGRAPH: token transfer failed"); HolographOperator.sol#L889 require(_utilityToken().transferFrom(msg.sender, address(this), amount), "HOLOGRAPH: token transfer failed");