Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
/ Uint-Array-Utils Public archive

A small library with useful functions for Solidity Uint arrays.

License

Notifications You must be signed in to change notification settings

clemlak/Uint-Array-Utils

Repository files navigation

Uint Array Utils

A small library with useful functions for Solidity Uint arrays.

Please keep in mind that this library is a work in progress, new things will be added or modified in the future.

Installation

npm package will be released later.

For now, simply copy the UintArrayUtils.sol file in your contracts folder, import it with import "./UintArrayUtils.sol" and use it with using UintArrayUtils for uint[];.

Additionally, you may need to link the library to your contract with deployer.link(UintArrayUtils, YourContract); in your migration files.

(If you're stuck, take a look at the project files, you'll find a complete example there!)

Usage

Available functions: getMax(uint[] a) getMin(uint[] a) sum(uint[] a) checkDuplicates(uint[] a) checkMatchingValues(uint[] a, uint[] b) concat(uint[] a, uint[] b)

Contribution

Feel free to share any ideas to improve this library!

License

MIT

About

A small library with useful functions for Solidity Uint arrays.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published