code-423n4 / 2022-01-sherlock-findings

0 stars 0 forks source link

cheaper gas to use `claim.state` and `claim.updated` #246

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

Tomio

Vulnerability details

Impact

Expensive gas

Proof of Concept

https://github.com/code-423n4/2022-01-sherlock/blob/main/contracts/managers/SherlockClaimManager.sol#L184

Tools Used

Remix

Recommended Mitigation Steps

Change:

claims_[_claimIdentifier].state = _state;
claims_[_claimIdentifier].updated = block.timestamp;

To:

claim.state = _state;
claim.updated = block.timestamp;
jack-the-pug commented 2 years ago

Dup #200