This repository contains a collection of Move modules implementing various integer sizes. These modules are designed to provide more flexibility in integer operations within Move smart contracts.
The following modules are included:
i8.move
: 8-bit signed integer operationsi16.move
: 16-bit signed integer operationsi32.move
: 32-bit signed integer operationsi64.move
: 64-bit signed integer operationsi128.move
: 128-bit signed integer operationsi256.move
: 256-bit signed integer operations
Each module provides basic arithmetic operations and comparisons for its respective integer size.
To use these modules in your Move project, you can import them as follows:
use 0xfff3b2d7c65b54bd8643cf5b66a7aaf8461d0a533fce0dd88684b0acdc5e3fff::i64;
use 0xfff3b2d7c65b54bd8643cf5b66a7aaf8461d0a533fce0dd88684b0acdc5e3fff::i128;
// ... and so on for other modules
Unit tests for each module can be found in the module. To run the tests, use the Move CLI:
aptos move test
Contributions to improve these modules are welcome. Please ensure you add appropriate tests for any new functionality.
This project drew inspiration from the Integer Mate repository by Cetus Protocol. Their work has been a valuable contribution to the Move ecosystem.
This project is licensed under the MIT License.
For questions or concerns, you can reach out to the maintainer on Twitter: @0xanto
Remember to use these modules responsibly and consider a thorough audit before deploying them in any production environment.