Skip to content
Projects

About

A list of common Solidity optimization tips and myths.

Learning & Education

How these counts are measured

Measured star growth

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

golf-course

A list of common Solidity optimization tips and myths.

Tips

Right Shift Instead of Dividing By 2

The SHR opcode is 3 gas cheaper than DIV and also bypasses Solidity's division by 0 prevention overhead.

// Unoptimized:
uint256 two = 4 / 2;

// Optimized:
uint256 two = 4 >> 1;

Myths

Explore related projects

Loading…