Skip to content

About

A list of common Solidity optimization tips and myths.

Resources

Stars

205 stars

Watchers

14 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

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

About

A list of common Solidity optimization tips and myths.

Resources

Stars

205 stars

Watchers

14 watching

Forks

Releases

Packages

Contributors