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
♻️ correct test code comments
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
  • Loading branch information
pcaversaccio committed Feb 26, 2023
commit 4e8ba3f64da0a8dbff2c7100898d64a0203c31ef
7 changes: 3 additions & 4 deletions test/extensions/ERC4626.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ contract ERC4626VaultTest is ERC4626Test {
vm.stopPrank();

/**
* @dev 5. Bob mints 2000 shares (costs 3001 assets).
* @dev 5. Bob mints 2000 shares (costs 3000 assets).
* @notice Bob's assets spent got rounded up and Alices's
* vault assets got rounded up.
*/
Expand Down Expand Up @@ -1306,7 +1306,6 @@ contract ERC4626VaultTest is ERC4626Test {

/**
* @dev 6. Vault mutates by +3000 tokens.
* @notice Vault holds 17001 tokens, but sum of `assetsOf()` is 17000.
*/
underlying.mint(
ERC4626ExtendedDecimalsOffset0Addr,
Expand All @@ -1327,7 +1326,7 @@ contract ERC4626VaultTest is ERC4626Test {
);

/**
* @dev 7. Alice redeems 1333 shares (2428 assets).
* @dev 7. Alice redeems 1333 shares (2427 assets).
*/
vm.startPrank(alice);
ERC4626ExtendedDecimalsOffset0.redeem(1333, alice, alice);
Expand Down Expand Up @@ -1400,7 +1399,7 @@ contract ERC4626VaultTest is ERC4626Test {
vm.stopPrank();

/**
* @dev 10. Bob redeems 4392 shares (8001 tokens).
* @dev 10. Bob redeems 4392 shares (8000 tokens).
*/
vm.startPrank(bob);
ERC4626ExtendedDecimalsOffset0.redeem(4392, bob, bob);
Expand Down