Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.86 KB

0x110-G10-Gas.md

File metadata and controls

34 lines (23 loc) · 1.86 KB

G10: Gas usage & limitations

Control Objective

The efficiency of gas consumption should be taken into account not only in terms of optimization but also in terms of safety to avoid possible exhaustion. Smart contracts by nature have different limitations that, if they are not taken into account, can cause different vulnerabilities.

Ensure that a verified contract satisfies the following high-level requirements:

  • The use of gas is optimized and unnecessary losses are prevented,
  • The implementation is in line with the smart contracts' limitations.

Category “G10” lists requirements related to gas and smart contract limitations.

Security Verification Requirements

# Description
G10.1 Verify that the usage of gas in a smart contract is anticipated, defined, and has clear limitations that cannot be exceeded. Both, code structure and malicious input should not cause gas exhaustion.
G10.2 Verify that there is no hard-coded amount of gas assigned to the function call (the gas prices may vary in the future).
G10.3 Verify that the contract does not allow for inflating gas via "return bomb" attack.
G10.4 Verify that there are no unnecessary checks that are always satisfied.

References

For more information, see also:

Smart contract audit

Request an audit of your project by SCSVS authors. Contact a specialist.