/solidity-fixedpoint

Implements fixed point numbers in Solidity using the Q number format.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Solidity Fixed Point Library

Actions Status npm

Implements fixed point numbers in Solidity using the Q number format.

Built off the Uniswap FixedPoint and Babylonian libraries developed by moodysalem.

This library uses the UQ192x64 format to maximize the range of fixed point numbers while keeping the resolution close to the 18 decimal places that is standard for most Solidity contracts.

Uniswap originally used the UQ112x112 format to optimize the variable packing in their contracts.

Install Dependencies

npm install

Compile Contracts

npx buidler compile

Run Tests

npx buidler test

Contributors