ENS Contest - saneryee's results

Decentralised naming for web3

General Information

Platform: Code4rena

Start Date: 14/04/2023

Pot Size: $90,500 USDC

Total HM: 7

Participants: 59

Period: 14 days

Judge: LSDan

Total Solo HM: 3

Id: 232

League: ETH

ENS

Findings Distribution

Researcher Performance

Rank: 26/59

Findings: 1

Award: $119.79

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: JCN

Also found by: Sathish9098, d3e4, descharre, naman1778, niser93, openwide, saneryee

Labels

bug
G (Gas Optimization)
grade-b
low quality report
G-08

Awards

119.7884 USDC - $119.79

External Links

Gas Optimizations Report

Report Date: 2023-04-20 06:00:54

IssueInstances
[G-01]Multiple accesses of a mapping/array should use a local variable cache1

[G-01] Multiple accesses of a mapping/array should use a local variable cache

Impact

The instances below point to the second+ access of a value inside a mapping/array, 1within a function. Caching a mapping's value in a local storage or calldata variable when the value is accessed multiple times, saves ~42 gas per access due to not having to recalculate the key's keccak256 hash (Gkeccak256 - 30 gas) and that calculation's associated stack operations. Caching an array's struct avoids recalculating the array offsets into memory/calldata

Findings

Total:1

contracts/dnssec-oracle/DNSSECImpl.sol#L46 contracts/dnssec-oracle/DNSSECImpl.sol#L415-L425

46:     mapping(uint8 => Digest) public digests;
......
415:    function verifyDSHash(
416:         uint8 digesttype,
417:         bytes memory data,
418:         bytes memory digest
419:     ) internal view returns (bool) {
420:         if (address(digests[digesttype]) == address(0)) {
421:             return false;
422:         }
423:         return digests[digesttype].verify(data, digest);
424:     }
425: }

#0 - thereksfour

2023-05-02T08:04:32Z

Insufficient amount

#1 - c4-pre-sort

2023-05-02T08:04:37Z

thereksfour marked the issue as low quality report

#2 - c4-judge

2023-05-08T09:38:34Z

dmvt marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter