40,000 USDC
View results
Submission Details
Severity: gas

Optimize names to save gas

Summary

Optimize names to save gas

Vulnerability Details

public/external function names and public member variable names can be optimized to save gas. See this link for an example of how it works. Below are the interfaces/abstract contracts that can be optimized so that the most frequently-called functions use the least amount of gas possible during method lookup. Method IDs that have two leading zero bytes can save 128 gas each during deployment, and renaming functions to have lower method IDs will save 22 gas per call, per sorted position shifted

Impact

Save gas

Tools Used

Manual

Recommendations

Use the following suggested names:

File: /src/IEscrow.sol
// @audit confirmReceipt() ==> confirmReceipt_HgU(),000063eb
32: function confirmReceipt() external;
// @audit initiateDispute() ==> initiateDispute_B51x(),0000e3ee
39: function initiateDispute() external;
// @audit resolveDispute(uint256) ==> resolveDispute_1EO(uint256),0000d741
43: function resolveDispute(uint256 buyerAward) external;
// @audit getPrice() ==> getPrice_Aqz(),00007f6b
49: function getPrice() external view returns (uint256);
// @audit getTokenContract() ==> getTokenContract_mBw(),0000617d
51: function getTokenContract() external view returns (IERC20);
// @audit getBuyer() ==> getBuyer_95S(),0000ad4f
53: function getBuyer() external view returns (address);
// @audit getSeller() ==> getSeller_g1Y(),0000421e
55: function getSeller() external view returns (address);
// @audit getArbiter() ==> getArbiter_A7r(),000006b6
57: function getArbiter() external view returns (address);
// @audit getArbiterFee() ==> getArbiterFee_W4m(),00006c84
59: function getArbiterFee() external view returns (uint256);
// @audit getState() ==> getState_7ks(),00001fc3
61: function getState() external view returns (State);

Support

FAQs

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