40,000 USDC
View results
Submission Details
Severity: gas
Valid

[Gas-01] Zero Address Should Checked Using assembly Which will be more gas efficient

Instances(4)

File: Escrow.sol
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L40
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L41
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L42
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L103

[Gas-02] Splitting if() statements that use && saves gas

Saves 13 gas per instance

Instances(1)

File: Escrow.sol
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L67

[Gas-03] Use == Instead of != Which Is More Gas Efficient

Instances(3)

File: Escrow.sol
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L59
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L67
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L75

[Gas-04] address(this) Could Be Hardcoded In A immutable Variable Instead Of Calculating That Again And Again.

Instances(3)

File: Escrow.sol
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L44
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L110
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L125

[Gas-05] Instead Of Using > 0, != 0 Could Be Used Which Is More Gas Efficient.

- if(buyerAward > 0){
+ if(buyerAward != 0){

Instances(3)

File: Escrow.sol
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L119
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L122
https://github.com/Cyfrin/2023-07-escrow/blob/main/src/Escrow.sol#L126

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.