You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Including an optional string comment in a passing require statement increases the gas cost of that transaction.
Scenario
Every require statement in the scope of this bounty includes a string comment that explains why the transaction would throw an exception. While helpful in debugging contracts during development, users rarely see these strings returned when they interact with the contract. For example, if a user sends a transaction via MetaMask, they do not see the string even if their transaction triggered an exception. These strings add additional gas costs to valid transactions compared to the same require statements without the strings.
Impact
This is a very minor note. Removing the string comments would save something on the order of ~100-200 gas per transaction.
Fix
Consider removing or shortening the strings in the require statements and adding them as comments in the verified contract.
The text was updated successfully, but these errors were encountered:
Users rarely see these strings returned when they interact with the contract.
My understanding is that EIP 140 and similar efforts are moving to have these strings returned to users all of the time. It would be forward-looking to continue to include the string comments in the require statements of Offers.sol, especially with such a minimal potential gain of ~100-200 gas.
Description
Including an optional string comment in a passing require statement increases the gas cost of that transaction.
Scenario
Every require statement in the scope of this bounty includes a string comment that explains why the transaction would throw an exception. While helpful in debugging contracts during development, users rarely see these strings returned when they interact with the contract. For example, if a user sends a transaction via MetaMask, they do not see the string even if their transaction triggered an exception. These strings add additional gas costs to valid transactions compared to the same require statements without the strings.
Impact
This is a very minor note. Removing the string comments would save something on the order of ~100-200 gas per transaction.
Fix
Consider removing or shortening the strings in the require statements and adding them as comments in the verified contract.
The text was updated successfully, but these errors were encountered: