Platform: Code4rena
Start Date: 02/06/2023
Pot Size: $100,000 USDC
Total HM: 15
Participants: 75
Period: 7 days
Judge: Picodes
Total Solo HM: 5
Id: 249
League: ETH
Rank: 59/75
Findings: 1
Award: $21.62
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: JCN
Also found by: 0x70C9, 0xSmartContract, 0xWaitress, 0xhacksmithh, DavidGiladi, K42, LaScaloneta, Rageur, Raihan, SAAJ, SAQ, SM3_SS, Sathish9098, Tomio, bigtone, c3phas, ernestognw, etherhood, koxuan, matrix_0wl, mgf15, naman1778, niser93, petrichor, piyushshukla, sebghatullah, shamsulhaq123
21.6219 USDC - $21.62
Issue | Instances | |
---|---|---|
GAS-1 | To optimize gas usage, invoke this external function once | 2 |
GAS-2 | It doesn't need to calculate the bids amount. | 1 |
Issue | Instances | |
---|---|---|
GAS-1 | To optimize gas usage, invoke this external function once | 2 |
GAS-2 | It doesn't need to calculate the bids amount. | 1 |
To optimize gas usage, invoke this external function once staderConfig.getStakePoolManager()
, staderConfig.getStaderTreasury()
File: contracts/Auction.sol:L102-L103 IStaderStakePoolManager(staderConfig.getStakePoolManager()).receiveEthFromAuction{value: ethAmount}(); emit ETHClaimed(lotId, staderConfig.getStakePoolManager(), ethAmount); File: contracts/Auction.sol:L114-L117 if (!IERC20(staderConfig.getStaderToken()).transfer(staderConfig.getStaderTreasury(), _sdAmount)) { revert SDTransferFailed(); } emit UnsuccessfulSDAuctionExtracted(lotId, _sdAmount, staderConfig.getStaderTreasury());
Recommend that declare the local variable to save address and use it.
It doesn't need to calculate the bids amount.
File: contracts/Auction.sol:L128 lotItem.bids[msg.sender] -= withdrawalAmount; File: contracts/Auction.sol:L128 lotItem.bids[msg.sender] = 0;
Recommend to directly set it to 0.
#0 - c4-judge
2023-06-13T21:36:08Z
Picodes marked the issue as grade-b