Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💥 Implement ERC-4626 Tokenised Vault #74

Merged
merged 34 commits into from
Feb 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9960760
🔨 started implementing ERC4626
pcaversaccio Feb 15, 2023
bb2e9f5
📖 add README and CHANGELOG entries
pcaversaccio Feb 16, 2023
7b621eb
🔨 mul_div function
pcaversaccio Feb 16, 2023
5cad78d
🔨 mul_div tests
pcaversaccio Feb 16, 2023
d2acac9
🔨 fix overflow failing test
pcaversaccio Feb 16, 2023
cedc942
🔨 further small optimisation in mul_div
pcaversaccio Feb 17, 2023
58a5824
♻️ fix yarn.lock & update submodules
pcaversaccio Feb 17, 2023
61862fd
Merge branch 'main' into feat/erc4626
pcaversaccio Feb 17, 2023
478d087
🕵️ change `~empty(uint256)` to `max_value(uint256)` for gas optimisation
pcaversaccio Feb 19, 2023
0ad5cf4
♻️ cleanup
pcaversaccio Feb 19, 2023
e2a5b8f
Merge branch 'main' into feat/erc4626
pcaversaccio Feb 19, 2023
c3af8cf
Merge branch 'main' into feat/erc4626
pcaversaccio Feb 20, 2023
3b86485
♻️ bump @types/node
pcaversaccio Feb 20, 2023
b2cb791
Merge branch 'main' into feat/erc4626
pcaversaccio Feb 20, 2023
e8d43ca
👀 first version
pcaversaccio Feb 20, 2023
1d50a47
⛏ fix link in ERC20
pcaversaccio Feb 21, 2023
0457787
✍🏽 code comments
pcaversaccio Feb 21, 2023
7a1f0ca
✍🏽 further code comments
pcaversaccio Feb 21, 2023
c785a4c
✍🏽 further code comments
pcaversaccio Feb 21, 2023
f4bed69
Merge branch 'main' into feat/erc4626
pcaversaccio Feb 22, 2023
f2f8d9e
🔨 erc4626 test setup
pcaversaccio Feb 22, 2023
328a36e
forge install: erc4626-tests
pcaversaccio Feb 22, 2023
de44bef
🔨 erc4626 fuzz tests
pcaversaccio Feb 22, 2023
7046a10
🔨 increase max rejects
pcaversaccio Feb 22, 2023
66ab83a
🔨 initial setup tests
pcaversaccio Feb 23, 2023
f3bc2e0
🔨 testEmptyVaultDeposit
pcaversaccio Feb 23, 2023
f639e9c
🔨 tests EmptyVault
pcaversaccio Feb 24, 2023
d666483
🔨 furter ERC4626 tests
pcaversaccio Feb 24, 2023
cc15b96
🔨 invariant tests
pcaversaccio Feb 24, 2023
896f110
📖 add comments on external code size checks
pcaversaccio Feb 24, 2023
1e6783b
⬆️ update to solc 0.8.19
pcaversaccio Feb 25, 2023
b3e09e3
♻️ bump eslint and submodules
pcaversaccio Feb 26, 2023
5319c91
♻️ refactors and gas snapshot
pcaversaccio Feb 26, 2023
4e8ba3f
♻️ correct test code comments
pcaversaccio Feb 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🕵️ change ~empty(uint256) to max_value(uint256) for gas optimisation
Co-authored-by: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com>

Signed-off-by: Pascal Marco Caversaccio <pcaversaccio@users.noreply.github.com>
  • Loading branch information
pcaversaccio authored Feb 19, 2023
commit 478d087829b9b71832a5ce4f03cd335f020e1333
2 changes: 1 addition & 1 deletion src/utils/Math.vy
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def mul_div(x: uint256, y: uint256, denominator: uint256, roundup: bool) -> uint
# Then use the Chinese Remainder theorem to reconstruct
# the 512-bit result. The result is stored in two 256-bit
# variables, where: "product = prod1 * 2**256 + prod0".
mm: uint256 = uint256_mulmod(x, y, ~empty(uint256))
mm: uint256 = uint256_mulmod(x, y, max_value(uint256))
# The least significant 256 bits of the product.
prod0: uint256 = unsafe_mul(x, y)
# The most significant 256 bits of the product.
Expand Down