{"id":13767121,"url":"https://github.com/PraneshASP/huff-math","last_synced_at":"2025-05-10T22:31:30.490Z","repository":{"id":37250717,"uuid":"505047597","full_name":"PraneshASP/huff-math","owner":"PraneshASP","description":"This repo contains smart contract to perform basic arithmetic operations implemented using Huff","archived":false,"fork":false,"pushed_at":"2024-04-26T16:17:06.000Z","size":76,"stargazers_count":24,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-17T02:34:24.064Z","etag":null,"topics":["evm","huff","solidity"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PraneshASP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-19T08:03:07.000Z","updated_at":"2023-12-01T16:49:53.000Z","dependencies_parsed_at":"2024-01-11T23:46:50.560Z","dependency_job_id":"be219dc1-0e44-43f5-95cd-cae876f95e31","html_url":"https://github.com/PraneshASP/huff-math","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PraneshASP%2Fhuff-math","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PraneshASP%2Fhuff-math/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PraneshASP%2Fhuff-math/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PraneshASP%2Fhuff-math/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PraneshASP","download_url":"https://codeload.github.com/PraneshASP/huff-math/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492529,"owners_count":21916959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["evm","huff","solidity"],"created_at":"2024-08-03T16:01:04.936Z","updated_at":"2025-05-10T22:31:30.159Z","avatar_url":"https://github.com/PraneshASP.png","language":"Solidity","readme":"# Huffmath • [![Tests](https://github.com/PraneshASP/huff-math/actions/workflows/tests.yaml/badge.svg)](https://github.com/PraneshASP/huff-math/actions/workflows/tests.yaml)[![license](https://img.shields.io/badge/Unlicense-blue.svg?label=license)](https://opensource.org/licenses/unlicense) ![solidity](https://img.shields.io/badge/solidity-%3E%3D0.8.13%20%3C0.9.0-lightgrey)\n\n\u003ch3\u003e\n\nA math library implementation using [**Huff**](https://docs.huff.sh).\n\n\u003c/h3\u003e\n \n## What?\n\nThis repo contains smart contracts for simple math operations implemented using Huff. Though there are testcases implemened the contracts are not audited. Use at your own risk.\n\n### Requirements\n\nThe following will need to be installed in order to use this repo. Please follow the links and instructions.\n\n- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n  - You'll know you've done it right if you can run `git --version`\n- [Foundry / Foundryup](https://github.com/gakonst/foundry)\n  - This will install `forge`, `cast`, and `anvil`\n  - You can test you've installed them right by running `forge --version` and get an output like: `forge 0.2.0 (f016135 2022-07-04T00:15:02.930499Z)`\n  - To get the latest of each, just run `foundryup`\n- [Huff Compiler](https://docs.huff.sh/get-started/installing/)\n  - You'll know you've done it right if you can run `huffc --version` and get an output like: `huffc 0.2.0`\n\n### Quickstart\n\n1. Clone this repo:\n\n```\ngit clone https://github.com/PraneshASP/huff-math\ncd huff-math\n```\n\n2. Install dependencies\n\nOnce you've cloned and entered into your repository, you need to install the necessary dependencies. In order to do so, simply run:\n\n```shell\nforge install\n```\n\n3. Build \u0026 Test\n\nTo build and test your contracts, you can run:\n\n```shell\nforge build\nforge test\n```\n\nFor more information on how to use Foundry, check out the [Foundry Github Repository](https://github.com/foundry-rs/foundry/tree/master/forge) and the [foundry-huff library repository](https://github.com/huff-language/foundry-huff).\n\n## Blueprint\n\n```ml\nlib\n├─ forge-std — https://github.com/foundry-rs/forge-std\n├─ foundry-huff — https://github.com/huff-language/foundry-huff\nsrc\n ├─ Math.huff — Huff library for simple math operations (experimental)\n ├─ WadRayMath.huff - Optimized Huff library for high presicion math (upto 27 digit decimals)\ntest\n ├─ Math.t.huff\n └─ WadRayMath.t.huff\n```\n\n## License\n\n[The Unlicense](https://github.com/PraneshASP/huff-math/blob/master/LICENSE)\n\n## Acknowledgements\n\n- [foundry-huff-template](https://github.com/huff-language/huff-project-template)\n- [Huffmate](https://github.com/pentagonxyz/huffmate)\n- [Aave](https://github.com/aave)\n\n## TODO\n\n- [x] Add support for `ln()` and `exp()`\n- [ ] Add fuzz tests\n- [ ] Handle reverts with reason string??\n\n## Disclaimer\n\n_These smart contracts are being provided as is. No guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the user interface or the smart contracts. They have not been audited and as such there can be no assurance they will work as intended, and users may experience delays, failures, errors, omissions, loss of transmitted information or loss of funds. The creators are not liable for any of the foregoing. Users should proceed with caution and use at their own risk._\n","funding_links":[],"categories":["Huff projects you can learn from and contribute to"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPraneshASP%2Fhuff-math","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPraneshASP%2Fhuff-math","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPraneshASP%2Fhuff-math/lists"}