solidstate-network/solidstate-solidity

Optimize math library

ItsNickBarry opened this issue · 2 comments

The Math utils library can be optimized using bit shifts and bitwise and operations in place of division and modulo by 2, respectively. Tests should be added before updating.

Required steps:

  1. Create MathMock contract for testing Math library
  2. Test MathMock
  3. Use bit shifts

Ensure that the optimization does not cause overflows or underflows.