Platform: Code4rena
Start Date: 30/11/2021
Pot Size: $30,000 USDC
Total HM: 0
Participants: 21
Period: 3 days
Judge: pauliax
Id: 63
League: ETH
Rank: 13/21
Findings: 1
Award: $76.43
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: tqts
73.5785 USDC - $73.58
tqts
Saving of one SLOAD instruction
The value of claimed[thisSender] + multiplier
is used twice in ngmi(uint256,uint256,bytes32[])
. This involves a SLOAD each time it is calculated.
Usages in lines 73 and 76 of TRIBERagequit.sol.
Manual review
Precache the value of the expression right before line 72. Worst case, if the require fails, no extra gas is used. Best case, if the require succeeds, the SLOAD in line 76 is saved.
#0 - pauliax
2021-12-10T16:13:32Z
Valid optimization.
tqts
Extra gas consumption when calling affected functions, since their visibility is public and they're never called from within the contract.
Functions affected:
TribeRagequit.ngmi(uint256, uint256, bytes32[]) https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L59
TribeRagequit.requery() https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L110
PegExchanger.party0Accept() https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L204
PegExchanger.party1Accept() https://github.com/code-423n4/2021-11-fei/blob/add34324513b863f58e4ef7b3cd0c12d776dbb7f/contracts/TRIBERagequit.sol#L216
Slither
Change visibility to external
#0 - elee1766
2021-12-06T03:06:04Z
duplicate #27
#1 - pauliax
2021-12-11T10:18:39Z
A duplicate of #27