Platform: Code4rena
Start Date: 16/11/2021
Pot Size: $30,000 USDC
Total HM: 3
Participants: 18
Period: 3 days
Judge: leastwood
Total Solo HM: 2
Id: 56
League: ETH
Rank: 17/18
Findings: 1
Award: $29.93
🌟 Selected for report: 1
🚀 Solo Findings: 0
21.2967 USDC - $21.30
xxxxx
Reading a storage variable twice in a function is not a good action.
In the contract "Alchemist.sol" inside the function "acceptGovernance", the state variable "pendingGovernance" is read twice which is not reasonable.
Remix solidity 0.6.12
It is better to move code line 221 before the code line 220 and using _pendingGovernance instead. The result is as follows:
address _pendingGovernance = pendingGovernance; require(msg.sender == _pendingGovernance, 'sender is not pendingGovernance');
#0 - Xuefeng-Zhu
2021-12-09T06:55:30Z
8.6252 USDC - $8.63
xxxxx
The unnecessary code can be removed to reduce contract size.
In the contract "Alchemist.sol" the function "_expectCaller" is never used.
Remix solidity 0.6.12
The function "_expectCaller(address _expectedCaller)" can be removed.