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 0xfff1e5bad5901cdb1c6755ece8603b992b3f0000a3e5b96d8d0bdc49d6433fff::i64;
use 0xfff1e5bad5901cdb1c6755ece8603b992b3f0000a3e5b96d8d0bdc49d6433fff::i128;
// ... and so on for other modules
aptos move test
Module | Coverage (%) |
---|---|
fff3b2d7c65b54bd8643cf5b66a7aaf8461d0a533fce0dd88684b0acdc5e3fff::i128 | 100.00 |
fff3b2d7c65b54bd8643cf5b66a7aaf8461d0a533fce0dd88684b0acdc5e3fff::i16 | 100.00 |
fff3b2d7c65b54bd8643cf5b66a7aaf8461d0a533fce0dd88684b0acdc5e3fff::i256 | 100.00 |
fff3b2d7c65b54bd8643cf5b66a7aaf8461d0a533fce0dd88684b0acdc5e3fff::i32 | 100.00 |
fff3b2d7c65b54bd8643cf5b66a7aaf8461d0a533fce0dd88684b0acdc5e3fff::i64 | 100.00 |
fff3b2d7c65b54bd8643cf5b66a7aaf8461d0a533fce0dd88684b0acdc5e3fff::i8 | 100.00 |
Overall Move Coverage | 100.00% |
- Make functions inline.
- Write MSL specs to prove the contract.
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. @ Antony Ranjith F
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.