Vladislav Volosnikov
dfae50fa5b
Refactor abs without logical branching ( #4497 )
...
Co-authored-by: Francisco Giordano <fg@frang.io>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: ernestognw <ernestognw@gmail.com>
1 year ago
Hadrien Croubois
a72c9561b9
Finalize test migration: remove legacy dependencies and test helpers ( #4797 )
1 year ago
Hadrien Croubois
015ef69287
Refactor time helper and remove custom error helper. ( #4803 )
...
Co-authored-by: ernestognw <ernestognw@gmail.com>
1 year ago
Hadrien Croubois
cffb2f1ddc
Migrate math tests to ethers.js v6 ( #4769 )
...
Co-authored-by: Ernesto García <ernestognw@gmail.com>
1 year ago
carter-ya
e5fb718d40
Optimized gas costs in `ceilDiv` ( #4553 )
1 year ago
Francisco
8643fd45fd
Update remappings and install instructions for Foundry on docs site ( #4498 )
...
Co-authored-by: ernestognw <ernestognw@gmail.com>
2 years ago
Hadrien Croubois
00cbf5a236
Update pragma to 0.8.20 ( #4489 )
...
Co-authored-by: Francisco Giordano <fg@frang.io>
Co-authored-by: ernestognw <ernestognw@gmail.com>
2 years ago
Francisco
84db204a41
Rename rounding modes and complete with fourth ( #4455 )
...
Co-authored-by: ernestognw <ernestognw@gmail.com>
2 years ago
Francisco
874c2d3c02
Use explicit imports ( #4399 )
...
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: ernestognw <ernestognw@gmail.com>
2 years ago
Ernesto García
2477534260
Change behavior of ceilDiv(0, 0) and improve test coverage ( #4348 )
2 years ago
Ernesto García
b425a72240
Replace revert strings with custom errors ( #4261 )
...
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <fg@frang.io>
2 years ago
Ernesto García
7bb5592ad5
Bump minimum pragma version to `0.8.19` ( #4288 )
2 years ago
Hadrien Croubois
0f10efe232
Remove code in preparation for v5.0 ( #4258 )
...
Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: Francisco <fg@frang.io>
2 years ago
Hadrien Croubois
d64d7aa5d1
ERC4626 inflation attack mitigation ( #3979 )
...
Co-authored-by: Francisco <fg@frang.io>
2 years ago
Francisco
a28aafdc85
Use Prettier for JS files ( #3913 )
...
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2 years ago
Hadrien Croubois
c1d9da4052
Use hardhat-exposed to reduce the need for mocks ( #3666 )
...
Co-authored-by: Francisco <fg@frang.io>
2 years ago
Francisco
2336bd3e8e
Simplify ESLint config ( #3903 )
2 years ago
Francisco Giordano
4147005b0c
Update Prettier Solidity ( #3898 )
2 years ago
Francisco
b709eae01d
Update Prettier Solidity ( #3898 )
2 years ago
GitHubPang
7201e6707f
Fix typo in a comment ( #3747 )
2 years ago
Francisco
c08c6e1b84
Add fuzz testing of mulDiv ( #3717 )
...
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
2 years ago
Francisco
8f0d4d4a41
Fix fuzzing coverage ( #3716 )
2 years ago
Nicolás Venturo
80ae402387
Add fuzz tests for Math.sqrt & Math.logX using Foundry ( #3676 )
...
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
2 years ago
Hadrien Croubois
c1d6e39aab
Add log2, log10 and log256 functions ( #3670 )
2 years ago
jjz
3ac4add548
Add sqrt for math ( #3242 )
3 years ago
Hadrien Croubois
5e00787199
ERC4626 ( #3171 )
3 years ago
Hadrien Croubois
b61faf8368
Procedural SafeCast.sol generation ( #3245 )
3 years ago
Hadrien Croubois
3eb2d43b06
Move abs(int256) from Math to SafeMath ( #3110 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
3 years ago
rotcivegaf
3458c1e854
Add SignedMath with math utilities for signed integers ( #2686 )
...
* add contract and tests
* avoid implicit cast
* add test cases
* fix test names
* modify avarage and add tests
* improve signed average formula
* fix lint
* better average formula
* refactor signed average testing
* add doc and changelog entry
* Update contracts/utils/math/SignedMath.sol
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
* remove ceilDiv
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
3 years ago
barakman
f6db5c1f30
A function which returns the absolute value of a signed value ( #2984 )
...
* Add a function which returns the absolute (and obviously unsigned) value of a signed value.
* add changelog entry and fix lint
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
3 years ago
rotcivegaf
6d97f09195
Gas optimization on average function of Math.sol ( #2757 )
...
* change implementation to save gas
* add average test with two max uni256 number
4 years ago
Hadrien Croubois
e3661abe84
Split ERC20Votes and ERC20VotesComp ( #2706 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Nicholas Rodrigues Lordello
7c754d0665
Add ceiling division operation to the `Math.sol` library ( #2681 )
...
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago
Hadrien Croubois
24a0bc23cf
Reorganize the repo structure ( #2503 )
...
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
4 years ago